Looking to use torch.pow(input, exponent)
I’m wondering what options I have when input is a scalar and exponent is a tensor…
e.g.
input = 10
exponent = torch.Tensor([5,8,4,6], requires_grad=False)
out = torch.pow(input, exponent)
Looking to use torch.pow(input, exponent)
I’m wondering what options I have when input is a scalar and exponent is a tensor…
e.g.
input = 10
exponent = torch.Tensor([5,8,4,6], requires_grad=False)
out = torch.pow(input, exponent)
Reading the doc of torch.pow
, you’ll see that if exponent
is a tensor then the output is input_i
^exponent_i
, or in your case
out = [10^5, 10^8, 10^4, 10^6]