From 92f5be1d82b1d6994ad18ac09f3e926bd1b631c4 Mon Sep 17 00:00:00 2001 From: phlrain Date: Thu, 29 Nov 2018 19:04:38 +0800 Subject: [PATCH] remove inputvarname in operator; test=develop --- paddle/fluid/framework/operator.h | 8 -------- paddle/fluid/operators/cudnn_lstm_op.cu.cc | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/paddle/fluid/framework/operator.h b/paddle/fluid/framework/operator.h index 7289a451e..5bd68f9ac 100644 --- a/paddle/fluid/framework/operator.h +++ b/paddle/fluid/framework/operator.h @@ -174,14 +174,6 @@ class ExecutionContext { return op_.Inputs(name).size(); } - const std::string InputVarName(const std::string& name) const { - return op_.Input(name); - } - - const std::string OutputVarName(const std::string& name) const { - return op_.Output(name); - } - size_t OutputSize(const std::string& name) const { return op_.Outputs(name).size(); } diff --git a/paddle/fluid/operators/cudnn_lstm_op.cu.cc b/paddle/fluid/operators/cudnn_lstm_op.cu.cc index cadd3772a..811975a9f 100644 --- a/paddle/fluid/operators/cudnn_lstm_op.cu.cc +++ b/paddle/fluid/operators/cudnn_lstm_op.cu.cc @@ -292,7 +292,7 @@ class CudnnLSTMGPUKernel : public framework::OpKernel { // multi-devices before the first running. // use parent scope to make cache persistable auto *scope = const_cast(ctx.scope().parent()); - auto cache_var_name = ctx.InputVarName("Cache"); + auto cache_var_name = ctx.Inputs("Cache")[0]; cache_var = scope->Var(cache_var_name); } CudnnRNNCache *cudnn_rnn_cache = nullptr; -- GitLab