You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/11/13 09:20:34 UTC
[GitHub] [incubator-mxnet] Alicia1529 commented on a change in pull request
#16778: custom op full_like
Alicia1529 commented on a change in pull request #16778: custom op full_like
URL: https://github.com/apache/incubator-mxnet/pull/16778#discussion_r345645106
##########
File path: tests/python/unittest/test_numpy_op.py
##########
@@ -4463,6 +4464,52 @@ def hybrid_forward(self, F, a):
assert_almost_equal(mx_out.asnumpy(), np_out, rtol=1e-3, atol=1e-5, use_broadcast=False)
+@with_seed()
+@use_np
+def test_np_full_like():
+ class TestFullLike(HybridBlock):
+ def __init__(self, fill_value, dtype):
+ super(TestFullLike, self).__init__()
+ self._fill_value = fill_value
+ self._dtype = dtype
+
+ def hybrid_forward(self, F, x, *args, **kwargs):
+ return F.np.full_like(x, self._fill_value, self._dtype)
+
+ if StrictVersion(platform.python_version()) < StrictVersion('3.0.0'):
Review comment:
thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services