Open
Description
maths.md states:
"The Torch package adopts the same concept, so that calling a function directly on the Tensor itself using an object-oriented syntax is equivalent to passing the Tensor as the optional resulting Tensor. The following two calls are equivalent.
torch.log(x, x)
x:log()
"
However, this doesn't always seem to be the case. For example, if we call
x:cat(y), x.reshape(2,3), x:t()
then x does NOT change after the call. In particular, I can't see why x:add(y) changes x, while x:cat(y) doesn't.
So is there any rule on when a tensor will be changed by calling on itself in OO syntax? Thanks.
Metadata
Metadata
Assignees
Labels
No labels