Solved by richard in post #2 
              
              
                I’m assuming your intent is to programmatically assign a name for the submodule. Try one of the following: 
class test(nn.Module):
    def __init__(self):
        super(test, self).__init__()
        self.__setattr__('a' + '_1', nn.Conv2d(3, 3, kernel_size=3))
        self.add_module('a' + '_2', nn.…