utils_13.py 274 B

123456789
  1. def serialize(self):
  2. """Callback to serialize the array."""
  3. string_file = io.BytesIO()
  4. try:
  5. numpy.save(string_file, self.array, allow_pickle=False)
  6. serialized = string_file.getvalue()
  7. finally:
  8. string_file.close()
  9. return serialized