Solved by albanD in post #2 
              
              
                Hi, 
python does not allow you to create two functions with the same name like that. 
What you can do though is: 
def __init__(self):
   super(Test, self).__init__()
   pass

def forward(self, x, y, z=None ):
    if z is None:
        # Forward with 2 arguments
        pass
    else:
        # Forwa…