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.