Skip to content

Commit

Permalink
address matthew's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewZhaoLuo committed Apr 30, 2021
1 parent 634253a commit 6e470d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions tests/python/contrib/test_arm_compute_lib/test_pooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@

def _calculate_output_shape(shape, sizes, padding, strides, dilation):
"""Calculate pooling output shape."""
output_height = (
(shape[1] - (sizes[0] - 1) * dilation[0] - 1 + padding[0] + padding[2]) / strides[0]
) + 1
output_width = (
(shape[2] - (sizes[1] - 1) * dilation[1] - 1 + padding[1] + padding[3]) / strides[1]
) + 1
height_receptive_field = (sizes[0] - 1) * dilation[0] + 1
width_receptive_field = (sizes[1] - 1) * dilation[1] + 1
output_height = ((shape[1] - height_receptive_field + padding[0] + padding[2]) / strides[0]) + 1
output_width = ((shape[2] - width_receptive_field + padding[1] + padding[3]) / strides[1]) + 1
return 1, int(output_height), int(output_width), shape[3]


Expand Down
4 changes: 2 additions & 2 deletions tests/python/relay/test_op_level5.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,10 +671,10 @@ def verify_roi_align(
print("test on", target)
intrp1 = relay.create_executor("graph", device=dev, target=target)
op_res1 = intrp1.evaluate(func)(np_data, np_rois)
tvm.testing.assert_allclose(op_res1.asnumpy(), ref_res, rtol=2e-4)
tvm.testing.assert_allclose(op_res1.asnumpy(), ref_res, rtol=1e-4)
intrp2 = relay.create_executor("debug", device=dev, target=target)
op_res2 = intrp2.evaluate(func)(np_data, np_rois)
tvm.testing.assert_allclose(op_res2.asnumpy(), ref_res, rtol=2e-4)
tvm.testing.assert_allclose(op_res2.asnumpy(), ref_res, rtol=1e-4)

def verify_roi_align_nchw(
data_shape, rois_shape, pooled_size, spatial_scale, sample_ratio, mode
Expand Down

0 comments on commit 6e470d2

Please sign in to comment.