Steps to reproduce:

Load an alexnet from torchvision
Change model’s first weight to torch.tensor(float(‘inf’))
Register forward hook and check the output of first conv layer and first ReLu layer
I speculate this bug was caused by torch’s measure to inf value
Screen Shots:
Conv Layer’s output and another parameter:

image1096×474 38.5 KB


ReLu Layer’s output and another parameter:

image1031×508 33.6 KB


Torchinfo’s summary of AlexNet

image1378×1023 82.8 KB


Note: input_val was a tuple