Monday, 21 October 2019

torch tensor in-place operation

tensor([[-0.0111,  1.2464,  1.5858],
        [ 0.8375, -0.4832,  0.8757],
        [ 0.4529,  1.5446,  1.0424],
        [-0.4078, -1.1831, -0.8830],
        [-0.5558, -1.2425,  0.1504]])

Note

Any operation that mutates a tensor in-place is post-fixed with an ``_``. For example: ``x.copy_(y)``, ``x.t_()``, will change ``x``.

No comments:

Post a Comment