MCPcopy Create free account
hub / github.com/apache/fory / test_float16_round_trip

Function test_float16_round_trip

python/pyfory/tests/test_serializer.py:195–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193
194
195def test_float16_round_trip():
196 fory = Fory(xlang=True, compatible=False, ref=False)
197 typeinfo = fory.type_resolver.get_type_info(pyfory.Float16)
198 assert isinstance(typeinfo.serializer, pyfory.Float16Serializer)
199 assert typeinfo.type_id == TypeId.FLOAT16
200 decoded = ser_de(fory, _float16_from_bits(0x3C00))
201 assert isinstance(decoded, float)
202 assert _float16_to_bits(decoded) == 0x3C00
203
204
205def test_bfloat16_round_trip():

Callers

nothing calls this directly

Calls 3

ForyClass · 0.90
ser_deFunction · 0.70
get_type_infoMethod · 0.45

Tested by

no test coverage detected