Hi, All,
I would like to convert the following from pytorch to libtorch. The pytorch code is
acc = torch.mean((output_label.max(1)[1] == y).float())
I convert it as:
float acc = torch::mean((output_label.max(1)[1] == y));
The building error is:
error: no match for ‘operator[]’ (operand types are ‘std::tuple<at::Tensor, at::Tensor>’ and ‘int’)
Any suggestions to correct it please ?
Much appreciated