Solved by Nikronic in post #2 
              
              
                Hi, 
Actually, it is about python programming language. forward() function overrides __call__() function so when you call your class like CNNClass() it calls __call__() function which in pytorch case it is forward() function. So 

model = CNNClass()
out = model(image)

Is same as: 
model = CNNClass(…