GeorgeS2019
GeorgeS2019
I am getting `netstandard.cs` as output which makes no sense to me
@toolgood Could you consider writing [tests ](https://github.com/uxmal/pytocs/tree/master/src/Pytocs.Tests)for your contributions?
The generated PyToCs py.cs is `public static class` NOT `public class` The [TorchCs parser](https://github.com/toolgood/pytocs/blob/3e914fba181adf3f8c22eec5dff040aa2f6af889/src/Extensions/TorchCs/TorchUtil.cs#L620) to extract class names will fail ```cs private static void getClassName(string text, HashSet classNames) { const...
```cs //// Forward pass: compute predicted y //original pytorch: var y_pred = a + b * x + c * x * *2 + d * x * *3 //Converted...
The PyTorch Source used ```python import torch import math dtype = torch.float device = torch.device("cpu") # device = torch.device("cuda:0") # Uncomment this to run on GPU # Create random input...
```cs // pytorch: a = torch.randn((), device=device, dtype=dtype) //PyToCs: a = torch.randn(ValueTuple.Create(""), device: device, dtype: dtype); //Works in TorchSharp a = torch.randn(new long[]{ }, device: device, dtype: dtype); ```
```cs //# Compute and print loss //PyTorch: loss = (y_pred - y).pow(2).sum().item() //PyToCs: loss = (y_pred - y).pow(2).sum().item() //Work in TorchSharp var loss = (y_pred - y).pow(2).sum().item(); ```
Math.Pow(x,2) ===> x,pow(2) WHEN x is a tensor.
`torch.randn(ValueTuple.Create("") `=> `torch.randn(new long[]{}` ```cs // PyTorch is torch.randn(new() ``` @uxmal John, could you see, how similar TorchSharp is to PyTorch
@toolgood Jupyter Notebook parser. Would you be interested to turn your Console program into one that generate Jupyter Notebook with PyTorch and TorchSharp codes Side by Side ? e.g. cell...