Hi everyone.
I come from a C++/C# background and this has made me thinking for sometime now! Here is my question :
Since Pytorch has a dynamic nature, there will be many situations in which you’d be dealing with different classes on the fly and checking for which classes you are dealing with.
Currently one way to access the class names is through __class__ and __class__.__name__ (class attributes) .
My question is, knowing that names with __, mean they are supposed to be private and not be accessed by the developer, Why doesn’t Pytorch provide a simple property to access them?
Simple things such as :
for m in model.modules():
    if (m.__class__.__name__ == torch.nn.Linear.__class__.__name__):
         ...

become very long and ugly needlessly! let alone more complex ones.
I could ask this about the Python langauge, but thought maybe, due to compatibility reasons, they can not do that there, but nothing stops a library to provide its own set of utility methods, properties.
So What is stopping you from providing such things that would make life easier and codes much more readable.
Thanks in advance