paddle.nn.functional. 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 ) [source]

See more detail in nn.layer.InstanceNorm2D.

  • x (Tensor) – Input Tensor. It’s data type should be float32, float64.

  • running_mean (Tensor, optional) – running mean. Default None.

  • running_var (Tensor, optional) – 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, optional) – 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 Name..




import paddle

x = paddle.rand((2, 2, 2, 3))
instance_norm_out = paddle.nn.functional.instance_norm(x)