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 2017/10/25 07:09:46 UTC
[GitHub] cjolivier01 commented on a change in pull request #8340: Optimizations to set_to, copy, fill ops
cjolivier01 commented on a change in pull request #8340: Optimizations to set_to, copy, fill ops
URL: https://github.com/apache/incubator-mxnet/pull/8340#discussion_r146770349
##########
File path: python/mxnet/ndarray/ndarray.py
##########
@@ -1854,8 +1854,10 @@ 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)
"""
- out = empty(shape, ctx, dtype) if out is None else out
- out[:] = val
+ 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)
Review comment:
What is setitem? Is that python code? I?m not especially familiar with the python parts.
----------------------------------------------------------------
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