tqchen commented on a change in pull request #4684: [Arith] add ShapeVar
representing non-neg valued variable in a tensor shape
URL: https://github.com/apache/incubator-tvm/pull/4684#discussion_r366473075
##########
File path: include/tvm/expr.h
##########
@@ -115,6 +117,45 @@ class Var : public PrimExpr {
using ContainerType = VarNode;
};
+class ShapeVar;
+/*!
+ * \brief A variable node represent a tensor shape size,
+ * whose value must be non-negative.
+ */
+class ShapeVarNode : public VarNode {
+ public:
+ /*! \brief constructor */
+ ShapeVarNode() {}
+ ShapeVarNode(DataType dtype, std::string name_hint);
+
+ static constexpr const char* _type_key = "ShapeVar";
+ TVM_DECLARE_FINAL_OBJECT_INFO(ShapeVarNode, VarNode);
+};
+
+/*! \brief a named variable represents a tensor shape size */
+class ShapeVar : public Var {
+ public:
+ explicit ShapeVar(ObjectPtr<Object> n) : Var(n) {}
+ TVM_DLL explicit ShapeVar(std::string name_hint = "s",
Review comment:
Document the constructor
----------------------------------------------------------------
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