I am using a standard out-of-the-box nn.transformer module (it was a choice when 1.2 was released - I did not need BERT, so I decided to opt for a standard module) like this:
layer = nn.TransformerEncoderLayer(d_model=size,
                                   nhead=8,
                                   dim_feedforward=size * decoder_girth,
                                   dropout=dropout)
self.decoder = nn.TransformerEncoder(layer, decoder_layers

Now I have encountered this error. It is a bit cryptic, but is my assumption correct that the erroneous 5 function should just be replaced with a nn.module version? Or am I missing sth?
Maybe someone had this sort of error? It is probably going to be fixed in 1.5.0, but I would need to monkey patch it somehow now