Lunderberg commented on a change in pull request #9727:
URL: https://github.com/apache/tvm/pull/9727#discussion_r779822646
##########
File path: include/tvm/tir/buffer.h
##########
@@ -55,8 +55,48 @@ class BufferNode : public Object {
Var data;
/*! \brief data type in the content of the tensor */
DataType dtype;
- /*! \brief The shape of the buffer */
+ /*! \brief The shape of the buffer
+ *
+ * This contains the shape as it is accessed by
+ * BufferLoad/BufferStore nodes, and used by the low-level code
+ * generators.
+ */
Array<PrimExpr> shape;
+ /*! \brief The shape of the buffer prior to flattening
+ *
+ * This contains the shape as it exists prior to flattening, and is
+ * used for validating the shape of the tensor passed into the
+ * packed API.
+ *
+ * TODO(Lunderberg): Should this be a reference to the entire
Review comment:
I'm fine with it either way, though I think I'd want to have that as a
later change. My one concern is that having the entire pre-flattened Buffer
available could allow post-flattening passes to have access to more information
than is necessary, and information that may be out of date. Storing only the
minimum amount of information required for later use minimizes the amount of
state that must be kept consistent during later passes.
--
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]