From 0867f3e1edfd1bbeb3c3a4697b472bd7eb39e413 Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Tue, 16 Jul 2019 15:15:19 -0700 Subject: [PATCH 1/2] Fix build error --- include/tvm/build_module.h | 2 +- src/relay/ir/doc.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/tvm/build_module.h b/include/tvm/build_module.h index 187a74552241..1d57d82e66c6 100644 --- a/include/tvm/build_module.h +++ b/include/tvm/build_module.h @@ -457,7 +457,7 @@ inline runtime::TVMRetValue GenericFunc::operator()(Args&& ...args) const { runtime::detail::for_each(runtime::TVMArgsSetter(values, type_codes), std::forward(args)...); runtime::TVMRetValue rv; - CallPacked(TVMArgs(values, type_codes, kNumArgs), &rv); + CallPacked(runtime::TVMArgs(values, type_codes, kNumArgs), &rv); return rv; } diff --git a/src/relay/ir/doc.cc b/src/relay/ir/doc.cc index f786ed7def6f..1c9aa6c4c333 100644 --- a/src/relay/ir/doc.cc +++ b/src/relay/ir/doc.cc @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,6 +23,7 @@ * \brief Doc ADT used for pretty printing. * Based on Section 1 of https://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf. */ +#include #include #include #include "doc.h" From d1d7194ff55482d7788f07e741d4d825781c590a Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Tue, 16 Jul 2019 19:40:01 -0700 Subject: [PATCH 2/2] comments --- src/relay/ir/doc.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/relay/ir/doc.cc b/src/relay/ir/doc.cc index 1c9aa6c4c333..bdd22237e588 100644 --- a/src/relay/ir/doc.cc +++ b/src/relay/ir/doc.cc @@ -23,7 +23,6 @@ * \brief Doc ADT used for pretty printing. * Based on Section 1 of https://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf. */ -#include #include #include #include "doc.h" @@ -52,7 +51,7 @@ Doc::Doc(const std::string& str) { // DSL function implementations Doc& Doc::operator<<(const Doc& right) { - assert(this != &right); + CHECK(this != &right); this->stream_.insert(this->stream_.end(), right.stream_.begin(), right.stream_.end()); return *this; } @@ -73,7 +72,7 @@ Doc Indent(int indent, const Doc& doc) { ret.stream_.push_back(text); } else if (auto line = std::dynamic_pointer_cast(atom)) { ret.stream_.push_back(Line(indent + line->indent)); - } else {assert(false);} + } else {CHECK(false);} } return ret; } @@ -85,7 +84,7 @@ std::string Doc::str() { os << text->str; } else if (auto line = std::dynamic_pointer_cast(atom)) { os << "\n" << std::string(line->indent, ' '); - } else {assert(false);} + } else {CHECK(false);} } return os.str(); }