     if(index < length) {
       outShape.dims(index, dims);
       dims[axis] = d_indices[dims[axis]];
-      int inIndex = inShape.bindex(dims);
+      int inIndex = inShape.index(dims);
       out[index] = in[inIndex];
     }
   }

    if(index < length) {
      inShape.dims(index, dims);
      dims[axis] = d_indices[dims[index]];
      int outIndex = outShape.bindex(dims);
      out[outIndex] = in[index];
    }
  }

        dims[axis] -= lengths[i++];

      inShape.set(axis, lengths[i]);
      int inIndex = inShape.index(dims);

      const float* in = ins[i];
      out[index] = in[inIndex];
