Closed naegelejd closed 1 month ago
This is caused by the following events:
NDArraySerializerBase
checks if the array is trivially serializable: https://github.com/microsoft/yardl/blob/ea42e477ae78939b4327ca690f7c82bf1e2b2162/tooling/internal/python/static_files/_binary.py#L1125-L1129NDArraySerializerBase
calls the ComplexFloat32Serializer.write_numpy
method, which is implemented by StructSerializer
, and uses struct.Struct.pack_into
with the format string <ff
, which is not valid for a complex number. https://github.com/microsoft/yardl/blob/ea42e477ae78939b4327ca690f7c82bf1e2b2162/tooling/internal/python/static_files/_binary.py#L624-L626
Given a model containing arrays of complex numbers, e.g.
If the NumPy array being serialized is not "C-contiguous", e.g.
yardl's binary serializer throws the following error: