Dear fellow members,
I have accidentally discovered that some numpy operations, e.g., exp and argmax, work normally on PyTorch tensor.
For example:
>>> a = torch.randn((3,3))
>>> a
tensor([[ 1.1106, 1.3285, -1.7963],
[ 0.1306, 0.1929, -0.6298],
[-0.2770, 0.4762, -0.9054]])
>>> np.exp(a)
tensor([[ 3.0361, 3.7752, 0.1659],
[ 1.1395, 1.2127, 0.5327],
[ 0.7581, 1.6100, 0.4044]])
>>> np.argmax(a, axis=1)
tensor([ 1, 1, 1])
>>> np.argmax(a, axis=0)
tensor([ 0, 0, 1])
Of course they cannot be used to track their computational graph, but Is it expected behavior that I did not know?
Thanks!