pretty print jt.Var

This commit is contained in:
lzhengning 2022-09-16 16:44:43 +08:00 committed by Zheng-Ning Liu
parent b258cf3a84
commit e050dd6dc9
1 changed files with 3 additions and 1 deletions

View File

@ -1710,7 +1710,9 @@ def jittor_exit():
atexit.register(jittor_exit)
def vtos(v):
return f"jt.Var({v.data}, dtype={v.dtype})"
data_str = f"jt.Var({v.data}, dtype={v.dtype})"
data_str = data_str.replace("\n", "\n ")
return data_str
Var.__str__ = vtos
Var.__repr__ = vtos