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 2020/08/17 22:25:37 UTC
[GitHub] [incubator-mxnet] Zha0q1 opened a new issue #18952: Numpy copysign backward error
Zha0q1 opened a new issue #18952:
URL: https://github.com/apache/incubator-mxnet/issues/18952
```
======================================== FAILURES ================================[44/1372]
______________________________________ test_copysign ______________________________________
@use_np
def test_copysign():
A = np.ones((INT_OVERFLOW, 2))
A.attach_grad()
with mx.autograd.record():
> B = np.copysign(A, -1)
tests/nightly/test_np_large_array.py:430:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python/mxnet/util.py:647: in _wrap_np_binary_func
return func(x1, x2, out=out)
python/mxnet/numpy/multiarray.py:7826: in copysign
return _mx_nd_np.copysign(x1, x2, out=out)
python/mxnet/util.py:647: in _wrap_np_binary_func
return func(x1, x2, out=out)
python/mxnet/ndarray/numpy/_op.py:5789: in copysign
return _api_internal.copysign(x1, x2, out)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <mxnet._ffi.function.Function object at 0x7fa1e86acdc0>
args = (array([[1., 1.],
[1., 1.],
[1., 1.],
...,
[1., 1.],
[1., 1.],
[1., 1.]]), -1, None)
temp_args = []
values = <mxnet._ffi._ctypes.function.MXNetValue_Array_3 object at 0x7fa19ae0ddd0>
tcodes = <mxnet._ffi._ctypes.function.c_int_Array_3 object at 0x7fa19ae0def0>
def __call__(self, *args):
"""Call the function with positional arguments
args : list
The positional arguments to the function call.
"""
temp_args = []
values, tcodes, num_args = _make_mxnet_args(args, temp_args)
ret_val = MXNetValue()
ret_tcode = ctypes.c_int()
if _LIB.MXNetFuncCall(
self.handle, values, tcodes, ctypes.c_int(num_args),
ctypes.byref(ret_val), ctypes.byref(ret_tcode)) != 0:
> raise get_last_ffi_error()
E mxnet.base.MXNetError: Traceback (most recent call last):
E File "../src/c_api/../operator/custom/../operator_common.h", line 375
E MXNetError: Check failed: pNode->num_inputs() == pNode->inputs.size() (1 vs. 2)
: Number of inputs to operator _backward_npi_copysign_scalar (1) does not match the actual
number of inputs provided to operator node_0_backward (2).
python/mxnet/_ffi/_ctypes/function.py:115: MXNetError
```
I got this error when trying to run:
```
def test_copysign():
A = np.ones((INT_OVERFLOW, 2))
A.attach_grad()
with mx.autograd.record():
B = np.copysign(A, -1)
print(B)
assert B.shape == (INT_OVERFLOW, 2)
B.backward()
assert A.grad.shape == (INT_OVERFLOW, 2)
```
However, this was able to run with no problem:
```
@use_np
def test_copysign():
A = np.ones((INT_OVERFLOW, 2))
#A.attach_grad()
#with mx.autograd.record():
B = np.copysign(A, -1)
print(B)
assert B.shape == (INT_OVERFLOW, 2)
#B.backward()
#assert A.grad.shape == (INT_OVERFLOW, 2)
```
Am I doing this wrong?
----------------------------------------------------------------
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
[GitHub] [incubator-mxnet] Zha0q1 closed issue #18952: Numpy copysign backward error
Posted by GitBox <gi...@apache.org>.
Zha0q1 closed issue #18952:
URL: https://github.com/apache/incubator-mxnet/issues/18952
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org