haojin2 commented on a change in pull request #17283: [NumPy]Set numpy default 
dtype
URL: https://github.com/apache/incubator-mxnet/pull/17283#discussion_r405998145
 
 

 ##########
 File path: python/mxnet/ndarray/numpy/_op.py
 ##########
 @@ -600,9 +613,13 @@ def identity(n, dtype=None, ctx=None):
     if n < 0:
         raise ValueError("Input 'n' cannot be negative")
     if ctx is None:
-        ctx = current_context()
-    dtype = _np.float32 if dtype is None else dtype
-    return _npi.identity(shape=(n, n), ctx=ctx, dtype=dtype)
+        ctx = str(current_context())
+    else:
+        ctx = str(ctx)
 
 Review comment:
   is `str` required here?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to