Skip to content

Commit c7132f3

Browse files
committed
black
1 parent a6a735a commit c7132f3

File tree

1 file changed

+4
-0
lines changed
  • onnx_array_api/validation

1 file changed

+4
-0
lines changed

onnx_array_api/validation/f8.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# display functions
55

6+
67
def display_float32(value, sign=1, exponent=8, mantissa=23):
78
"""
89
Displays a float32 into b.
@@ -247,6 +248,7 @@ def fe4m3_to_float32(ival: int, fn: bool = True, uz: bool = False) -> float:
247248
f = numpy.uint32(res).view(numpy.float32) # pylint: disable=E1121
248249
return f
249250

251+
250252
def fe5m2_to_float32(ival: int, fn: bool = False, uz: bool = False) -> float:
251253
"""
252254
Casts a float E5M2 encoded as an integer into a float.
@@ -295,8 +297,10 @@ def fe5m2_to_float32(ival: int, fn: bool = False, uz: bool = False) -> float:
295297
f = numpy.uint32(res).view(numpy.float32) # pylint: disable=E1121
296298
return f
297299

300+
298301
# cast from float32 to float 8
299302

303+
300304
class CastFloat8:
301305
"""
302306
Helpers to cast float8 into float32 or the other way around.

0 commit comments

Comments
 (0)