dotnet / TorchSharp

A .NET library that provides access to the library that powers PyTorch.
MIT License
1.36k stars 177 forks source link

Binding: THNN APIs #25

Closed migueldeicaza closed 5 years ago

migueldeicaza commented 5 years ago
migueldeicaza commented 5 years ago

Does not look like this is a public API

interesaaat commented 5 years ago

@migueldeicaza I think we need these APIs to implement NN operators. How did you find that they are not public? Does this mean that we cannot access these APIs at all or that they are reachable through some other API?

migueldeicaza commented 5 years ago

Could not find the header files for these, just found the symbols. But if we find them, let us reopen

migueldeicaza commented 5 years ago

Ok found it - https://github.com/torch/nn/tree/master/lib/THNN

migueldeicaza commented 5 years ago

Researching how to bind this, challenges with THNNState

migueldeicaza commented 5 years ago

I am doing these ones.

migueldeicaza commented 5 years ago

Update from the discussion on gitter:

I wrote a tool to do the THNN binding
Now, the issue is, it feels like these operations belong on the Float/Double tensors
So good news - I have all the bits ready
Bad news - I think I need to play a little with the Lua/Python API to get a better sense of how this was intended to be used
Just does not feel right, but design wise, that is where it looks they belong
migueldeicaza commented 5 years ago

The binding is going into this pull request

https://github.com/xamarin/TorchSharp/pull/38

But it is intended to be internal, which is surfaced by individual classes later.