Skip to content

Commit

Permalink
CHERRY_PICK: 2109, 2008, 2098, 2102 (#2111)
Browse files Browse the repository at this point in the history
cherry pick 2109, 2008, 2098, 2102
  • Loading branch information
jiweibo authored Sep 21, 2019
1 parent 7e44619 commit b76d82e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions lite/api/model_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void OutputOptModel(const std::string& load_model_dir,
config.set_valid_places({
Place{TARGET(kX86), PRECISION(kFloat)},
Place{TARGET(kARM), PRECISION(kFloat)},
Place{TARGET(kHost), PRECISION(kFloat)},
});
auto predictor = lite_api::CreatePaddlePredictor(config);

Expand Down
6 changes: 4 additions & 2 deletions lite/core/mir/fusion/conv_elementwise_fuser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ void ConvElementwiseFuser::BuildPattern() {
VarNode("input")->assert_is_op_input(conv_type_, "Input")->AsInput();
auto* filter =
VarNode("filter")->assert_is_op_input(conv_type_, "Filter")->AsInput();
auto* bias =
VarNode("bias")->assert_is_op_input("elementwise_add", "Y")->AsInput();
auto* bias = VarNode("bias")
->assert_is_op_input("elementwise_add", "Y")
->AsInput()
->assert_is_persistable_var();

// create op nodes
auto* conv2d =
Expand Down
1 change: 1 addition & 0 deletions lite/core/mir/memory_optimize_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void MemoryOptimizePass::CollectLifeCycleByDevice(
"equal",
"lod_reset",
"concat",
"yolo_box",
"graph_op",
"feed",
"fetch"};
Expand Down
1 change: 1 addition & 0 deletions lite/kernels/arm/norm_compute.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ REGISTER_LITE_KERNEL(
norm, kARM, kFloat, kNCHW, paddle::lite::kernels::arm::NormCompute, def)
.BindInput("X", {LiteType::GetTensorTy(TARGET(kARM))})
.BindOutput("Out", {LiteType::GetTensorTy(TARGET(kARM))})
.BindOutput("Norm", {LiteType::GetTensorTy(TARGET(kARM))})
.Finalize();
1 change: 1 addition & 0 deletions lite/operators/op_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ struct SequenceSoftmaxParam {
struct NormParam {
const lite::Tensor* X{};
lite::Tensor* Out{};
lite::Tensor* Norm{};
int axis{1};
float epsilon{1e-10};
};
Expand Down
2 changes: 1 addition & 1 deletion lite/tests/kernels/norm_compute_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class NormComputeTester : public arena::TestCase {

auto* x = scope->FindTensor(input_);
const auto* x_data = x->data<float>();
int axis = axis_ < 0 ? axis + dims_.size() : axis_;
int axis = axis_ < 0 ? axis_ + dims_.size() : axis_;
int pre_n = dims_.count(0, axis);
int n = dims_[axis];
int post_n = dims_.count(axis + 1, dims_.size());
Expand Down
9 changes: 8 additions & 1 deletion lite/tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function print_usage {
echo -e "argument choices:"
echo -e "--arm_os:\t android|ios|ios64"
echo -e "--arm_abi:\t armv8|armv7"
echo -e "--arm_lang:\t gcc|clang (for android)"
echo -e "--arm_lang:\t only support gcc now, clang will be supported in future.(for android)"
echo -e "--android_stl:\t c++_static|c++_shared (for android)"
echo
echo -e "tasks:"
Expand Down Expand Up @@ -252,6 +252,13 @@ function main {
;;
--arm_lang=*)
ARM_LANG="${i#*=}"
if [ ${ARM_LANG} == "clang" ]; then
set +x
echo
echo -e "error: only support gcc now, clang will be supported in future."
echo
exit 1
fi
shift
;;
--android_stl=*)
Expand Down

0 comments on commit b76d82e

Please sign in to comment.