Solved by ptrblck in post #2 
              
              
                Do you have a first attempt on porting this code and could share it? 
If not, you could start by implementing a custom module, define all layers in its __init__ method and write the forward pass in its forward: 
class CBR(nn.Module):
    def __init__(self, in_channels, out_channels, kernel, stride, …