tqchen commented on a change in pull request #4765: [tir] make IterVar extends 
Var
URL: https://github.com/apache/incubator-tvm/pull/4765#discussion_r369356042
 
 

 ##########
 File path: include/tvm/tir/expr.h
 ##########
 @@ -236,21 +228,33 @@ enum IterVarType : int {
  * \brief Iteration Variable,
  *  represents an iteration over an integer interval.
  */
-class IterVar : public ObjectRef {
+class IterVar : public Var {
  public:
   // construct a new iter var without a domain
   IterVar() {}
   // construct from shared ptr.
-  explicit IterVar(ObjectPtr<Object> n) : ObjectRef(n) {}
+  explicit IterVar(ObjectPtr<Object> n) : Var(n) {}
+  /*! \brief constructor.
+   * \param dom interval of the variable.
+   * \param iter_type indicate the iteration type of the variable.
+   * \param name_hint variable name
+   * \param t data type
+   * \param thread_tag additional tag on the iteration variable.
+   */
+  TVM_DLL IterVar(Range dom, IterVarType iter_type,
+                  std::string name_hint = "v",
+                  DataType t = DataType::Int(32),
+                  std::string thread_tag = "");
   /*!
    * \brief access the internal node container
    * \return the pointer to the internal node container
    */
   inline const IterVarNode* operator->() const;
 
 Review comment:
   We can likely use TVM_DEFINE_OBJECT_REF_METHODS to define these methods

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

Reply via email to