reminisce commented on a change in pull request #15698: Numpy Identity operator
URL: https://github.com/apache/incubator-mxnet/pull/15698#discussion_r311281996
##########
File path: tests/python/unittest/test_numpy_ndarray.py
##########
@@ -148,6 +148,51 @@ def check_ones_array_creation(shape, dtype):
assert type(y[1]) == np.ndarray
+@with_seed()
+@use_np
+def test_identity():
+ class TestIdentity(HybridBlock):
+ def __init__(self, shape, dtype=None):
+ super(TestIdentity, self).__init__()
+ self._n = n
+ self._dtype = dtype
+
+ def hybrid_forward(self, F, x, *args, **kwargs):
+ return x * F.np.identity(n, dtype)
Review comment:
`dtype` -> `self._dtype`
`n` -> `self._n`
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services