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

torch.Tensor.values

Tensor.values() → Tensor

Return the values tensor of a sparse COO tensor.

Warning

Throws an error if self is not a sparse COO tensor.

See also Tensor.indices().

Note

This method can only be called on a coalesced sparse tensor. See Tensor.coalesce() for details.

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