Sparse Tensor Creation in the C++ API

Hi,

is there a way of creating a sparse tensor using the C++ API? I looked into the documentation but was unable to find anything.

In particular, what would be the equivalent (if there is one) of

torch.sparse.FloatTensor(indices, values, size)

?

Cheers,
Friedrich

I think this is the function you are looking for: https://pytorch.org/cppdocs/api/function_namespacetorch_1afa32eb8069eda5ae03b45ee9f26de3c3.html?highlight=sparse#_CPPv4N5torch17sparse_coo_tensorERKN2at6TensorERKN2at6TensorERKN2at13TensorOptionsE

Thank you very much, I missed that one!