mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] reminisce commented on a change in pull request #8246: Continued Work on Advanced Indexing
Date Tue, 20 Mar 2018 22:44:32 GMT
reminisce commented on a change in pull request #8246: Continued Work on Advanced Indexing
URL: https://github.com/apache/incubator-mxnet/pull/8246#discussion_r175946026
 
 

 ##########
 File path: python/mxnet/ndarray/ndarray.py
 ##########
 @@ -1858,10 +2174,8 @@ def full(shape, val, ctx=None, dtype=mx_real_t, out=None):
     >>> mx.nd.full((1, 2), 2.0, dtype='float16').asnumpy()
     array([[ 2.,  2.]], dtype=float16)
     """
-    if ctx is None:
-        ctx = Context.default_ctx
-    dtype = mx_real_t if dtype is None else dtype
-    out = _internal._full(shape=shape, ctx=ctx, dtype=dtype, value=val, out=out)
+    out = empty(shape, ctx, dtype) if out is None else out
 
 Review comment:
   Don't remember exactly. @piiswrong once asked me to change something back, not sure if
it's this one. But one benefit of changing it is allowing `val` to be any data types that
could be assigned to an `NDArray`. Behavior-wise, it's same as before when val is a scalar.
Any problem with this change?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Mime
View raw message