I think you want the sparse_coo_tensor 35 function. In C++:
Tensor sparse_coo_tensor(const Tensor & indices, const Tensor & values, IntArrayRef size, const TensorOptions & options={});

Best regards
Thomas