Shortcuts

LazyInstanceNorm2d

class torch.nn.LazyInstanceNorm2d(eps=1e-05, momentum=0.1, affine=True, track_running_stats=True, device=None, dtype=None)[source]

A torch.nn.InstanceNorm2d module with lazy initialization of the num_features argument of the InstanceNorm2d that is inferred from the input.size(1). The attributes that will be lazily initialized are weight, bias, running_mean and running_var.

Check the torch.nn.modules.lazy.LazyModuleMixin for further documentation on lazy modules and their limitations.

Parameters
  • num_featuresCC from an expected input of size (N,C,H,W)(N, C, H, W) or (C,H,W)(C, H, W)

  • eps – a value added to the denominator for numerical stability. Default: 1e-5

  • momentum – the value used for the running_mean and running_var computation. Default: 0.1

  • affine – a boolean value that when set to True, this module has learnable affine parameters, initialized the same way as done for batch normalization. Default: False.

  • track_running_stats – a boolean value that when set to True, this module tracks the running mean and variance, and when set to False, this module does not track such statistics and always uses batch statistics in both training and eval modes. Default: False

Shape:
  • Input: (N,C,H,W)(N, C, H, W) or (C,H,W)(C, H, W)

  • Output: (N,C,H,W)(N, C, H, W) or (C,H,W)(C, H, W) (same shape as input)

cls_to_become

alias of torch.nn.modules.instancenorm.InstanceNorm2d

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources