mirror of https://github.com/Jittor/Jittor
fixed bug: model.__str__ crashed when there is a Sigmoid/Tanh or a nn.Sequential with no layers in custom model
This commit is contained in:
parent
c81a8ed4b6
commit
2d0e92507a
|
@ -506,6 +506,8 @@ class Module:
|
|||
return cd
|
||||
|
||||
def extra_repr(self):
|
||||
if self.__init__.__defaults__ is None:
|
||||
return ""
|
||||
ss = []
|
||||
n = len(self.__init__.__code__.co_varnames) - \
|
||||
len(self.__init__.__defaults__)
|
||||
|
|
Loading…
Reference in New Issue