Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pytorch super(class, self).__init__() vs super().__init__()

Tags:

pytorch

So far out of all the paper and its corresponding code I see people use super(class, self).__init__() instead of super().__init__() within their def __init__ function regardless of which python version people are using. Why? I thought they are the same thing but different syntax for different version of python. Am I paranoid or is there an actual reason to use the old format in pytorch?

Edited: It's for backward compatibility and nothing else.

like image 268
inkplay_ Avatar asked Oct 26 '25 06:10

inkplay_


1 Answers

I asked on the official form and it seems to be just for backward compatibility and nothing else.

like image 121
inkplay_ Avatar answered Oct 28 '25 02:10

inkplay_



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!