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

Function test_bfloat16_round_trip

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

Source from the content-addressed store, hash-verified

203
204
205def test_bfloat16_round_trip():
206 fory = Fory(xlang=True, compatible=False, ref=False)
207 typeinfo = fory.type_resolver.get_type_info(pyfory.BFloat16)
208 assert isinstance(typeinfo.serializer, pyfory.BFloat16Serializer)
209 assert typeinfo.type_id == TypeId.BFLOAT16
210 decoded = ser_de(fory, _bfloat16_from_bits(0x3FC0))
211 assert isinstance(decoded, float)
212 assert _bfloat16_to_bits(decoded) == 0x3FC0
213
214
215def test_reduced_precision_markers_are_not_public_value_classes():

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