code: def __init__(self, block):
      self.block = block
  
      # for each var in the block, this dictionary stores the hypothetical value that is assigned to it during
      # graph traversal
      self.var_to_hypothetical_value = (
          {}
      )  # type : var : HypotheticalValue or LazyTransposeHypotheticalValue
      # start out by filling this dictionary with all the inputs of the block
      for _, input_var in block.inputs.items():
          self.var_to_hypothetical_value[input_var] = HypotheticalValue(
              input_var
          )
  
      # Dictionaries below are used to store transpose cancellation/fusion information.
      # These are filled during the traversal of the graph,
      # after which they are used by the `_apply_transform` method
  
      # transpose op to the list of transpose ops that are its compliments and can be cancelled away with it
      self.transpose_op_to_cancel_ops = defaultdict(
          lambda: []
      )  # type : op : List[op]
  
      # transpose op to the list of ops before which it has to materialize, i.e. the root transpose op
      #  can be moved downstream in the graph, as far as these materialize ops
      self.transpose_op_to_materialize_ops = defaultdict(
          lambda: []
      )  # type : op : List[Tuple(op, Var)]
  
      # list of the ops that need to be updated (either their axis parameter or one of their constant inputs)
      # if the transpose op is fused away or moved downstream in the graph
      self.transpose_op_to_axis_update_ops = defaultdict(
          lambda: []
      )  # type : op : List[op]
  
      # for book keeping
      self.ops_updated = set()
      self.materialized_ops_handled = set()
      self.transpose_ops_removed = set()
  
      # save the output sinks' information
      self.old_output_vars = []
      self.output_sink_ops = []
  
      # We modify the graph temporarily for outputs
      self._add_output_sinks()
  
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 1 to create a new TransposeOptimization object from inherited base classes: object with example: obj = TransposeOptimization(block)