junrushao1994 commented on a change in pull request #10031:
URL: https://github.com/apache/tvm/pull/10031#discussion_r790196157



##########
File path: include/tvm/runtime/packed_func.h
##########
@@ -57,6 +57,73 @@ class TVMMovableArgValueWithContext_;
 class TVMRetValue;
 class TVMArgsSetter;
 
+/*!
+ * \brief Object container class that backs PackedFunc.
+ * \note Do not use this function directly, use PackedFunc.
+ */
+class PackedFuncObj : public Object {
+ public:
+  /*!
+   * \brief Call the function in packed format.
+   * \param args The arguments
+   * \param rv The return value.
+   */
+  inline void CallPacked(TVMArgs args, TVMRetValue* rv) const;
+  
+  /*! \return Whether the packed function is nullptr */
+  bool operator==(std::nullptr_t null) const { return f_call_ == nullptr; }
+  /*! \return Whether the packed function is not nullptr */
+  bool operator!=(std::nullptr_t null) const { return f_call_ != nullptr; }
+
+  static constexpr const char* _type_key = "PackedFuncObj";

Review comment:
       Let's rename it according to our convention in StringObj, also please 
add a static type index: 
https://github.com/apache/tvm/blob/main/include/tvm/runtime/container/string.h#L92-L93.
   
   ```suggestion
     static constexpr const char* _type_key = "runtime.PackedFunc";
   ```




-- 
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]


Reply via email to