()
| 203 | |
| 204 | |
| 205 | def 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 | |
| 215 | def test_reduced_precision_markers_are_not_public_value_classes(): |
nothing calls this directly
no test coverage detected