Spec-Zone.ru › PyTorch 2

torch.positive

torch.positive(input) → Tensor

Возвращает input. Вызывает ошибку выполнения, если input — тензор bool.

Параметры

input (Tensor) – входной тензор.

Пример:

>>> 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])

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.positive.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API