We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ed6e85 commit 0af4992Copy full SHA for 0af4992
1 file changed
backends/xnnpack/runtime/XNNCompiler.cpp
@@ -1916,9 +1916,17 @@ ET_NODISCARD Error XNNCompiler::compileModel(
1916
xnn_status_to_string(status));
1917
1918
// create xnnpack subgraph
1919
+ uint32_t num_externs = flatbuffer_graph->num_externs();
1920
+ ET_CHECK_OR_RETURN_ERROR(
1921
+ num_externs <= 4096,
1922
+ InvalidProgram,
1923
+ "XNNPACK flatbuffer blob has num_externs (%u) which exceeds maximum (4096)."
1924
+ " This likely indicates a corrupted or invalid serialized graph",
1925
+ num_externs);
1926
+
1927
xnn_subgraph_t subgraph_ptr = nullptr;
1928
status = xnn_create_subgraph(
- /*external_value_ids=*/flatbuffer_graph->num_externs(),
1929
+ /*external_value_ids=*/num_externs,
1930
/*flags=*/0,
1931
&subgraph_ptr);
1932
ET_CHECK_OR_RETURN_ERROR(
0 commit comments