未验证 提交 55ecd6d2 编写于 作者: T tensor-tang 提交者: GitHub

Merge pull request #5797 from luotao1/fix_warning

fix some warning with MKLDNN related codes and etc
...@@ -36,7 +36,7 @@ class MKLDNNLayer : public Layer { ...@@ -36,7 +36,7 @@ class MKLDNNLayer : public Layer {
protected: protected:
// batch size // batch size
int bs_; int bs_;
// they sizes are always from the first input layer // their sizes are always from the first input layer
// input image channel, height and width // input image channel, height and width
int ic_, ih_, iw_; int ic_, ih_, iw_;
// output image channel, height and width // output image channel, height and width
......
...@@ -315,7 +315,7 @@ TEST(MKLDNNLayer, AddtoLayer) { ...@@ -315,7 +315,7 @@ TEST(MKLDNNLayer, AddtoLayer) {
static void getMKLDNNConcatConfig(TestConfig& cfg, static void getMKLDNNConcatConfig(TestConfig& cfg,
const std::vector<testImageDesc>& inputs) { const std::vector<testImageDesc>& inputs) {
CHECK_GE(inputs.size(), 2) << "at least two inputs"; CHECK_GE(inputs.size(), 2UL) << "at least two inputs";
int oc = inputs[0].ic; int oc = inputs[0].ic;
for (size_t i = 1; i < inputs.size(); ++i) { for (size_t i = 1; i < inputs.size(); ++i) {
CHECK_EQ(inputs[i].bs, inputs[0].bs); CHECK_EQ(inputs[i].bs, inputs[0].bs);
......
...@@ -139,7 +139,7 @@ bool BeamSearch::NextItemSet(std::vector<BeamSearch::Item> *items) { ...@@ -139,7 +139,7 @@ bool BeamSearch::NextItemSet(std::vector<BeamSearch::Item> *items) {
items->reserve(framework::product(ids.dims())); items->reserve(framework::product(ids.dims()));
for (size_t offset = abs_lod[lod_level_][sent_offset_]; for (size_t offset = abs_lod[lod_level_][sent_offset_];
offset < abs_lod[lod_level_][sent_offset_ + 1]; offset++) { offset < abs_lod[lod_level_][sent_offset_ + 1]; offset++) {
for (int d = 0; d < instance_dim; d++) { for (size_t d = 0; d < instance_dim; d++) {
const size_t dim_offset = offset * instance_dim + d; const size_t dim_offset = offset * instance_dim + d;
items->emplace_back(offset, ids_data[dim_offset], items->emplace_back(offset, ids_data[dim_offset],
scores_data[dim_offset]); scores_data[dim_offset]);
......
...@@ -138,7 +138,7 @@ void Trainer::init(const std::shared_ptr<TrainerConfigHelper>& config, ...@@ -138,7 +138,7 @@ void Trainer::init(const std::shared_ptr<TrainerConfigHelper>& config,
} }
if (FLAGS_use_mkldnn) { if (FLAGS_use_mkldnn) {
CHECK_EQ(FLAGS_trainer_count, 1UL) << "MKLDNN only need 1 trainer"; CHECK_EQ(FLAGS_trainer_count, 1) << "MKLDNN only need 1 trainer";
} }
if (testing) { if (testing) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册