diff --git a/cmake/external/mkldnn.cmake b/cmake/external/mkldnn.cmake index aef5311a12c3ee1bdc8aaa8c2bcead113d6535c2..a25cff5fc567f22d4573625487f31bd4192bb172 100644 --- a/cmake/external/mkldnn.cmake +++ b/cmake/external/mkldnn.cmake @@ -56,6 +56,7 @@ ExternalProject_Add( PREFIX ${MKLDNN_SOURCES_DIR} UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL_DIR} + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} CMAKE_ARGS -DMKLROOT=${MKLML_ROOT} CMAKE_ARGS -DCMAKE_C_FLAGS=${MKLDNN_CFLAG} CMAKE_ARGS -DCMAKE_CXX_FLAGS=${MKLDNN_CXXFLAG} diff --git a/paddle/fluid/framework/tensor.h b/paddle/fluid/framework/tensor.h index f95af384eb06864f3f30b9d4e3ee6a3cb615fd50..6f878541e6de1deec1829145b1b325ecd176a034 100644 --- a/paddle/fluid/framework/tensor.h +++ b/paddle/fluid/framework/tensor.h @@ -130,8 +130,6 @@ class Tensor { inline void set_layout(const DataLayout layout) { layout_ = layout; } private: - friend class LoDTensor; - /** * @note Placeholder hides type T, so it doesn't appear as a template * parameter of Variable. diff --git a/paddle/fluid/operators/detection_map_op.h b/paddle/fluid/operators/detection_map_op.h index 39d17a7cb3ffd35626d7e3aacbaeabe67c372838..92e05108393f9c8fa9259d16d2dd4c6685f2c1e2 100644 --- a/paddle/fluid/operators/detection_map_op.h +++ b/paddle/fluid/operators/detection_map_op.h @@ -151,7 +151,7 @@ class DetectionMAPOpKernel : public framework::OpKernel { for (int n = 0; n < batch_size; ++n) { std::map> boxes; - for (int i = label_index[n]; i < label_index[n + 1]; ++i) { + for (size_t i = label_index[n]; i < label_index[n + 1]; ++i) { Box box(labels(i, 2), labels(i, 3), labels(i, 4), labels(i, 5)); int label = labels(i, 0); auto is_difficult = labels(i, 1); @@ -167,7 +167,7 @@ class DetectionMAPOpKernel : public framework::OpKernel { auto detect_index = detect_lod[0]; for (int n = 0; n < batch_size; ++n) { std::map>> boxes; - for (int i = detect_index[n]; i < detect_index[n + 1]; ++i) { + for (size_t i = detect_index[n]; i < detect_index[n + 1]; ++i) { Box box(detect(i, 2), detect(i, 3), detect(i, 4), detect(i, 5)); int label = detect(i, 0); auto score = detect(i, 1); @@ -269,8 +269,8 @@ class DetectionMAPOpKernel : public framework::OpKernel { std::map>>& pos) { const T* pos_data = pos_tensor.data(); auto pos_data_lod = pos_tensor.lod(); - for (int i = 0; i < pos_data_lod.size(); ++i) { - for (int j = pos_data_lod[0][i]; j < pos_data_lod[0][i + 1]; ++j) { + for (size_t i = 0; i < pos_data_lod.size(); ++i) { + for (size_t j = pos_data_lod[0][i]; j < pos_data_lod[0][i + 1]; ++j) { T score = pos_data[j * 2]; int flag = 1; if (pos_data[j * 2 + 1] < kEPS) flag = 0; diff --git a/python/paddle/v2/fluid/data_feeder.py b/python/paddle/v2/fluid/data_feeder.py index f9e2f3e6a28c488dea0f98f37e908d0757967df1..070bcadd7106a5a1a3eafd7625220e2abf444b55 100644 --- a/python/paddle/v2/fluid/data_feeder.py +++ b/python/paddle/v2/fluid/data_feeder.py @@ -107,6 +107,9 @@ class DataFeeder(object): dtype=dtype)) for each_sample in iterable: + assert len(each_sample) == len(converter), ( + "The number of fields in data (%s) does not match " + + "len(feed_list) (%s)") % (len(each_sample), len(converter)) for each_converter, each_slot in six.zip(converter, each_sample): each_converter.feed(each_slot) ret_dict = {}