 
 template <typename IndexType, int Dims>
 __global__ void THCudaTensor_scatterKernel(
-    SimpleTensorInfo<IndexType> tensor,
-    SimpleTensorInfo<IndexType> src,
-    SimpleTensorInfo<IndexType> index,
+    TensorInfo<IndexType> tensor,
+    TensorInfo<IndexType> src,
+    TensorInfo<IndexType> index,
     const int dim,
     const IndexType totalElements) {
   for (IndexType linearId = blockIdx.x * blockDim.x + threadIdx.x;

struct IndexToScatterGatherOffsets<IndexType, -1> {
  static __device__ void compute(
      IndexType linearId, const int dim,
      const SimpleTensorInfo<IndexType>& index, IndexType* indexOffset,
      const SimpleTensorInfo<IndexType>& t1, IndexType* t1Offset,
      const SimpleTensorInfo<IndexType>& t2, IndexType* t2Offset) {
    for (int d = index.dims - 1; d >= 0; d--) {
      IndexType curDimIndex = linearId % index.sizes[d];
      *indexOffset += curDimIndex * index.strides[d];


  static __device__ void compute(
      IndexType linearId, const int dim,
      const TensorInfo<IndexType>& index, IndexType* indexOffset,
      const TensorInfo<IndexType>& t2, IndexType* t2Offset) {
    for (int d = Dims - 1; d >= 0; d--) {
      IndexType curDimIndex = linearId % index.sizes[d];
      *indexOffset += curDimIndex * index.strides[d];
