tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] zhiics commented on a change in pull request #5271: [RUNTIME] Introduce RValue reference(move) support to TypedPackedFunc
Date Fri, 10 Apr 2020 16:32:26 GMT
zhiics commented on a change in pull request #5271: [RUNTIME] Introduce RValue reference(move)
support to TypedPackedFunc
URL: https://github.com/apache/incubator-tvm/pull/5271#discussion_r405965674
 
 

 ##########
 File path: include/tvm/runtime/packed_func.h
 ##########
 @@ -863,6 +891,35 @@ class TVMRetValue : public TVMPODValue_ {
   }
 };
 
+/*!
+ * \brief Type trait to specify special value conversion rules from
+ *        TVMArgValue and TVMRetValue.
+ *
+ *  The trait can be specialized to add type specific conversion logic
+ *  from the TVMArgvalue and TVMRetValue.
+ *
+ * \tparam TObjectRef the specific ObjectRefType.
+ */
+template<typename TObjectRef>
+struct PackedFuncValueConverter {
+  /*!
+   * \brief Convert an TObjectRef from an argument value.
+   * \param val The argument value.
+   * \return the converted result.
+   */
+  static TObjectRef From(const TVMArgValue& val) {
+    return val.AsObjectRef<TObjectRef>();
+  }
+  /*!
+   * \brief Convert an TObjectRef from an argument value.
 
 Review comment:
   s/an argument/a return

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message