parameters: (x,
                    running_mean=None,
                    running_var=None,
                    weight=None,
                    bias=None,
                    use_input_stats=True,
                    momentum=0.9,
                    eps=1e-05,
                    data_format="NCHW",
                    name=None)
return_statement: return instance_norm_out
docstring: See more detail in nn.layer.InstanceNorm2D.
  
      Parameters:
          x(Tensor): Input Tensor. It's data type should be float32, float64.
          running_mean(Tensor): running mean. Default None.
          running_var(Tensor): running variance. Default None.
          weight(Tensor, optional): The weight tensor of instance_norm. Default: None.
          bias(Tensor, optional): The bias tensor of instance_norm. Default: None.
          eps(float, optional): A value added to the denominator for numerical stability. Default is 1e-5.
          momentum(float, optional): The value used for the moving_mean and moving_var computation. Default: 0.9.
          use_input_stats(bool): Default True.
          data_format(str, optional): Specify the input data format, may be "NC", "NCL", "NCHW" or "NCDHW". Defalut "NCHW".
          name(str, optional): Name for the InstanceNorm, default is None. For more information, please refer to :ref:`api_guide_Name`..
  
      Returns:
          None.
  
      Examples:
  
          .. code-block:: python
  
            import paddle
            import numpy as np
  
            np.random.seed(123)
            x_data = np.random.random(size=(2, 2, 2, 3)).astype('float32')
            x = paddle.to_tensor(x_data)
            instance_norm_out = paddle.nn.functional.instance_norm(x)
  
            print(instance_norm_out)
docstring_summary: See more detail in nn.layer.InstanceNorm2D.
docstring_tokens: See more detail in nn . layer . InstanceNorm2D .
function: def instance_norm(x,
                    running_mean=None,
                    running_var=None,
                    weight=None,
                    bias=None,
                    use_input_stats=True,
                    momentum=0.9,
                    eps=1e-05,
                    data_format="NCHW",
                    name=None):
      """
      See more detail in nn.layer.InstanceNorm2D.
  
      Parameters:
          x(Tensor): Input Tensor. It's data type should be float32, float64.
          running_mean(Tensor): running mean. Default None.
          running_var(Tensor): running variance. Default None.
          weight(Tensor, optional): The weight tensor of instance_norm. Default: None.
          bias(Tensor, optional): The bias tensor of instance_norm. Default: None.
          eps(float, optional): A value added to the denominator for numerical stability. Default is 1e-5.
          momentum(float, optional): The value used for the moving_mean and moving_var computation. Default: 0.9.
          use_input_stats(bool): Default True.
          data_format(str, optional): Specify the input data format, may be "NC", "NCL", "NCHW" or "NCDHW". Defalut "NCHW".
          name(str, optional): Name for the InstanceNorm, default is None. For more information, please refer to :ref:`api_guide_Name`..
  
      Returns:
          None.
  
      Examples:
  
          .. code-block:: python
  
            import paddle
            import numpy as np
  
            np.random.seed(123)
            x_data = np.random.random(size=(2, 2, 2, 3)).astype('float32')
            x = paddle.to_tensor(x_data)
            instance_norm_out = paddle.nn.functional.instance_norm(x)
  
            print(instance_norm_out)
  
      """
  
      if in_dygraph_mode():
          out, _, _ = _C_ops.instance_norm(x, weight, bias, "epsilon", eps,
                                           "momentum", momentum, "data_format",
                                           data_format)
          return out
  
      check_variable_and_dtype(x, 'input', ['float32', 'float64'], "InstanceNorm")
  
      attrs = {"epsilon": eps, "momentum": momentum, "data_format": data_format}
  
      if weight and bias:
          inputs = {"X": [x], "Scale": [weight], "Bias": [bias]}
      else:
          inputs = {"X": [x]}
  
      helper = LayerHelper('instance_norm', **locals())
      saved_mean = helper.create_variable_for_type_inference(
          dtype=x.dtype, stop_gradient=True)
      saved_variance = helper.create_variable_for_type_inference(
          dtype=x.dtype, stop_gradient=True)
      instance_norm_out = helper.create_variable_for_type_inference(x.dtype)
  
      outputs = {
          "Y": [instance_norm_out],
          "SavedMean": [saved_mean],
          "SavedVariance": [saved_variance]
      }
  
      helper.append_op(
          type="instance_norm", inputs=inputs, outputs=outputs, attrs=attrs)
      return instance_norm_out
function_tokens: def instance_norm ( x , running_mean = None , running_var = None , weight = None , bias = None , use_input_stats = True , momentum = 0.9 , eps = 1e-05 , data_format = "NCHW" , name = None ) : if in_dygraph_mode ( ) : out , _ , _ = _C_ops . instance_norm ( x , weight , bias , "epsilon" , eps , "momentum" , momentum , "data_format" , data_format ) return out check_variable_and_dtype ( x , 'input' , [ 'float32' , 'float64' ] , "InstanceNorm" ) attrs = { "epsilon" : eps , "momentum" : momentum , "data_format" : data_format } if weight and bias : inputs = { "X" : [ x ] , "Scale" : [ weight ] , "Bias" : [ bias ] } else : inputs = { "X" : [ x ] } helper = LayerHelper ( 'instance_norm' , * * locals ( ) ) saved_mean = helper . create_variable_for_type_inference ( dtype = x . dtype , stop_gradient = True ) saved_variance = helper . create_variable_for_type_inference ( dtype = x . dtype , stop_gradient = True ) instance_norm_out = helper . create_variable_for_type_inference ( x . dtype ) outputs = { "Y" : [ instance_norm_out ] , "SavedMean" : [ saved_mean ] , "SavedVariance" : [ saved_variance ] } helper . append_op ( type = "instance_norm" , inputs = inputs , outputs = outputs , attrs = attrs ) return instance_norm_out