Ajinkya_Ambatwar:

class temp(nn.Module):
    def __init__(self):
        super(temp).__init__()



This is because you don’t initialize correctly the main class (nn.Module) that temp inherits.
Change super(temp).__init__() to super(temp, self).__init__() or super().__init__(), and the problem will be solved.