threshold is used from the functional API via F.threshold, which is a function and is thus not trainable, and also assigned as an attribute to some modules as a scalar, which isn’t a trainable nn.Parameter either.
You would thus have to define it as an nn.Parameter, so that it’ll be returned by model.parameters().