Can't forward pass under colab but can under linux

Title could be vague but here is the problem:
I have a codes = net.encoder(x) line which performs a single pass on encoder with its forward function defined as

def forward(self, x):

    x = self.input_layer(x)

and self.input_layer is defined as

self.input_layer = Sequential(Conv2d(3, 64, (3, 3), 1, 1, bias=False),
BatchNorm2d(64),
PReLU(64))

apparently on my linux machine with torch 2.0.1 this runs fine but in colab, it doesn’t throws error but can’t pass beyond x = self.input_layer(x) which i checked with a print statement afterwards. How to debug this?

You could try to reproduce the hang in ipython in a terminal and in case you are able to do so, you could attach gdb to check where the code is hanging for further debugging.

I tried on the local in an Ipython and it ran smoothly just like the command line. Colab is problematic and indeed it doesn’t throws error or hangs, acts like it completed command successfully. And the error seems to originate from torch library.