Solved by LeviViana in post #2 
              
              
                This only works if DNN_out.argmax(1) is a tensor having just one element (i.e., if DNN_out has a shape like {1, n}): 
int action = DNN_out.argmax(1).item().toInt();