Solved by ptrblck in post #4 
              
              
                You would have to create instances of your Custom module before calling it (same as with other modules, e.g. nn.Linear). 
Currently you are trying to pass the activation directly to the module instantiation: 
x = Custom(x)

Instead define instances of Custom in the __init__ method of Network and cal…