diff --git a/lite/kernels/npu/subgraph_compute.cc b/lite/kernels/npu/subgraph_compute.cc index 101cd65e8b9c34e705f8619c4457317a1d943207..a18d5314fd17156f2761714b8bd12928f561c21a 100644 --- a/lite/kernels/npu/subgraph_compute.cc +++ b/lite/kernels/npu/subgraph_compute.cc @@ -120,7 +120,9 @@ int SubgraphEngine::BuildDeviceProgram() { return subgraph::FAILED; } auto device_program = std::make_shared(device_client); - device_program_map_[inputs_shape_] = device_program; + if (!inputs_shape_.empty()) { + device_program_map_[inputs_shape_] = device_program; + } // Query and check the dimensions of valid input and output tensors std::vector device_idims, device_odims;