I am not sure if I understand correctly, but here is couple of options:

If you need just module arguments’ names (without values), you can just use __dict__, filtering out privates starting with _ and converting the returned dictionary keys into list or even more simply like this:

[arg_name for arg_name in conv2d.__dict__ if not arg_name.startswith('_')]


If you need module arguments’ names and their respective values, it seams appropriate to me to use __dict__ as shown in my previous post (also filtering out privates starting with _)