You could convert a csr format matrix to coo, and then process that a little before sending it into the sparse tensor constructor. I believe scipy’s coo format looks similar to pytorch’s sparse tensors.
@jbarrow@richard I’m attempting to solve the same problem, but I’m getting a little lost after converting to COO format. I’m not sure which attributes of the new matrix to pass to the sparse tensor constructor.