-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
A remark to one of the most basic tensor operations:
If you want to compute the difference between two tensors inplace and you list the tensor members everything looks fine since there are add(), mul(), div() (all offering an optional inplace-semantic) and a method called sub() .. unfortunately sub() stands for extracting sub-tensors and not for computing the difference. The only method I found for computing the difference inplace seems to be [res] torch.add([res,] tensor1, value, tensor2) when used with -1 as factor.
Have I missed something?
Could this be added to the math documentation?
Are there any speed penalties for the -1 multiplication?
Have you considered adding a dedicated subtraction function, e.g. called subt() or subtract()?
Metadata
Metadata
Assignees
Labels
No labels