From fff05bdff257752223e816bacb3dd1845afd27e7 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Mon, 24 Aug 2020 12:29:02 +0000 Subject: [PATCH] save --- src/relay/transforms/gradient.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/relay/transforms/gradient.cc b/src/relay/transforms/gradient.cc index b31a1c57a761..7894c34de55d 100644 --- a/src/relay/transforms/gradient.cc +++ b/src/relay/transforms/gradient.cc @@ -357,7 +357,7 @@ Expr LiftTensor(const std::function& f, if (forward_type.as()) { auto ret = ll->Push(f(e)); ret->checked_type_ = tf(forward_type); - return ret; + return std::move(ret); } else if (auto* tt = forward_type.as()) { tvm::Array fields; tvm::Array types; @@ -368,7 +368,7 @@ Expr LiftTensor(const std::function& f, } auto ret = ll->Push(Tuple(fields)); ret->checked_type_ = TupleType(types); - return ret; + return std::move(ret); } else { LOG(FATAL) << "unsupported input/output type: " << tt; throw; @@ -459,7 +459,7 @@ struct ReverseAD : ExprMutator { // memoize Var -> ADVar so we don't end up with free Vars when checkpointing auto var_ref = GetRef(var); if (ad_vars->count(var_ref) == 0) { - return var_ref; + return std::move(var_ref); } else { return GetValue(var_ref->checked_type(), ad_vars->at(var_ref), ll); } @@ -648,7 +648,7 @@ Expr Gradient(const Expr& re, const Optional& mod) { }); auto ret = Function(f->params, body, GradRetType(GetRef(f)), {}); CheckFeature(ret, FeatureSet::All() - fGraph); - return ret; + return std::move(ret); } TVM_REGISTER_GLOBAL("relay._transform.gradient").set_body_typed(Gradient);