Pytorch Torch Pow
# PyTorch torch.pow Function
* * PyTorch torch Reference Manual](#)
`torch.pow` is a function in PyTorch used to compute element-wise power operations.
### Function Definition
torch.pow(input, exponent, out)
* * *
## Usage Examples
## Example
import torch
# Calculate power operations
x = torch.tensor([2,3,4])
result = torch.pow(x,2)
print(result)
# The exponent can also be the first parameter
result2 = torch.pow(2, x)
print(result2)
* * PyTorch torch Reference Manual](#)
YouTip