Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix the return type of sparse.clip operator #14856

Merged
merged 4 commits into from
May 7, 2019
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
2 changes: 1 addition & 1 deletion src/operator/tensor/matrix_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ parameter values:
if (!dispatched && param.a_min <= 0.0 && param.a_max >= 0.0) {
const int this_stype = (*in_attrs)[0];
if (this_stype != kUndefinedStorage) {
dispatched = storage_type_assign(&(*out_attrs)[0], kRowSparseStorage,
dispatched = storage_type_assign(&(*out_attrs)[0], mxnet::NDArrayStorageType(this_stype),
dispatch_mode, DispatchMode::kFComputeEx);
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/python/unittest/test_sparse_ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ def check_fluent_regular(stype, func, kwargs, shape=(5, 17), equal_nan=False):

check_fluent_regular('csr', 'slice', {'begin': (2, 5), 'end': (4, 7)}, shape=(5, 17))
check_fluent_regular('row_sparse', 'clip', {'a_min': -0.25, 'a_max': 0.75})
check_fluent_regular('csr', 'clip', {'a_min': -0.25, 'a_max': 0.75})

for func in ['sum', 'mean', 'norm']:
check_fluent_regular('csr', func, {'axis': 0})
Expand Down