InstanceNorm1d expects only 3D inputs, while the documentation states:
"Applies Instance Normalization over a 2D or 3D input (a mini-batch of 1D inputs with optional additional channel dimension)"
Furthermore, InstanceNorm1d, InstanceNorm2d, and InstanceNorm3d appear to be redundant as they add nothing to their parent class _InstanceNorm except an input dimension check.
Proposal A:
Fix the dimension check in InstanceNorm1d to allow both 2D and 3D inputs.
Proposal B:
Merge all instance norm classes into a single class, for any input dimensions > 1.