File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def from_bits(self, raw):
6767 return c
6868
6969 def __repr__ (self ):
70- return f"fixed.Shape ({ self ._storage_shape } , f_bits= { self .f_bits } )"
70+ return f"{ 'SQ' if self . signed else 'UQ' } ({ self .i_bits } , { self .f_bits } )"
7171
7272
7373class SQ (Shape ):
@@ -260,7 +260,7 @@ def __eq__(self, other):
260260 return self ._binary_compare (other , '__eq__' )
261261
262262 def __repr__ (self ):
263- return f"fixed.{ 'SQ' if self . signed else 'UQ' } ({ self .i_bits } , { self .f_bits } ) { self . _target !r} "
263+ return f"fixed.Value ({ self ._shape !r } , { self ._target !r} ) "
264264
265265
266266class Const (Value ):
@@ -326,3 +326,7 @@ def as_integer_ratio(self):
326326
327327 def as_float (self ):
328328 return self ._value / 2 ** self .f_bits
329+
330+ def __repr__ (self ):
331+ return f"fixed.Const({ self .as_float ()} , { self ._shape !r} )"
332+
You can’t perform that action at this time.
0 commit comments