From commits-return-110279-archive-asf-public=cust-asf.ponee.io@mxnet.incubator.apache.org Thu Dec 26 21:23:05 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 85EB0180636 for ; Thu, 26 Dec 2019 22:23:05 +0100 (CET) Received: (qmail 10216 invoked by uid 500); 26 Dec 2019 21:23:04 -0000 Mailing-List: contact commits-help@mxnet.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mxnet.incubator.apache.org Delivered-To: mailing list commits@mxnet.incubator.apache.org Received: (qmail 10207 invoked by uid 99); 26 Dec 2019 21:23:04 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Dec 2019 21:23:04 +0000 From: GitBox To: commits@mxnet.apache.org Subject: [GitHub] [incubator-mxnet] sxjscience opened a new issue #17179: [Numpy] where does not support python scalar as the input Message-ID: Date: Thu, 26 Dec 2019 21:23:04 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit sxjscience opened a new issue #17179: [Numpy] where does not support python scalar as the input URL: https://github.com/apache/incubator-mxnet/issues/17179 ```python import mxnet as mx mx.npx.set_np() a = mx.np.sym.var('a') a = mx.sym.var('a').as_np_ndarray() mx.sym.np.where(a, a, 0) ``` Error message: ``` --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) in ----> 1 mx.sym.np.where(a, a, 0) ~/mxnet/python/mxnet/symbol/numpy/_symbol.py in where(condition, x, y) 5501 5502 """ -> 5503 return _npi.where(condition, x, y, out=None) 5504 5505 ~/mxnet/python/mxnet/symbol/register.py in where(condition, x, y, name, attr, out, **kwargs) AssertionError: Argument y must be Symbol instances, but got 0 ``` Also, the imperative case: ```python import mxnet as mx mx.npx.set_np() mx.np.where(mx.np.ones((10, )), mx.np.ones((10, )), 0) ``` Error message: ``` AssertionError Traceback (most recent call last) in ----> 1 mx.np.where(mx.np.ones((10, )), mx.np.ones((10, )), 0) ~/mxnet/python/mxnet/numpy/multiarray.py in where(condition, x, y) 7996 [ 0., 3., -1.]]) 7997 """ -> 7998 return _mx_nd_np.where(condition, x, y) 7999 8000 ~/mxnet/python/mxnet/ndarray/numpy/_op.py in where(condition, x, y) 6035 return nonzero(condition) 6036 else: -> 6037 return _npi.where(condition, x, y, out=None) 6038 6039 ~/mxnet/python/mxnet/ndarray/register.py in where(condition, x, y, out, name, **kwargs) AssertionError: Argument y must have NDArray type, but got 0 ``` ---------------------------------------------------------------- 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