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

[MXNET-473] Fix for dist_sync_kvstore and test_operator.test_op_roi_align #11058

Merged
merged 2 commits into from
May 25, 2018
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/elemwise_binary_op-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ void ElemwiseBinaryOp::DnsRspDnsOp(mshadow::Stream<xpu> *s,
TBlob rsp_data = rsp.data();
TBlob rsp_indices = rsp.aux_data(rowsparse::kIdx);

MSHADOW_SGL_DBL_TYPE_SWITCH(rsp_data.type_flag_, DType, {
MSHADOW_TYPE_SWITCH(rsp_data.type_flag_, DType, {
MSHADOW_IDX_TYPE_SWITCH(rsp_indices.type_flag_, IType, {
MXNET_ASSIGN_REQ_SWITCH(req, Req, {
if (reverse && std::is_same<OP, mshadow_op::minus>::value) {
Expand Down
4 changes: 2 additions & 2 deletions tests/python/unittest/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6019,7 +6019,7 @@ def test_context_num_gpus():
if str(e).find("CUDA") == -1:
raise e


@with_seed()
def test_op_roi_align():
# Adapted from /~https://github.com/wkcn/MobulaOP/blob/master/tests/test_roi_align_op.py
Expand Down Expand Up @@ -6146,7 +6146,7 @@ def test_roi_align_value():
real_output, [dx, drois] = roialign_forward_backward(data.asnumpy(), rois.asnumpy(), pooled_size, spatial_scale, sampling_ratio, dy.asnumpy())
assert np.allclose(output.asnumpy(), real_output)
# It seems that the precision between Cfloat and Pyfloat is different.
assert np.allclose(data.grad.asnumpy(), dx, atol = 1e-6), np.abs(data.grad.asnumpy() - dx).max()
assert np.allclose(data.grad.asnumpy(), dx, atol = 1e-5), np.abs(data.grad.asnumpy() - dx).max()
assert np.allclose(rois.grad.asnumpy(), drois)

# modified from test_roipooling()
Expand Down