Hi,
There are multiple overloads of max: https://pytorch.org/cppdocs/api/function_namespaceat_1ac66d13a86d2ee2c974cd7d22de2ec409.html?highlight=max 69
In particular you want the one where you can specify the dim.
Note also that [0] won’t work with the tuple<> output and you will need to use std::get<0>(the_tuple) IIRC.