diff --git a/imperative/src/impl/interpreter/option_manager.h b/imperative/src/impl/interpreter/option_manager.h index 8100c15d..c140b1f4 100644 --- a/imperative/src/impl/interpreter/option_manager.h +++ b/imperative/src/impl/interpreter/option_manager.h @@ -25,6 +25,7 @@ public: #define DEF_OPTION(name, env_key, default_value, desc) \ size_t name = (m_option_map[#name]=&name, get_option_from_env(env_key, default_value)); + // Environ value would be read only when interpreter initializing. DEF_OPTION(async_level, "MEGENGINE_INTERP_ASYNC_LEVEL", 2, "config whether raise error exactly when invoking op.\n" "level 2: both device and user side errors are async;\n" diff --git a/imperative/src/include/megbrain/imperative/utils/to_string.h b/imperative/src/include/megbrain/imperative/utils/to_string.h index 7a8dc9b1..92825db9 100644 --- a/imperative/src/include/megbrain/imperative/utils/to_string.h +++ b/imperative/src/include/megbrain/imperative/utils/to_string.h @@ -21,9 +21,13 @@ namespace mgb::imperative { +// Implement `ToStringTrait` for your printable class +// note that it should be either implemented in this file +// or in the same file with your class template struct ToStringTrait; +// Call `to_string` to print your value template std::string to_string(const T& value) { return ToStringTrait{}(value); @@ -92,7 +96,6 @@ template <> struct ToStringTrait{ std::string operator()(TensorShape shape) const { if (shape.ndim > TensorShape::MAX_NDIM) { - printf("ndim: %d\n", (int)shape.ndim); return "[]"; } mgb_assert(shape.ndim <= TensorShape::MAX_NDIM);