code: def _instancenorm_constraints(pattern):
      rank, axes, negative_axes = _rank_and_axes(pattern)
  
      passed = True
      passed = passed and rank == 4
      passed = passed and _check_axes_and_var_shape(
          negative_axes, pattern.gamma_var.shape
      )
      passed = passed and _check_axes_and_var_shape(
          negative_axes, pattern.beta_var.shape
      )
  
      requires_rank4_transpose = False
      if negative_axes == [-3, -2]:
          requires_rank4_transpose = True
      pattern.add_attribute(
          "requires_rank4_transpose", requires_rank4_transpose
      )
      pattern.add_attribute("is_instancenorm", True)
      return passed
  
file_path: coremltools/coremltools/converters/mil/experimental/passes/generic_layernorm_instancenorm_pattern_fusion.py
imports: import os
  import numpy
  from coremltools.converters.mil import Builder
  from coremltools.converters.mil.experimental.passes.generic_pass_infrastructure import register_generic_pass
  from coremltools.converters.mil.mil import get_new_symbol
label_desc: Use image node_id 10 for calling a global function with example usage: _instancenorm_constraints(pattern) and returns: passed