提交 9bae4c5a 编写于 作者: Y yanghongtian

update act_op namespace

上级 d6965c1b
...@@ -93,14 +93,6 @@ int ActConverter<ge::op::Activation>(void* ctx, ...@@ -93,14 +93,6 @@ int ActConverter<ge::op::Activation>(void* ctx,
} else if (op_type == "relu6") { } else if (op_type == "relu6") {
float Relu_clipped_coef = 6.f; float Relu_clipped_coef = 6.f;
act_op->set_attr_coef(Relu_clipped_coef); act_op->set_attr_coef(Relu_clipped_coef);
} else if (op_type == "leaky_relu") {
auto alpha = op_info->GetAttr<float>("alpha");
act_op->set_attr_negative_slope(alpha);
} else if (op_type == "hard_sigmoid") {
auto slope = op_info->GetAttr<float>("slope");
auto offset = op_info->GetAttr<float>("offset");
act_op->set_attr_negative_slope(slope);
act_op->set_attr_coef(offset);
} }
return SUCCESS; return SUCCESS;
} }
...@@ -113,53 +105,53 @@ int ActConverter<ge::op::Activation>(void* ctx, ...@@ -113,53 +105,53 @@ int ActConverter<ge::op::Activation>(void* ctx,
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
sigmoid, sigmoid,
kHWAscendNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Activation>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Activation>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
relu, relu,
kHWAscendNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Activation>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Activation>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
tanh, tanh,
kHWAscendNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Activation>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Activation>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
relu_clipped, relu_clipped,
kNPU, kNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Activation>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Activation>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
relu6, relu6,
kHWAscendNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Activation>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Activation>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
leaky_relu, leaky_relu,
kHWAscendNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Activation>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Activation>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
abs, abs,
kHWAscendNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Activation>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Activation>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
softsign, softsign,
kNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Activation>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Activation>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
softplus, softplus,
kHWAscendNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Activation>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Activation>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
hard_sigmoid, hard_sigmoid,
kHWAscendNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Activation>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Activation>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
log, log,
kHWAscendNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Log>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Log>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
square, square,
kHWAscendNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Square>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Square>);
REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE(
sqrt, sqrt,
kHWAscendNPU, kHWAscendNPU,
paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::Sqrt>); paddle::lite::subgraph::hw_ascend_npu::ActConverter<ge::op::Sqrt>);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册