Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to fix windows build error, and fix lint #34

Merged
merged 1 commit into from
May 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/mxnet/ndarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class NDArray {
NDArray(const NDArrayStorageType storage_type, const TShape &shape, Context ctx,
bool delay_alloc = true, int dtype = mshadow::default_type_flag,
std::vector<int> aux_types = {}, std::vector<TShape> aux_shapes = {},
TShape storage_shape = TShape({0}))
TShape storage_shape = TShape(mshadow::Shape1(0)))
: shape_(shape), offset_(0), dtype_(dtype), entry_({nullptr, 0, 0}) {
// Assign default aux types if not given
if (aux_types.size() == 0) {
Expand All @@ -134,10 +134,10 @@ class NDArray {
// unknown shapes are intialized as {0} such that Size() would return 0
if (aux_shapes.size() == 0) {
if (storage_type == kRowSparseStorage) {
aux_shapes = {TShape({0})};
aux_shapes = {TShape(mshadow::Shape1(0))};
} else if (storage_type == kCSRStorage) {
// aux shapes for indptr and indices
aux_shapes = {TShape({0}), TShape({0})};
aux_shapes = {TShape(mshadow::Shape1(0)), TShape(mshadow::Shape1(0))};
} else {
LOG(FATAL) << "Unknown storage type" << storage_type;
}
Expand Down
2 changes: 1 addition & 1 deletion src/operator/tensor/elemwise_unary_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void CastStorageDnsRspImpl(mshadow::Stream<xpu> *s, const TBlob& dns, NDArray* r
if (row_idx[i] < static_cast<RType>(num_rows)) ++nnr;
}
if (0 == nnr) {
rsp->SetAuxShape(rowsparse::kIdx, TShape({0}));
rsp->SetAuxShape(rowsparse::kIdx, TShape(mshadow::Shape1(0)));
return; // zero matrix
}
rsp->CheckAndAllocData(mshadow::Shape2(nnr, num_cols));
Expand Down
3 changes: 2 additions & 1 deletion src/operator/tensor/indexing_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ void SparseEmbeddingOpBackwardDnsDnsRsp(const nnvm::NodeAttrs& attrs,
size_t width = output.shape()[1];
size_t segment_len = (num_rows + num_threads - 1) / num_threads;
// fill indices with invalid row ids
Kernel<mxnet_op::fill, xpu>::Launch(s, num_rows, output_idx.dptr_, static_cast<IType>(num_rows));
Kernel<mxnet_op::fill, xpu>::Launch(s, num_rows, output_idx.dptr_,
static_cast<IType>(num_rows));
// fill zeros if needed
if (req_type == kWriteTo) {
Kernel<mxnet_op::set_zero, xpu>::Launch(s, output_val.shape_.Size(), output_val.dptr_);
Expand Down
2 changes: 1 addition & 1 deletion src/operator/tensor/init_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void FillZerosRspImpl(mshadow::Stream<xpu> *s, NDArray *dst) {
// reset the shapes if it's not zeros
auto storage_shape = dst->storage_shape();
storage_shape[0] = 0;
dst->SetAuxShape(rowsparse::kIdx, TShape({0}));
dst->SetAuxShape(rowsparse::kIdx, TShape(mshadow::Shape1(0)));
dst->SetStorageShape(storage_shape);
}

Expand Down