dotnet / TorchSharp

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

Review of the C# API #95

Closed interesaaat closed 3 years ago

interesaaat commented 5 years ago

The C# API now mostly follow libTorch design. I think we need to check if this match C# users expectations.

joemoorhouse commented 5 years ago

Seems like a good move to me to follow libTorch design. I find the C++ API nice and intuitive if converting from Python. Personally I think works well in C# (single TorchTensor <=> at::Tensor as opposed to typed varieties). The '_' for 'in place' in Python/libTorch is even growing on me - or is that a bit too un-C#? :)

interesaaat commented 5 years ago

Yea I think we need to discuss on this. I don't think we want to make the C# api snake case, unless we want an API more close to Python (#76 )

joemoorhouse commented 5 years ago

Would agree with no snake case. I suppose the trailing underscore instead of 'InPlace' is rather snake-casey!

Oceania2018 commented 4 years ago

Personally, I hope that the naming rules remain the same as PyTorch, reducing the memory burden of developers switching.

dsyme commented 3 years ago

Covered by https://github.com/xamarin/TorchSharp/pull/205