szha commented on issue #18563:
URL:
https://github.com/apache/incubator-mxnet/issues/18563#issuecomment-670986951
This happens for the np operators too.
```
In [6]: from mxnet import autograd
In [7]: mx.npx.set_np()
...: x1 = np.ones((4, 3))
...: x2 = np.random.uniform(size=(4, 3))
...: x1.attach_grad()
...: x2.attach_grad()
...: with autograd.record():
...: y1 = np.max(x1, axis=0)
...: y2 = np.max(x2, axis=0)
...: y1.backward()
...: y2.backward()
...: print(x1.grad)
...: print(x2.grad)
[[1. 1. 1.]
[1. 1. 1.]
[1. 1. 1.]
[1. 1. 1.]]
[[0. 0. 1.]
[0. 1. 0.]
[0. 0. 0.]
[1. 0. 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:
[email protected]