dotnet / TorchSharp

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

Add scalar-tensor operations using C# numeric types for scalar #94

Closed joemoorhouse closed 5 years ago

joemoorhouse commented 5 years ago

e.g. to remove need for ToScalar() in weights.Eq(1.ToScalar()).Sum(new[] { 1L }) * (-1).ToScalar() + 0.5.ToScalar();

joemoorhouse commented 5 years ago

Could add implicit conversion via public static implicit operator Scalar(double value){…} etc? Not sure if any undesirable consequences (will try it out).

joemoorhouse commented 5 years ago

Seems to work https://github.com/joemoorhouse/TorchSharp Adding some more operators < <= etc; but just to check, is there any automatic code generation endeavor going on in parallel?

interesaaat commented 5 years ago

This is great! No, we are not working on the code generation issue for the moment. (hopefully we will soon)

interesaaat commented 5 years ago

@joemoorhouse any chance we can get a PR soon-ish. I think we fixed the build issues and we want to push the 0.2 release.

joemoorhouse commented 5 years ago

Yes, will do

On Tue, 16 Jul 2019, 17:35 Matteo Interlandi, notifications@github.com wrote:

@joemoorhouse https://github.com/joemoorhouse any chance we can get a PR soon-ish. I think we fixed the build issues and we want to push the 0.2 release.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xamarin/TorchSharp/issues/94?email_source=notifications&email_token=ABG5YQBZLXQW7SIPLGX65VLP7X2E5A5CNFSM4H3ZA3FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2BNWSI#issuecomment-511892297, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG5YQCGGOZIG6QYNGVPEN3P7X2E5ANCNFSM4H3ZA3FA .