pytorch / 2 / generated / torch.tensor.where.html

torch.Tensor.where

Tensor.where(condition, y) → Tensor

self.where(condition, y) is equivalent to torch.where(condition, self, y). See torch.where()

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