junrushao commented on code in PR #36:
URL: https://github.com/apache/tvm-ffi/pull/36#discussion_r2397464818
##########
include/tvm/ffi/reflection/registry.h:
##########
@@ -35,13 +38,37 @@ namespace tvm {
namespace ffi {
/*! \brief Reflection namespace */
namespace reflection {
-
/*!
* \brief Trait that can be used to set field info
* \sa DefaultValue, AttachFieldFlag
*/
struct FieldInfoTrait {};
+/*! \brief User-supplied metadata attached to a field or a method */
+class Metadata : public FieldInfoTrait {
Review Comment:
Updated with a significantly more complicated approach:
- Added `EscapeString` in `string.h`, which is refactored from `WriteString`
in `json_write.cc`
- Updated `refl::Metadata::ToJSON` to using string stitching to dump a
Python. It also on-the-fly checks if value types is one of `int | bool | str`
and disallow other types.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]