dmlc/mshadow

Is this a bug of operator[] ?

x10000year opened this issue · 0 comments

In line 509 of tensor.h

/*!

  • \brief get a element of dimension - 1
  • \param idx index
  • \return the result tensor
    */
    MSHADOW_XINLINE Tensor<Device, kSubdim, DType> operator[](index_t idx) const {
    return Tensor<Device, kSubdim, DType>(dptr_ + this->MemSize<1>() * idx,
    shape_.SubShape(), stride_, stream_);
    }

The template argument of MemSize seems wrong.