Skip to content

Add Tensor.to_sparse() API for sparse COO tensor conversion#1525

Open
alinpahontu2912 wants to merge 1 commit intodotnet:mainfrom
alinpahontu2912:add-to-sparse-api
Open

Add Tensor.to_sparse() API for sparse COO tensor conversion#1525
alinpahontu2912 wants to merge 1 commit intodotnet:mainfrom
alinpahontu2912:add-to-sparse-api

Conversation

@alinpahontu2912
Copy link
Member

Add to_sparse() and to_sparse(int sparse_dim) methods to convert dense tensors to sparse COO format. This enables GCN and GAT graph neural network examples that require sparse matrix operations.

Changes across all 4 binding layers:

  • THSTensor.h: declarations
  • THSTensor.cpp: implementations
  • LibTorchSharp.THSTensor.cs: P/Invoke
  • Tensor.cs: managed C# methods

Add to_sparse() and to_sparse(int sparse_dim) methods to convert dense
tensors to sparse COO format. This enables GCN and GAT graph neural
network examples that require sparse matrix operations.

Changes across all 4 binding layers:
- THSTensor.h: declarations
- THSTensor.cpp: implementations
- LibTorchSharp.THSTensor.cs: P/Invoke
- Tensor.cs: managed C# methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant