Skip to content

Commit 449bdde

Browse files
committed
Correct some typos.
1 parent 2762959 commit 449bdde

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

cmake/cblas.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ if(NOT CMAKE_CROSSCOMPILING)
7878
/usr/lib/reference/
7979
)
8080
else()
81-
# Diable the finding of reference cblas under host's system path
81+
# Disable the finding of reference cblas under host's system path
8282
set(REFERENCE_CBLAS_INCLUDE_SEARCH_PATHS ${REFERENCE_CBLAS_ROOT}/include)
8383
set(REFERENCE_CBLAS_LIB_SEARCH_PATHS ${REFERENCE_CBLAS_ROOT}/lib)
8484
endif()

paddle/fluid/framework/executor.cc

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ static void CheckTensorNANOrInf(const std::string& name,
8383
if (tensor.memory_size() == 0) {
8484
return;
8585
}
86-
if (tensor.type().hash_code() != typeid(float).hash_code() &&
87-
tensor.type().hash_code() != typeid(double).hash_code()) {
86+
if (tensor.type().hash_code() != typeid(float).hash_code() && // NOLINT
87+
tensor.type().hash_code() != typeid(double).hash_code()) { // NOLINT
8888
return;
8989
}
9090
PADDLE_ENFORCE(!framework::TensorContainsInf(tensor),
@@ -145,12 +145,13 @@ void Executor::Run(const ProgramDesc& pdesc, Scope* scope, int block_id,
145145
// Return true if the block has feed operators and holder of matching info.
146146
static bool has_feed_operators(
147147
const BlockDesc& block,
148-
std::map<std::string, const LoDTensor*>& feed_targets,
148+
const std::map<std::string, const LoDTensor*>& feed_targets,
149149
const std::string& feed_holder_name) {
150150
size_t feed_count = 0;
151151
for (auto* op : block.AllOps()) {
152152
if (op->Type() == kFeedOpType) {
153153
feed_count++;
154+
// The input variable's name of feed_op should be feed_holder_name.
154155
PADDLE_ENFORCE_EQ(op->Input("X")[0], feed_holder_name,
155156
"Input to feed op should be '%s'", feed_holder_name);
156157
std::string feed_target_name = op->Output("Out")[0];
@@ -167,7 +168,7 @@ static bool has_feed_operators(
167168
"The number of feed operators should match 'feed_targets'");
168169

169170
if (!feed_holder_name.empty()) {
170-
// When feed operator are present, so should be feed_holder
171+
// When feed operator are present, so should be feed_holder.
171172
auto var = block.FindVar(feed_holder_name);
172173
PADDLE_ENFORCE_NOT_NULL(var, "Block should already have a '%s' variable",
173174
feed_holder_name);
@@ -187,12 +188,14 @@ static bool has_feed_operators(
187188
// and fetch_holder_name. Raise exception when any mismatch is found.
188189
// Return true if the block has fetch operators and holder of matching info.
189190
static bool has_fetch_operators(
190-
const BlockDesc& block, std::map<std::string, LoDTensor*>& fetch_targets,
191+
const BlockDesc& block,
192+
const std::map<std::string, LoDTensor*>& fetch_targets,
191193
const std::string& fetch_holder_name) {
192194
size_t fetch_count = 0;
193195
for (auto* op : block.AllOps()) {
194196
if (op->Type() == kFetchOpType) {
195197
fetch_count++;
198+
// The output variable's name of fetch_op should be fetch_holder_name.
196199
PADDLE_ENFORCE_EQ(op->Output("Out")[0], fetch_holder_name,
197200
"Output of fetch op should be '%s'", fetch_holder_name);
198201
std::string fetch_target_name = op->Input("X")[0];
@@ -209,7 +212,7 @@ static bool has_fetch_operators(
209212
"The number of fetch operators should match 'fetch_targets'");
210213

211214
if (!fetch_holder_name.empty()) {
212-
// When fetch operator are present, so should be fetch_holder
215+
// When fetch operator are present, so should be fetch_holder.
213216
auto var = block.FindVar(fetch_holder_name);
214217
PADDLE_ENFORCE_NOT_NULL(var, "Block should already have a '%s' variable",
215218
fetch_holder_name);
@@ -287,8 +290,8 @@ void Executor::Run(const ProgramDesc& program, Scope* scope,
287290
}
288291

289292
auto ctx = Prepare(*copy_program, 0);
290-
RunPreparedContext(ctx.get(), scope, feed_targets, fetch_targets,
291-
feed_holder_name, fetch_holder_name, create_vars);
293+
RunPreparedContext(ctx.get(), scope, feed_targets, fetch_targets, create_vars,
294+
feed_holder_name, fetch_holder_name);
292295
}
293296

294297
std::unique_ptr<ExecutorPrepareContext> Executor::Prepare(

paddle/fluid/framework/executor.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ limitations under the License. */
1414

1515
#pragma once
1616

17+
#include <map>
18+
#include <string>
19+
#include <vector>
1720
#include "paddle/fluid/framework/op_info.h"
1821
#include "paddle/fluid/framework/program_desc.h"
1922
#include "paddle/fluid/framework/scope.h"

paddle/fluid/inference/io.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ limitations under the License. */
2323
namespace paddle {
2424
namespace inference {
2525

26-
// Temporarilly add this function for exposing framework::InitDevices() when
26+
// Temporarily add this function for exposing framework::InitDevices() when
2727
// linking the inference shared library.
2828
void Init(bool init_p2p) { framework::InitDevices(init_p2p); }
2929

paddle/fluid/inference/tests/test_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ void TestInference(const std::string& dirname,
195195
paddle::platform::DeviceContextPool::Instance().Get(place));
196196

197197
if (PrepareContext) {
198-
// Note: if you changed the inference_program, you need to call
198+
// Note: if you change the inference_program, you need to call
199199
// executor.Prepare() again to get a new ExecutorPrepareContext.
200200
executor.RunPreparedContext(ctx.get(), scope, feed_targets,
201201
fetch_targets, CreateVars);

0 commit comments

Comments
 (0)