Name of the optimizer being used

Hi Nihal!

print (type (optimizer).__name__)

will do what you want.

(This is generally true for python objects, and is not specific to pytorch.)

Best.

K. Frank

3 Likes