mirror of https://github.com/Jittor/Jittor
add jt.Var,__format__
This commit is contained in:
parent
7f0444d0e0
commit
294af2f525
|
@ -884,6 +884,11 @@ Var.__int__ = to_int
|
|||
Var.__float__ = to_float
|
||||
Var.__bool__ = to_bool
|
||||
|
||||
def format(v, spec):
|
||||
return v.item().__format__(spec)
|
||||
Var.__format__ = format
|
||||
|
||||
|
||||
int = int32
|
||||
Var.int = Var.int32
|
||||
float = float32
|
||||
|
|
Loading…
Reference in New Issue