I am training a simple cnn (2 conv layers) with a triplet margin loss. At some point during training the weights of the first conv layer become nan (I am still trying to figure that one out). The output from the first conv layer at this point is a tensor full of -Inf or +Inf values. Nevertheless the output to the entire network is a valid tensor with real numbers. In fact if I forward a tensor with Infs through a conv layer the output seems to be a bunch of 1s. Is this the expected behavior?