PyTorch .NET Interop
I'm experimenting with integrating PyTorch models directly into a .NET Core application. I found TorchSharp
but I'm curious about other ways to achieve efficient interop, especially for GPU tensors. Any suggestions or best practices?
Sample Code
using TorchSharp;
using static TorchSharp.torch;
var model = torch.jit.load("model.pt");
var input = torch.randn(new long[] { 1, 3, 224, 224 }, device: device);
var output = model.forward(input);
Console.WriteLine(output.shape);