PyTorch torch.positive function
PyTorch torch reference manual
torch.positive is a function in PyTorch that applies the unary plus operation element-wise. It returns the input tensor itself.
Function definition
torch.positive(input)
Usage examples
Example
import
torch
Element-wise unary plus
x
=
torch.
tensor
(
[
1.0
,
2.0
,
3.0
]
)
result
=
torch.
positive
(
x
)
(
result
)