code: def instance_norm(
      x: Union[tf.Tensor, tf.Variable],
      mean: Union[tf.Tensor, tf.Variable],
      variance: Union[tf.Tensor, tf.Variable],
      /,
      *,
      scale: Optional[Union[tf.Tensor, tf.Variable]] = None,
      offset: Optional[Union[tf.Tensor, tf.Variable]] = None,
      training: Optional[bool] = False,
      eps: Optional[float] = 1e-5,
      momentum: Optional[float] = 1e-1,
      data_format: Optional[str] = "NSC",
      out: Optional[
          Tuple[
              Union[tf.Tensor, tf.Variable],
              Union[tf.Tensor, tf.Variable],
              Union[tf.Tensor, tf.Variable],
          ]
      ] = None,
  ) -> Tuple[
      Union[tf.Tensor, tf.Variable],
      Union[tf.Tensor, tf.Variable],
      Union[tf.Tensor, tf.Variable],
  ]:
      # Instance Norm with (N,H,W,C) is the same as BatchNorm with (1, H, W, N*C)
      xdims = len(x.shape)
      if data_format == "NCS":
          x = tf.transpose(x, perm=(*range(2, xdims), 0, 1))
      elif data_format == "NSC":
          x = tf.transpose(x, perm=(*range(1, xdims - 1), 0, xdims - 1))
      else:
          raise ValueError(f"Invalid data_format: {data_format}.")
  
      N = x.shape[-2]
      C = x.shape[-1]
      S = x.shape[0:-2]
      x = tf.reshape(x, (1, *S, N * C))
      mean = tf.tile(mean, [N])
      variance = tf.tile(variance, [N])
      if scale is not None:
          scale = tf.tile(scale, [N])
      if offset is not None:
          offset = tf.tile(offset, [N])
      xnormalized, runningmean, runningvariance = batch_norm(
          x,
          mean,
          variance,
          scale=scale,
          offset=offset,
          training=training,
          eps=eps,
          momentum=momentum,
      )
      xnormalized = tf.reshape(xnormalized, (*S, N, C))
      if data_format == "NCS":
          xnormalized = tf.transpose(
              xnormalized,
              perm=(xdims - 2, xdims - 1, *range(0, xdims - 2)),
          )
      else:
          xnormalized = tf.transpose(
              xnormalized,
              perm=(xdims - 2, *range(0, xdims - 2), xdims - 1),
          )
  
      return (
          xnormalized,
          tf.reduce_mean(tf.reshape(runningmean, (N, C)), axis=0),
          tf.reduce_mean(tf.reshape(runningvariance, (N, C)), axis=0),
      )
  
file_path: ivy/ivy/functional/backends/tensorflow/experimental/norms.py
imports: import tensorflow
  from typing import Literal, Union, Optional, Tuple
  from ivy.func_wrapper import with_supported_dtypes, with_unsupported_dtypes
  from .None import backend_version
  import math
label_desc: Use image node_id 5 for calling a global function with example usage: instance_norm() and returns: xnormalized,  tf,  tf