gemini-code-assist[bot] commented on code in PR #81:
URL: https://github.com/apache/tvm-ffi/pull/81#discussion_r2395702319


##########
include/tvm/ffi/container/tensor.h:
##########
@@ -458,6 +458,163 @@ class Tensor : public ObjectRef {
   TensorObj* get_mutable() const { return const_cast<TensorObj*>(get()); }
 };
 
+/*!
+ * \brief A non-owning view of a Tensor.
+ *
+ * This class stores a light-weight non-owning view of a Tensor.
+ * This is useful for accessing tensor data without retaining a strong 
reference to the Tensor.
+ * Since the caller may not always be able to pass in a strong referenced 
tensor.
+ *
+ * It is the user's responsibility to ensure
+ * that the underlying tensor data outlives the `TensorView`.

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   To be more explicit and prevent potential misuse, it would be beneficial to 
clarify that this responsibility extends to all data pointed to by the 
underlying `DLTensor`. This includes not only the tensor elements in `data` but 
also the memory for `shape` and `strides`.



-- 
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]

Reply via email to