Skip to content

Commit

Permalink
Fix the return type of sparse.clip operator (apache#14856)
Browse files Browse the repository at this point in the history
* stype fix

* ut

* retrigger ci

* Retrigger ci
  • Loading branch information
anirudhacharya authored and Rohit Kumar Srivastava committed May 14, 2019
1 parent a5f9312 commit 5365eb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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

0 comments on commit 5365eb8

Please sign in to comment.