Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.float_power function

PyTorch torch.float_power function

PyTorch torch.float_power function


PyTorch torch reference manual PyTorch torch reference manual

torch.float_power A function in PyTorch for element-wise floating-point power operations.

Function definition

torch.float_power(input, exponent, *, out=None)


Usage examples

Example

import

torch

Floating-point power operation example

x

=

torch.

tensor

(

[

2.0

,

3.0

,

4.0

]

)

y

=

torch.

tensor

(

[

2.0

,

2.0

,

2.0

]

)

result

=

torch.

float_power

(

x

,

y

)

print

(

result

)

 

tensor([4., 9., 16.])


PyTorch torch reference manual PyTorch torch reference manual