Chen0729
(Steven)
1
Hi, All
In pytorch it is
Prob_label = torch.gather(output_label, 1, y.unsqueeze(1))
In libtorch, I write it as
torch::Tensor prob_label = torch::Tensor::gather(output_label, 1, y.unsqueeze(1),false);
it gives the error on “torch:Tenosr::gather” as call to non-static member function without an object argument.
Any comment is appreciated.
Thanks.
Chen0729
(Steven)
2
if I use torch::gather(…) it says no matching function for torch::gather.
Thanks
1 Like
Chen0729
(Steven)
3
torch::Tensor prob_label = torch::gather(torch::Tensor output_label, 1, y.unsqueeze(1));
I changed to the above, it says "expected ( for function-style cast or type construction.