code: def instancenorm_3_constraints(pattern):
      epsilon_var = _get_var(pattern.add_epsilon, pattern.mean1)
  
      gamma_var = mb.const(
          val=np.ones(shape=(1, pattern.root_var.shape[1], 1, 1)),
          name="gamma_var",
      )
      beta_var = mb.const(
          val=np.zeros(shape=(1, pattern.root_var.shape[1], 1, 1)),
          name="_fuse_layernorm_or_instancenorm_beta",
      )
      passed = True
      passed = passed and _check_reduce_op(pattern.main_reduce)
      passed = (
          passed
          and pattern.sub.x == pattern.root_var
          and pattern.sub.y == pattern.main_reduce.outputs[0]
      )
      passed = passed and _check_reduce_op(pattern.mean1)
      passed = (
          passed
          and pattern.mul_sub.y.val is not None
          and pattern.mul_sub.y.val == -1
      )
  
      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 5 for calling a global function with example usage: instancenorm_3_constraints(pattern) and returns: passed