Skip to content

Commit 76bd715

Browse files
committed
[Analysis] add "" tensor exception in all_tensors_f32
1 parent ac15c7d commit 76bd715

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/qonnx/analysis/topology.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ def all_tensors_f32(model):
5656
annotations notwithstanding.
5757
5858
Returns {"all_tensors_f32": Bool}."""
59-
all_tensors = model.make_empty_exec_context().items()
59+
exec_ctx = model.make_empty_exec_context()
60+
# remove the special empty string entry in the context since it has no tensor
61+
exec_ctx.pop("")
62+
all_tensors = exec_ctx.items()
6063
non_f32_tensors = filter(lambda x: x[1].dtype != np.float32, all_tensors)
6164
return {"all_tensors_f32": len(list(non_f32_tensors)) == 0}
6265

0 commit comments

Comments
 (0)