Skip to content

Commit

Permalink
[Update] change get_with_shape to concrete shape
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Oct 23, 2015
1 parent 4962811 commit 5ec7cc4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mshadow/tensor_blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ class TBlob {
}
/*!
* \brief fetch a tensor in given shape
* if size do not match the stored dimension, an error will be issued
* If size do not match the stored size, an error will be issued
* \return the tensor requested
* \param shape the shape required
* \param stream the possible stream target tensor should reside on
Expand All @@ -518,15 +518,15 @@ class TBlob {
* \tparam DType the type of elements in the tensor
*/
template<typename Device, int dim, typename DType>
inline Tensor<Device, dim, DType> get_with_shape(const TShape &shape,
inline Tensor<Device, dim, DType> get_with_shape(const Shape<dim> &shape,
Stream<Device> *stream = NULL) const {
CHECK(Device::kDevMask == dev_mask_ && DataType<DType>::kFlag == type_flag_)
<< "TBlob.get_with_shape: device type do not match specified type";
CHECK_EQ(this->CheckContiguous(), true) << "TBlob.get_reshape: must be contiguous";
CHECK_EQ(this->shape_.Size(), shape.Size())
<< "TBlob.get_with_shape: new and old shape do not match total elements";
return Tensor<Device, dim, DType>(static_cast<DType*>(dptr_),
shape.get<dim>(),
shape,
shape[dim - 1],
stream);
}
Expand Down

0 comments on commit 5ec7cc4

Please sign in to comment.