Question About the Design of Serialization Function Signature in BackendMeta.

The serialization function of BackendMeta requires metadata to be serialized into a std::unordered_map<std::string, bool>. While this works well for simple boolean states, it introduces complexity when serializing other data types, such as integers. For instance, if I need to store an integer value, I have to convert it into a string or encode it in a way that fits into this structure, which adds extra overhead during serialization and deserialization.

  1. Why was std::unordered_map<std::string, bool> chosen instead of a more flexible structure?

  2. Is the primary intent of this function to handle only simple presence/absence states, or is it expected to support more complex metadata types with additional processing?

Understanding the reasoning behind this design will help me better align with PyTorch’s intended usage patterns and contribute effectively.

Thank you for your time and insights.