Solved by Semir_Elezovikj in post #2 
              
              
                @alband: 
self.ego_encoder_layer = nn.TransformerEncoderLayer(d_model=2048, nhead=16, activation='gelu')
self.ego_transformer_encoder = nn.TransformerEncoder(self.ego_encoder_layer, num_layers=6)

Removing the self designator in the ego_transformer_encoder resolved the issue? Not sure why: 
ego_enco…