tqchen commented on a change in pull request #7152:
URL: https://github.com/apache/tvm/pull/7152#discussion_r562270981
##########
File path: include/tvm/runtime/packed_func.h
##########
@@ -1377,7 +1449,7 @@ inline TObjectRef TVMPODValue_::AsObjectRef() const {
using ContainerType = typename TObjectRef::ContainerType;
if (type_code_ == kTVMNullptr) {
- ICHECK(TObjectRef::_type_is_nullable)
+ CHECK(TObjectRef::_type_is_nullable)
Review comment:
this should actually be a runtime check, note that constant folding will
actually remove this completely
##########
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:
[email protected]