dotnet / TorchSharpExamples

Repository for TorchSharp examples and tutorials.
MIT License
129 stars 47 forks source link

Print(style) not working with the recent TorchSharp #33

Closed GeorgeS2019 closed 2 years ago

GeorgeS2019 commented 2 years ago

https://github.com/dotnet/TorchSharpExamples/blob/main/tutorials/CSharp/tutorial2.ipynb

torch.zeros(4,4).print(style);
torch.ones(4,4).print(style);
(1,24): error CS1503: Argument 2: cannot convert from 'TorchSharp.TensorStringStyle' to 'string'

(2,23): error CS1503: Argument 2: cannot convert from 'TorchSharp.TensorStringStyle' to 'string'

Error: compilation error
NiklasGustafsson commented 2 years ago

Yes, this was to undo an unintended breaking change in an earlier release. Use print(style: style), instead.

NiklasGustafsson commented 2 years ago

I'll see if I can come up with something better, like a global setting of the default formatting style.