(ReadContext context)
| 322 | } |
| 323 | |
| 324 | public override Half[] ReadData(ReadContext context) |
| 325 | { |
| 326 | int byteSize = checked((int)context.Reader.ReadVarUInt32()); |
| 327 | if ((byteSize & 1) != 0) |
| 328 | { |
| 329 | throw new InvalidDataException("float16 array byte size mismatch"); |
| 330 | } |
| 331 | |
| 332 | context.Reader.CheckBound(byteSize); |
| 333 | Half[] values = new Half[byteSize / 2]; |
| 334 | for (int i = 0; i < values.Length; i++) |
| 335 | { |
| 336 | values[i] = BitConverter.UInt16BitsToHalf(context.Reader.ReadUInt16()); |
| 337 | } |
| 338 | |
| 339 | return values; |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | internal sealed class BFloat16ArraySerializer : Serializer<BFloat16[]> |
nothing calls this directly
no test coverage detected