tqchen commented on code in PR #169:
URL: https://github.com/apache/tvm-ffi/pull/169#discussion_r2541815404
##########
include/tvm/ffi/container/tensor.h:
##########
@@ -350,6 +350,50 @@ class Tensor : public ObjectRef {
bool IsAligned(size_t alignment) const { return tvm::ffi::IsAligned(*get(),
alignment); }
/*!
* \brief Create a Tensor from a NDAllocator.
+ *
+ *
+ * Example usage:
Review Comment:
Add note here:
When building a kernel library, we always recommend use FromEnvAlloc when
possible to allocate intermediate Tensors. When a loaded module returns an
allocated Tensor to the caller, we need to keep the module alive before the
returned tensor get deallocated, because its deleter is defined within the
module. FromNDAlloc can be used by C++ applications and runtimes to create
Tensors.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]