Karthik_Ganesan:

So is there a nice way for me to set a property (parameter or otherwise) at a model level and have access to it in my own layer code?


Question: Why not pass the custom_value while calling the self.conv_1 in custom_model's forward()? This way, either you can set the custom_value at each run before forward() call or directly parameterize the forward() with custom_value.



 Karthik_Ganesan:

I am not planning to train this model.


Then custom_value is not expected to get gradients?
If so, it doesn’t need to be nn.Parameter().



 Karthik_Ganesan:

I initialize custom_value with 0, it always stays zero.


By the time you are trying to set custom_value, self.conv_1 have been already created with its old value. (i.e., 0)