未验证 提交 b76d82ef 编写于 作者: W Wilber 提交者: GitHub

CHERRY_PICK: 2109, 2008, 2098, 2102 (#2111)

cherry pick 2109, 2008, 2098, 2102
上级 7e446198
......@@ -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);
......
......@@ -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 =
......
......@@ -49,6 +49,7 @@ void MemoryOptimizePass::CollectLifeCycleByDevice(
"equal",
"lod_reset",
"concat",
"yolo_box",
"graph_op",
"feed",
"fetch"};
......
......@@ -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();
......@@ -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};
};
......
......@@ -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());
......
......@@ -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:"
......@@ -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=*)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册