提交 c08a642d 编写于 作者: Z zhupengyang 提交者: GitHub

[NPU] fix InferShape in subgraph_compute (#3306)

上级 f80b25ac
...@@ -35,7 +35,7 @@ int SubgraphEngine::BuildDeviceProgram() { ...@@ -35,7 +35,7 @@ int SubgraphEngine::BuildDeviceProgram() {
subgraph::npu::Graph graph; subgraph::npu::Graph graph;
const auto& bridges = subgraph::Registry::Instance(); const auto& bridges = subgraph::Registry::Instance();
for (auto& inst : origin_program_) { for (auto& inst : origin_program_) {
auto op = inst.op(); auto op = const_cast<OpLite*>(inst.op());
CHECK(op); CHECK(op);
op->CheckShape(); op->CheckShape();
op->InferShape(); op->InferShape();
...@@ -44,10 +44,8 @@ int SubgraphEngine::BuildDeviceProgram() { ...@@ -44,10 +44,8 @@ int SubgraphEngine::BuildDeviceProgram() {
return subgraph::FAILED; return subgraph::FAILED;
} }
auto kernel = inst.kernel(); auto kernel = inst.kernel();
status |= status |= bridges.Select(op_type, TARGET(kNPU))(
bridges.Select(op_type, TARGET(kNPU))(reinterpret_cast<void*>(&graph), reinterpret_cast<void*>(&graph), op, const_cast<KernelBase*>(kernel));
const_cast<OpLite*>(op),
const_cast<KernelBase*>(kernel));
if (subgraph::CHECK_FAILED(status)) { if (subgraph::CHECK_FAILED(status)) {
return subgraph::FAILED; return subgraph::FAILED;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册