类继承测试

class PreTrainedTokenizer():
    def __init__(self,a = 1,b = 2,c = 3):
        self.a = a
        self.b = b
        self.c = c

    @classmethod
    def pretrain(cls,*init_inputs,**kwargs):
        t = cls(*init_inputs,**kwargs)
        print(t.a,t.b,t.c)

    def test1(self):
        return "test1"



class Pegasus(PreTrainedTokenizer):
    def __init__(self):
        self.a = 11
        self.b = 12
        self.c = 13
        self.d = 14
        super().__init__(
            a = self.a,
            b = self.b,
            c = self.c
        )


print(Pegasus.pretrain())

你可能感兴趣的:(AI_小代码库,python,开发语言)