PyTorch torch.reciprocal Function
PyTorch torch Reference Manual
torch.reciprocalIs a function in PyTorch used to compute the element-wise reciprocal.
Function Definition
torch.reciprocal(input, out=None)
Usage Example
Example
import torch
# Compute element-wise reciprocal
x = torch.tensor([1.0, 2.0, 4.0])
result = torch.reciprocal(x)
print(result)
# Compute element-wise reciprocal
x = torch.tensor([1.0, 2.0, 4.0])
result = torch.reciprocal(x)
print(result)
Other Extensions