PyTorch torch.true_divide function
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
)
(
result
)