欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

理解Python中的super()函数及其两种用法

最编程 2024-01-19 11:11:24
...

python2 必须使用super(class, self), python3 两者都可以

问题来源

【动手学深度学习】https://zh-v2.d2l.ai/chapter_recurrent-modern/encoder-decoder.html
9.6 编码器-解码器架构
image
这个super没看懂,一般就是super(self)来着

问题解决

参考:https://www.runoob.com/python/python-func-super.html
原来是python2的写法,python3中也通用
image

推荐阅读