dmlc / treelite

Universal model exchange and serialization format for decision tree forests

Home Page:https://treelite.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clean up serialization logic

hcho3 opened this issue · comments

The current logic for serializer is a mess, with feeble attempt at abstraction. In particular, it's unclear what SerializeTemplate and DeserializeTemplate do, and why two copies of them exist in the header include/tree/tree.h.

We need a better abstraction for implementing common logic for PyBuffer and FILE serializers.

Also: we should use std::ostream / std::istream instead of FILE*. This way, we can seamlessly support serialization to in-memory strings.