As long as I understand InstanceNorm1d normalizes the features for each channel.
I am not sure why InstanceNorm1d works in both of the following examples and does not give me an error…
m = nn.InstanceNorm1d(5)
batch, sentence_length, embedding_dim = 2, 3, 5
embedding1 = torch.randn(batch, sentence_length, embedding_dim)
embedding2 = torch.randn(batch, embedding_dim, sentence_length)

case1) 
out1 = m(embedding1)

case2)
out2 = m(embedding2)

what is the difference of case 1 and 2 and and how the InstanceNorm1d is computed for each case?