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

PyTorch torch.true_divide function

PyTorch torch.true_divide function


PyTorch torch reference manual PyTorch torch reference manual

torch.true_divide is a function in PyTorch used to perform element-wise true division (floating-point division).

Function definition

torch.true_divide(input, other, out=None)


Usage examples

Example

import

torch

Element-wise true division

x

=

torch.

tensor

(

[

5.0

,

6.0

,

7.0

]

)

y

=

torch.

tensor

(

[

2.0

,

2.0

,

2.0

]

)

result

=

torch.

true_divide

(

x

,

y

)

print

(

result

)


PyTorch torch reference manual PyTorch torch reference manual