提交 0328da9c 编写于 作者: Y Yan Chunwei 提交者: tensor-tang

fix lite compile (#17858)

* fix lite compile

test=develop

* update

test=develop
上级 ff1c6447
...@@ -39,6 +39,7 @@ class DDimHvy : public DDimBase<DDimHvy> { ...@@ -39,6 +39,7 @@ class DDimHvy : public DDimBase<DDimHvy> {
} }
value_type operator[](int offset) const { return data_[offset]; } value_type operator[](int offset) const { return data_[offset]; }
value_type& operator[](int offset) { return data_[offset]; }
std::vector<int64_t> Vectorize() const { return framework::vectorize(data_); } std::vector<int64_t> Vectorize() const { return framework::vectorize(data_); }
......
...@@ -37,6 +37,7 @@ class DDimLite : public DDimBase<DDimLite> { ...@@ -37,6 +37,7 @@ class DDimLite : public DDimBase<DDimLite> {
void ConstructFrom(const std::vector<value_type> &x) { data_ = x; } void ConstructFrom(const std::vector<value_type> &x) { data_ = x; }
value_type operator[](int offset) const { return data_[offset]; } value_type operator[](int offset) const { return data_[offset]; }
value_type &operator[](int offset) { return data_[offset]; }
std::vector<int64_t> Vectorize() const { return data_; } std::vector<int64_t> Vectorize() const { return data_; }
size_t size() const { return data_.size(); } size_t size() const { return data_.size(); }
......
...@@ -23,7 +23,7 @@ if (LITE_WITH_CUDA) ...@@ -23,7 +23,7 @@ if (LITE_WITH_CUDA)
endif() endif()
cc_library(model_parser_lite SRCS model_parser.cc DEPS ${model_parser_deps}) cc_library(model_parser_lite SRCS model_parser.cc DEPS ${model_parser_deps})
cc_test(test_op_desc_lite SRCS op_desc_test.cc DEPS cpp_op_desc_lite any_lite op_desc_lite compatible_pb_lite) lite_cc_test(test_op_desc_lite SRCS op_desc_test.cc DEPS cpp_op_desc_lite op_desc_lite compatible_pb_lite)
add_subdirectory(pb) add_subdirectory(pb)
add_subdirectory(cpp) add_subdirectory(cpp)
cc_library(var_desc_lite SRCS var_desc.cc DEPS framework_proto_lite) cc_library(var_desc_lite SRCS var_desc.cc DEPS framework_proto_lite)
cc_library(op_desc_lite SRCS op_desc.cc DEPS framework_proto_lite) cc_library(op_desc_lite SRCS op_desc.cc DEPS framework_proto_lite)
...@@ -27,9 +27,9 @@ bool ConcatOpLite::CheckShape() const { ...@@ -27,9 +27,9 @@ bool ConcatOpLite::CheckShape() const {
} }
bool ConcatOpLite::InferShape() const { bool ConcatOpLite::InferShape() const {
std::vector<framework::DDim> input_dims; std::vector<lite::DDim> input_dims;
for (auto p : param_.x) { for (auto p : param_.x) {
input_dims.push_back(p->dims().data()); input_dims.push_back(p->dims());
} }
size_t axis = static_cast<size_t>(param_.axis); size_t axis = static_cast<size_t>(param_.axis);
const size_t n = input_dims.size(); const size_t n = input_dims.size();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册