docstr: Check that all non constant inputs are of type LazyTransposeHypotheticalValue with the same perm value
  This check is common for all "axis update" ops.
docstr_tok: ["Check","that","all","non","constant","inputs","are","of","type","LazyTransposeHypotheticalValue","with","the","same","perm","value","This","check","is","common","for","all","``","axis","update","''","ops","."]
code: def _visit_axis_update_op(self, op):
      """
      Check that all non constant inputs are of type LazyTransposeHypotheticalValue with the same perm value
      This check is common for all "axis update" ops.
      """
      input_vars = _get_input_vars(op, only_nonconst_vars=True)
      perm = None
      for i, var in enumerate(input_vars):
          hypothetical_value = self.var_to_hypothetical_value[var]
          if not isinstance(
              hypothetical_value, LazyTransposeHypotheticalValue
          ):
              self._visit_materialize_op(op)
              return
          if i == 0:
              perm = hypothetical_value.perm
          elif perm != hypothetical_value.perm:
              self._visit_materialize_op(op)
              return
  
      # checks specific to the op type
      op_cls = AXIS_UPDATE_OPS.get(op.op_type, None)
      if op_cls is None:
          raise ValueError(
              "Transform class for op of type '{}' not found".format(
                  op.op_type
              )
          )
  
      if not op_cls(
          **{"op": op, "transpose_axes": perm}
      ).can_transpose_pass():
          self._visit_materialize_op(op)
          return
  
      # add this op to the dictionary "transpose_op_to_axis_update_ops"
      # and update self.var_to_hypothetical_value[op.outputs[0]]
      all_lazy_transpose_ops = set()
      for var in input_vars:
          input_hypothetical_value = self.var_to_hypothetical_value[var]
          all_lazy_transpose_ops.update(
              input_hypothetical_value.transpose_ops
          )
  
      for transpose_op in all_lazy_transpose_ops:
          self.transpose_op_to_axis_update_ops[transpose_op].append(op)
  
      self.var_to_hypothetical_value[
          op.outputs[0]
      ] = LazyTransposeHypotheticalValue(
          input_hypothetical_value.wrapped_hypothetical_value,
          all_lazy_transpose_ops,
          perm,
      )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil.var import Var
  import logging
  import numpy
  import copy
  from collections import defaultdict
label_desc: Use image node_id 5 for calling the TransposeOptimization obj's underlying member method code with example usage: obj._visit_axis_update_op(op) without return types