Closed gbaydin closed 3 years ago
Hi, I've been trying to locate the libtorch tensor indexing/slicing API in TorchSharp: https://pytorch.org/cppdocs/notes/tensor_indexing.html
If I haven't missed it, I think it needs to be added to libtorchsharp native code and to the C# part. This issue is to keep track of this.
The closest available method TorchSharp has is index_select here https://github.com/xamarin/TorchSharp/blob/f456b0d1c162b6b7b4e7947df61fff3fea984d7d/src/Native/LibTorchSharp/THSTensor.cpp#L526 It's possible to use this in combination with other methods to achive various slicings, but it's not ideal due to the number of operations needed to achieve slicing ops that can be done in a single call.
index_select
More information about a use case where this is needed is here: https://github.com/DiffSharp/DiffSharp/issues/277
Yes this needs to be added, thanks!
This is added, there is now Index and IndexPut
Hi, I've been trying to locate the libtorch tensor indexing/slicing API in TorchSharp: https://pytorch.org/cppdocs/notes/tensor_indexing.html
If I haven't missed it, I think it needs to be added to libtorchsharp native code and to the C# part. This issue is to keep track of this.
The closest available method TorchSharp has is
index_select
here https://github.com/xamarin/TorchSharp/blob/f456b0d1c162b6b7b4e7947df61fff3fea984d7d/src/Native/LibTorchSharp/THSTensor.cpp#L526 It's possible to use this in combination with other methods to achive various slicings, but it's not ideal due to the number of operations needed to achieve slicing ops that can be done in a single call.More information about a use case where this is needed is here: https://github.com/DiffSharp/DiffSharp/issues/277