tqchen commented on a change in pull request #7152:
URL: https://github.com/apache/tvm/pull/7152#discussion_r562281721



##########
File path: include/tvm/runtime/packed_func.h
##########
@@ -229,13 +229,13 @@ class TypedPackedFunc<R(Args...)> {
    * \endcode
    *
    * \param typed_lambda typed lambda function.
+   * \param name the name of the lambda function.
    * \tparam FLambda the type of the lambda function.
    */
-  template <typename FLambda, typename = typename std::enable_if<
-                                  std::is_convertible<FLambda,
-                                                      
std::function<R(Args...)>>::value>::type>
-  TypedPackedFunc(const FLambda& typed_lambda) {  // NOLINT(*)
-    this->AssignTypedLambda(typed_lambda);
+  template <typename FLambda, typename = typename 
std::enable_if<std::is_convertible<
+                                  FLambda, 
std::function<R(Args...)>>::value>::type>
+  TypedPackedFunc(const FLambda& typed_lambda, std::string name = 
"<anonymous>") {  // NOLINT(*)

Review comment:
       We need two constructors, one that has the string argument and another 
that does not.
   
   The one that is anonymous should not capture any string content or construct 
a string




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to