code: def local_max_and_argmax(node):
      """
      If we don't use the argmax, change it to a max only.
      """
      if isinstance(node.op, T.MaxAndArgmax):
          axis = node.op.get_params(node)
          if len(node.outputs[1].clients) == 0:
              new = CAReduce(scal.maximum, axis)(node.inputs[0])
              copy_stack_trace(node.outputs[0], new)
              return [new, None]
  
          if len(node.outputs[0].clients) == 0:
              new = T.Argmax(axis)(node.inputs[0])
              copy_stack_trace(node.outputs[0], new)
              return [None, new]
  
file_path: Theano/theano/tensor/opt_uncanonicalize.py
imports: from __future__ import absolute_import, print_function, division
  import logging
  from theano import gof
  from theano.tensor.elemwise import CAReduce
  from theano.tensor import basic
  from theano.tensor import DimShuffle, Subtensor
  from theano.tensor.opt import register_uncanonicalize
  from theano import scalar
  from theano.gof.opt import copy_stack_trace
label_desc: Use image node_id 1 for calling a global function with example usage: local_max_and_argmax(node) and returns: list, list