下面用于展示自己在学习Pytorch过程中一点散碎的知识点
class mywindow(QtWidgets.QMainWindow, Ui_MainWindow):
def __init__(self):
super(mywindow, self).__init__()
self.setupUi(self)
# 定义槽函数
def hello(self):
self.textEdit.setText("hello world")
python中的super(Net, self).__init__()
首先找到Net的父类(比如是类NNet),然后把类Net的对象self转换为类NNet的对象,然后“被转换”的类NNet对象调用自己的init函数