Skip to content

Commit

Permalink
[checkpoint] lints
Browse files Browse the repository at this point in the history
  • Loading branch information
mbs-octoml committed Sep 20, 2021
1 parent 80a1af8 commit 1bffecd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
9 changes: 5 additions & 4 deletions include/tvm/relay/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,12 @@ class Call : public Expr {
Array<Type> type_args = Array<Type>(), Span span = Span());

/*!
* \brief Returns a copy of this with given properties. A null property denotes 'no change'. Returns
* this if all properties are unchanged. Returns a modified this if this is the only reference
* to the underlying node.
* \brief Returns a copy of this with given properties. A null property denotes 'no change'.
* Returns this if all properties are unchanged. Returns a modified this if this is the only
* reference to the underlying node.
*
* TODO(mbs): Extend to all node types.
*/
// TODO(mbs): Extend to all node types.
Call CopyWith(Optional<Expr> opt_op = Optional<Expr>(),
Optional<Array<Expr>> opt_args = Optional<Array<Expr>>(nullptr),
Optional<Attrs> opt_attrs = Optional<Attrs>(nullptr),
Expand Down
23 changes: 11 additions & 12 deletions src/relay/backend/graph_executor_codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,18 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
mod = WithAttr(mod, "main_func_info", func_info);
}

IRModule lowered_mod =
tec::LowerTEPass(targets_, mod_name_, [this](Function func) {
// We need to maintain the constant map for external
// functions so we pass this processing function which
// allows us to process each function as we lower it.
if (func->GetAttr<String>(attr::kCompiler).defined()) {
UpdateConstants(func, &params_);
}
IRModule lowered_mod = tec::LowerTEPass(targets_, mod_name_, [this](Function func) {
// We need to maintain the constant map for external
// functions so we pass this processing function which
// allows us to process each function as we lower it.
if (func->GetAttr<String>(attr::kCompiler).defined()) {
UpdateConstants(func, &params_);
}

// TODO(@areusch, @jroesch): We should refactor this to
// execute as a further pass, instead writing data to the
// lowering process directly.
tec::UpdateFunctionMetadata(func, this->function_metadata_);
// TODO(@areusch, @jroesch): We should refactor this to
// execute as a further pass, instead writing data to the
// lowering process directly.
tec::UpdateFunctionMetadata(func, this->function_metadata_);
})(mod);

Optional<backend::FunctionInfo> main_func_info =
Expand Down
3 changes: 1 addition & 2 deletions src/relay/backend/interpreter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,7 @@ class Interpreter : public ExprFunctor<ObjectRef(const Expr& n)>,
const Array<GlobalVar>& all_prim_shape_fn_vars,
const Array<Integer>& prim_shape_fn_states,
size_t num_shape_inputs, size_t num_shape_outputs,
Target prim_shape_target,
const std::vector<ObjectRef>& args) {
Target prim_shape_target, const std::vector<ObjectRef>& args) {
ICHECK(prim_shape_fn_var.defined());
ICHECK(prim_shape_fn_states.defined());
ICHECK(prim_shape_fn_var->checked_type().defined());
Expand Down
3 changes: 1 addition & 2 deletions src/relay/ir/dataflow_matcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,7 @@ void PatternGrouper::CreateGroup(const Expr& expr) {
auto node = matcher_->expr_graph_[kv.first];
for (auto* output : node->outputs_) {
// and the node is used by nodes outside of the group
if (memo.count(output->ref_) == 0 &&
!matcher_->expr_graph_[expr]->Dominates(output)) {
if (memo.count(output->ref_) == 0 && !matcher_->expr_graph_[expr]->Dominates(output)) {
// Exit because nodes in this pattern's body are used outside the pattern
// fusing it would be invalid
return;
Expand Down
2 changes: 1 addition & 1 deletion src/relay/transforms/memory_alloc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bool IsReshapeOnly(const Expr& expr) {

class DialectRewriter : public transform::DeviceAwareExprMutator {
public:
DialectRewriter(const Target& target_host) : target_host_(target_host) {}
explicit DialectRewriter(const Target& target_host) : target_host_(target_host) {}

Function Rewrite(const Function& expr) { return Downcast<Function>(Mutate(expr)); }

Expand Down

0 comments on commit 1bffecd

Please sign in to comment.