Skip to content
Snippets Groups Projects
Commit 0e719db5 authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Allow operator name with multiple underscores

parent 4e810910
No related branches found
No related tags found
No related merge requests found
......@@ -309,8 +309,15 @@ class HPVMConfigBuilder:
def _parse_ops(ops: List[str]) -> List[str]:
types: List[str] = [None for _ in range(len(ops))]
for k in ops:
ty, idx = k.split("_")
types[int(idx)] = ty
try:
ty, idx_s = k.rsplit("_", 1)
idx = int(idx_s)
except ValueError as e:
raise ValueError(
f"Operator name {k} not understood. Original parsing error:\n"
f"{e}"
)
types[idx] = ty
if any(x is None for x in types):
raise ValueError("Operator indice not consecutive")
return types
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment