Ayano_Kondo:

h0 = torch.randn(self.num_layers2, int(x.size(0)), self.hidden_size).to(device) # 2 for bidirection
c0 = torch.randn(self.num_layers2, int(x.size(0)), self.hidden_size).to(device)


In this line you try to find the size of x, but x is a tuple I’m guessing.