This is an automated email from the ASF dual-hosted git repository.

andrewzhaoluo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 93969db  [FIX,AUTOTVM] Fix printing of measure results (#10647)
93969db is described below

commit 93969dbebc1b528f890e4ab23c7cef8e10a1e620
Author: Tristan Konolige <[email protected]>
AuthorDate: Wed Mar 23 21:23:08 2022 -0700

    [FIX,AUTOTVM] Fix printing of measure results (#10647)
    
    * [FIX,AUTOTVM] Fix printing of measure results
    
    The check for if the error_no was valid was wrong.
    
    * switch logic
---
 python/tvm/autotvm/measure/measure.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/python/tvm/autotvm/measure/measure.py 
b/python/tvm/autotvm/measure/measure.py
index ea7de35..c9b82cd 100644
--- a/python/tvm/autotvm/measure/measure.py
+++ b/python/tvm/autotvm/measure/measure.py
@@ -55,9 +55,9 @@ class MeasureResult(namedtuple("MeasureResult", ["costs", 
"error_no", "all_cost"
 
     def __repr__(self):
         error_no_str = (
-            str(self.error_no)
-            if self.error_no not in MeasureErrorNo
-            else str(MeasureErrorNo(self.error_no))
+            str(MeasureErrorNo(self.error_no))
+            if isinstance(self.error_no, (MeasureErrorNo, int))
+            else str(self.error_no)
         )
         return (
             f"{self.__class__.__name__}(costs={self.costs!r}, 
error_no={error_no_str}, "

Reply via email to