code: def instancenorm_4_constraints(pattern):
      epsilon_var = _get_var(pattern.add_epsilon, pattern.sub_variance)
      gamma_var = _get_var(pattern.mul_gamma, pattern.rsqrt)
      beta_var = pattern.sub_beta.x
  
      passed = True
      passed = passed and _check_reduce_op(
          pattern.main_reduce, mode="reduce_sum"
      )
      passed = passed and pattern.mul_mean.y.shape == ()
      passed = passed and _check_reduce_op(pattern.sum1, "reduce_sum")
      passed = passed and pattern.mul_mean1.y.shape == ()
      passed = (
          passed
          and pattern.sub_variance.y == pattern.mul_square.outputs[0]
      )
      passed = passed and pattern.sub_beta.y == pattern.mul2.outputs[0]
  
      passed = passed and _general_constraints(
          pattern, epsilon_var, gamma_var, beta_var
      )
      passed = passed and _instancenorm_constraints(pattern)
  
      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 6 for calling a global function with example usage: instancenorm_4_constraints(pattern) and returns: passed