code: def test_instance_norm_reference_check(
      self,
      gc,
      dc,
      N,
      C,
      H,
      W,
      order,
      store_mean,
      store_inv_stdev,
      epsilon,
      seed,
      inplace,
  ):
      np.random.seed(seed)
  
      # force store_inv_stdev if store_mean to match existing forward pass
      # implementation
      store_inv_stdev |= store_mean
      if order != "NCHW":
          assume(not inplace)
  
      inputs = self._get_inputs(N, C, H, W, order)
      op = self._get_op(
          device_option=gc,
          store_mean=store_mean,
          store_inv_stdev=store_inv_stdev,
          epsilon=epsilon,
          order=order,
          inplace=inplace,
      )
  
      def ref(input_blob, scale_blob, bias_blob):
          if order == "NHWC":
              input_blob = utils.NHWC2NCHW(input_blob)
  
          mean_blob = input_blob.reshape((N, C, -1)).mean(axis=2)
          inv_stdev_blob = 1.0 / np.sqrt(
              input_blob.reshape((N, C, -1)).var(axis=2) + epsilon
          )
          # _bc indicates blobs that are reshaped for broadcast
          scale_bc = scale_blob[np.newaxis, :, np.newaxis, np.newaxis]
          mean_bc = mean_blob[:, :, np.newaxis, np.newaxis]
          inv_stdev_bc = inv_stdev_blob[:, :, np.newaxis, np.newaxis]
          bias_bc = bias_blob[np.newaxis, :, np.newaxis, np.newaxis]
          normalized_blob = (
              scale_bc * (input_blob - mean_bc) * inv_stdev_bc + bias_bc
          )
  
          if order == "NHWC":
              normalized_blob = utils.NCHW2NHWC(normalized_blob)
  
          if not store_mean and not store_inv_stdev:
              return (normalized_blob,)
          elif not store_inv_stdev:
              return normalized_blob, mean_blob
          else:
              return normalized_blob, mean_blob, inv_stdev_blob
  
      self.assertReferenceChecks(gc, op, inputs, ref)
  
file_path: pytorch/caffe2/python/operator_test/instance_norm_test.py
imports: import numpy
  from hypothesis import given, assume, settings
  import hypothesis.strategies
  from caffe2.python import core, model_helper, brew, utils
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
  import unittest
label_desc: Use image node_id 6 for calling the TestInstanceNorm obj's underlying member method code with example usage: obj.test_instance_norm_reference_check(gc, dc, N, C, H, W, order, store_mean, store_inv_stdev, epsilon, seed, inplace) and returns: normalized_blob, normalized_blob,  mean_blob, normalized_blob,  mean_blob,  inv_stdev_blob