pow¶
dragon.vm.torch.
pow
(
input,
exponent,
out=None
)[source]¶Compute the power of input.
\[\text{out} = \text{input}^{\text{exponent}} \]The two inputs should be broadcast to each other:
x = torch.tensor([[2, 2]]) print(torch.pow(x, x)) # [[4, 4]] print(torch.pow(x, 3)) # [[8, 8]] print(torch.pow(3, x)) # [[9, 9]]
- Parameters:
- input (Union[dragon.vm.torch.Tensor, number]) – The input tensor.
- exponent (Union[dragon.vm.torch.Tensor, number]) – The exponent tensor.
- out (dragon.vm.torch.Tensor, optional) – The output tensor.
- Returns:
dragon.vm.torch.Tensor – The output tensor.