Keyword arguments in torch.nn.Sequential (pytroch)
a question regarding keywords in torch.nn.Sequential, it is possible in some way to forward keywords to specific models in a sequence?

    model = torch.nn.Sequential(model_0, MaxPoolingChannel(1))
    res = model(input_ids_2, keyword_test=mask)


here, keyword_test should be forwarded only to the first model.

Thank a lot and best regards!

my duplicate from - https://discuss.pytorch.org/t/keyword-arguments-in-torch-nn-sequential/53282

No; you cannot. This is only possible if all models passed to the nn.Sequential expects the argument you are trying to pass in their forward method (at least at the time of writing this). 

Two workarounds could be (I'm not aware of the whole case, but anticipated from the question):


If your value is static, why not initializing your first model with that value, and access it during computation with self.keyword_test. 
In case the value is dynamic, you could have it as an inherent property in the input; hence, you can access it, also, during computation with input_ids_2.keyword_test

