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

PyTorch torch.positive function

PyTorch torch.positive function


PyTorch torch reference manual 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

)

print

(

result

)


PyTorch torch reference manual PyTorch torch reference manual