Forward function running forever because of custom function

Hi all,

I am running a custom function in the forward function. My forward function looks like the following:

     def forward(self, x: torch.Tensor):

      x = self.layer[0](x)
      v_out= custom_function_call
      x = self.layer[1](v_out)
      x = self.layer[2](x)
      x = self.layer[3](x)
      return x

The custom function calculates values and returns these in a tensor of the correct size, which is then passed to the second layer in the net.

My issue is that it looks like this function makes the forward function run forever.

Any pointers?

It’s unclear what custom_function_call is and you might want to share more details about this method so we could check why it’s hanging or takes a long time.