wweic commented on a change in pull request #4346: [Runtime] Make ADTObject POD
container type
URL: https://github.com/apache/incubator-tvm/pull/4346#discussion_r349905954
##########
File path: include/tvm/runtime/memory.h
##########
@@ -73,6 +74,26 @@ class ObjAllocatorBase {
ptr->deleter_ = Handler::Deleter();
return ObjectPtr<T>(ptr);
}
+
+ /*!
+ * \tparam ArrayType The type to be allocated.
+ * \tparam ElemType The type of array element.
+ * \tparam Args The constructor signature.
+ * \param num_elems The number of array elements.
+ * \param args The arguments.
+ */
+ template<typename ArrayType, typename ElemType, typename... Args>
+ inline ObjectPtr<ArrayType> make_inplace_array(size_t num_elems, Args&&...
args) {
+ using Handler = typename Derived::template Handler<ArrayType, ElemType>;
+ static_assert(std::is_base_of<Object, ArrayType>::value,
+ "make_node can only be used to create NodeBase");
Review comment:
Good catch! fixed.
----------------------------------------------------------------
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]
With regards,
Apache Git Services