Hi,
I’m not sure about the exact formula for instance norm, but in your code sample, you can move everything to double then use torch.autograd.gradcheck(instaceN, (x,)) to check the gradients using finite differencing and the check passes.
So these are the expected gradients. I think the Jacobian is not 0 but, the sum() operation on y makes you compute 1^T J which sums the columns, and this sum is 0.