Thank you for replying. But the sparse tensor is in COO format which means I need to know coordinates and values to create one. But the situation here is that I want to get B from A directly. Is there a way for doing this?