You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/01/14 00:59:04 UTC

[GitHub] [incubator-tvm] tqchen opened a new pull request #4701: [REFACTOR][IR] Move error.h into ir

tqchen opened a new pull request #4701: [REFACTOR][IR] Move error.h into ir
URL: https://github.com/apache/incubator-tvm/pull/4701
 
 
   We will use a single ErrorReporter to report errors during program transformations.
   
   cc @ZihengJiang @jroesch @zhiics @yzhliu 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4701: [REFACTOR][IR] Move error.h into ir

Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #4701: [REFACTOR][IR] Move error.h into ir
URL: https://github.com/apache/incubator-tvm/pull/4701#discussion_r366118128
 
 

 ##########
 File path: include/tvm/ir/error.h
 ##########
 @@ -18,62 +18,79 @@
  */
 
 /*!
- * \file error.h
- * \brief The set of errors raised by Relay.
+ * \file tvm/ir/error.h
+ * \brief Utilities for error tracking and reporting.
  */
-#ifndef TVM_RELAY_ERROR_H_
-#define TVM_RELAY_ERROR_H_
+#ifndef TVM_IR_ERROR_H_
+#define TVM_IR_ERROR_H_
 
+#include <tvm/ir/span.h>
 #include <tvm/ir/module.h>
 
 #include <string>
 #include <vector>
 #include <sstream>
 #include <unordered_map>
 
-#include "./base.h"
-#include "./expr.h"
-
-
 namespace tvm {
-namespace relay {
-
-#define RELAY_ERROR(msg) (RelayErrorStream() << msg)
-
-// Forward declaratio for RelayErrorStream.
-struct Error;
-
-/*! \brief A wrapper around std::stringstream.
+/*!
+ * \brief A wrapper around std::stringstream to build error.
  *
- * This is designed to avoid platform specific
- * issues compiling and using std::stringstream
- * for error reporting.
+ * Can be consumed by Error to construct an error.
+ *
+ * \code
+ *
+ * void ReportError(const Error& err);
+ *
+ * void Test(int number) {
+ *   // Use error reporter to construct an error.
+ *   ReportError(ErrorBuilder() << "This is an error number=" << number);
 
 Review comment:
   hmm printer usually makes people think of printing to stdout, so I think the builder name might be more precise, as Error can be built from the object

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] zhiics commented on a change in pull request #4701: [REFACTOR][IR] Move error.h into ir

Posted by GitBox <gi...@apache.org>.
zhiics commented on a change in pull request #4701: [REFACTOR][IR] Move error.h into ir
URL: https://github.com/apache/incubator-tvm/pull/4701#discussion_r366109844
 
 

 ##########
 File path: include/tvm/ir/error.h
 ##########
 @@ -18,62 +18,79 @@
  */
 
 /*!
- * \file error.h
- * \brief The set of errors raised by Relay.
+ * \file tvm/ir/error.h
+ * \brief Utilities for error tracking and reporting.
  */
-#ifndef TVM_RELAY_ERROR_H_
-#define TVM_RELAY_ERROR_H_
+#ifndef TVM_IR_ERROR_H_
+#define TVM_IR_ERROR_H_
 
+#include <tvm/ir/span.h>
 #include <tvm/ir/module.h>
 
 #include <string>
 #include <vector>
 #include <sstream>
 #include <unordered_map>
 
-#include "./base.h"
-#include "./expr.h"
-
-
 namespace tvm {
-namespace relay {
-
-#define RELAY_ERROR(msg) (RelayErrorStream() << msg)
-
-// Forward declaratio for RelayErrorStream.
-struct Error;
-
-/*! \brief A wrapper around std::stringstream.
+/*!
+ * \brief A wrapper around std::stringstream to build error.
  *
- * This is designed to avoid platform specific
- * issues compiling and using std::stringstream
- * for error reporting.
+ * Can be consumed by Error to construct an error.
+ *
+ * \code
+ *
+ * void ReportError(const Error& err);
+ *
+ * void Test(int number) {
+ *   // Use error reporter to construct an error.
+ *   ReportError(ErrorBuilder() << "This is an error number=" << number);
 
 Review comment:
   How about ErrorPrinter as this is more like a printer?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] tqchen merged pull request #4701: [REFACTOR][IR] Move error.h into ir

Posted by GitBox <gi...@apache.org>.
tqchen merged pull request #4701: [REFACTOR][IR] Move error.h into ir
URL: https://github.com/apache/incubator-tvm/pull/4701
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4701: [REFACTOR][IR] Move error.h into ir

Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #4701: [REFACTOR][IR] Move error.h into ir
URL: https://github.com/apache/incubator-tvm/pull/4701#discussion_r366118128
 
 

 ##########
 File path: include/tvm/ir/error.h
 ##########
 @@ -18,62 +18,79 @@
  */
 
 /*!
- * \file error.h
- * \brief The set of errors raised by Relay.
+ * \file tvm/ir/error.h
+ * \brief Utilities for error tracking and reporting.
  */
-#ifndef TVM_RELAY_ERROR_H_
-#define TVM_RELAY_ERROR_H_
+#ifndef TVM_IR_ERROR_H_
+#define TVM_IR_ERROR_H_
 
+#include <tvm/ir/span.h>
 #include <tvm/ir/module.h>
 
 #include <string>
 #include <vector>
 #include <sstream>
 #include <unordered_map>
 
-#include "./base.h"
-#include "./expr.h"
-
-
 namespace tvm {
-namespace relay {
-
-#define RELAY_ERROR(msg) (RelayErrorStream() << msg)
-
-// Forward declaratio for RelayErrorStream.
-struct Error;
-
-/*! \brief A wrapper around std::stringstream.
+/*!
+ * \brief A wrapper around std::stringstream to build error.
  *
- * This is designed to avoid platform specific
- * issues compiling and using std::stringstream
- * for error reporting.
+ * Can be consumed by Error to construct an error.
+ *
+ * \code
+ *
+ * void ReportError(const Error& err);
+ *
+ * void Test(int number) {
+ *   // Use error reporter to construct an error.
+ *   ReportError(ErrorBuilder() << "This is an error number=" << number);
 
 Review comment:
   hmm printer usually makes people think of printing to stdout, so I think the builder name might be more precise, as Error can be built from the object.
   
   So in this case I still think ErrorBuilder might be a better name.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4701: [REFACTOR][IR] Move error.h into ir

Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #4701: [REFACTOR][IR] Move error.h into ir
URL: https://github.com/apache/incubator-tvm/pull/4701#discussion_r366118128
 
 

 ##########
 File path: include/tvm/ir/error.h
 ##########
 @@ -18,62 +18,79 @@
  */
 
 /*!
- * \file error.h
- * \brief The set of errors raised by Relay.
+ * \file tvm/ir/error.h
+ * \brief Utilities for error tracking and reporting.
  */
-#ifndef TVM_RELAY_ERROR_H_
-#define TVM_RELAY_ERROR_H_
+#ifndef TVM_IR_ERROR_H_
+#define TVM_IR_ERROR_H_
 
+#include <tvm/ir/span.h>
 #include <tvm/ir/module.h>
 
 #include <string>
 #include <vector>
 #include <sstream>
 #include <unordered_map>
 
-#include "./base.h"
-#include "./expr.h"
-
-
 namespace tvm {
-namespace relay {
-
-#define RELAY_ERROR(msg) (RelayErrorStream() << msg)
-
-// Forward declaratio for RelayErrorStream.
-struct Error;
-
-/*! \brief A wrapper around std::stringstream.
+/*!
+ * \brief A wrapper around std::stringstream to build error.
  *
- * This is designed to avoid platform specific
- * issues compiling and using std::stringstream
- * for error reporting.
+ * Can be consumed by Error to construct an error.
+ *
+ * \code
+ *
+ * void ReportError(const Error& err);
+ *
+ * void Test(int number) {
+ *   // Use error reporter to construct an error.
+ *   ReportError(ErrorBuilder() << "This is an error number=" << number);
 
 Review comment:
   hmm printer usually makes people think of printing to stdout

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] tqchen commented on issue #4701: [REFACTOR][IR] Move error.h into ir

Posted by GitBox <gi...@apache.org>.
tqchen commented on issue #4701: [REFACTOR][IR] Move error.h into ir
URL: https://github.com/apache/incubator-tvm/pull/4701#issuecomment-573991951
 
 
   thanks @zhiics 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] zhiics commented on a change in pull request #4701: [REFACTOR][IR] Move error.h into ir

Posted by GitBox <gi...@apache.org>.
zhiics commented on a change in pull request #4701: [REFACTOR][IR] Move error.h into ir
URL: https://github.com/apache/incubator-tvm/pull/4701#discussion_r366109844
 
 

 ##########
 File path: include/tvm/ir/error.h
 ##########
 @@ -18,62 +18,79 @@
  */
 
 /*!
- * \file error.h
- * \brief The set of errors raised by Relay.
+ * \file tvm/ir/error.h
+ * \brief Utilities for error tracking and reporting.
  */
-#ifndef TVM_RELAY_ERROR_H_
-#define TVM_RELAY_ERROR_H_
+#ifndef TVM_IR_ERROR_H_
+#define TVM_IR_ERROR_H_
 
+#include <tvm/ir/span.h>
 #include <tvm/ir/module.h>
 
 #include <string>
 #include <vector>
 #include <sstream>
 #include <unordered_map>
 
-#include "./base.h"
-#include "./expr.h"
-
-
 namespace tvm {
-namespace relay {
-
-#define RELAY_ERROR(msg) (RelayErrorStream() << msg)
-
-// Forward declaratio for RelayErrorStream.
-struct Error;
-
-/*! \brief A wrapper around std::stringstream.
+/*!
+ * \brief A wrapper around std::stringstream to build error.
  *
- * This is designed to avoid platform specific
- * issues compiling and using std::stringstream
- * for error reporting.
+ * Can be consumed by Error to construct an error.
+ *
+ * \code
+ *
+ * void ReportError(const Error& err);
+ *
+ * void Test(int number) {
+ *   // Use error reporter to construct an error.
+ *   ReportError(ErrorBuilder() << "This is an error number=" << number);
 
 Review comment:
   How about think ErrorPrinter as this is more like a printer?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services