I am working in a distributed setting, the server serializes the model using torch.jit.trace and sends it to the workers, my issue after using the custom batchNorm is that with Tracing the worker when it receives the model, the batchNorm layer does not work(no access to the if/else statement).
for the save function I also tried jit.ignore, it passes with no error but when I use it inside the if statement it is not executed for the reason I mentioned above.