PyTorch torch.multiply Function
PyTorch torch Reference Manual
torch.multiplyis a function in PyTorch for element-wise multiplication, withtorch.multhe same functionality.
Function Definition
torch.multiply(input, other, out=None)
Usage Example
Example
import torch
# Element-wise multiplication
x = torch.tensor([1.0, 2.0, 3.0])
y = torch.tensor([4.0, 5.0, 6.0])
result = torch.multiply(x, y)
print(result)
# Element-wise multiplication
x = torch.tensor([1.0, 2.0, 3.0])
y = torch.tensor([4.0, 5.0, 6.0])
result = torch.multiply(x, y)
print(result)
Other Extensions