Rate this Page
โ˜… โ˜… โ˜… โ˜… โ˜…

torch.positive#

torch.positive(input) โ†’ Tensor#

Returns input. Throws a runtime error if input is a bool tensor.

Parameters

input (Tensor) โ€“ the input tensor.

Example:

>>> t = torch.randn(5)
>>> t
tensor([ 0.0090, -0.2262, -0.0682, -0.2866,  0.3940])
>>> torch.positive(t)
tensor([ 0.0090, -0.2262, -0.0682, -0.2866,  0.3940])