junrushao commented on code in PR #15674:
URL: https://github.com/apache/tvm/pull/15674#discussion_r1316532945


##########
include/tvm/runtime/disco/session.h:
##########
@@ -236,7 +248,7 @@ class Session : public ObjectRef {
  public:
   /*! \brief Create a session backed by a thread pool of workers */
   static Session ThreadedSession(int num_workers);
-  TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(Session, ObjectRef, 
SessionObj);
+  TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(Session, ObjectRef, SessionObj);

Review Comment:
   To be clear, it's not-nullable since it's properly created. If you wanted to 
cover the case where Session could be a field of another TVM Object, the common 
paradigm we are using across TVM codebase is to mark it as "initially null":
   
   ```C++
   Session sess{nullptr};
   ```
   
   Note that this pattern is widely used in MetaSchedule already.
   
   There are multiple folds of reasons for using not-nullable, as TVM object 
system will enforce more checking, and also developers of other modules could 
feel very safe to use an object without worrying it's null.



-- 
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: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to