improve error message and docstring for relay type/shape parsers #498
GitHub Actions / Black
failed
Jan 25, 2024 in 0s
1 error
Black found 1 error
Annotations
github-actions / Black
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/flow/tvm/backend/model_info.py#L177-L189
out_tensors = None
for line in mod_text.split("\n"):
if "def @main(" in line:
in_tensors, out_tensors = parse_relay_main(line)
break
- assert in_tensors is not None and len(in_tensors) > 0, "RelayModelInfo: input_tensors not found (Add TypeInfer details or provided types/shapes manually)"
- assert out_tensors is not None and len(out_tensors) > 0, "RelayModelInfo: output tensors not found (Add TypeInfer details or provide types/shapes manually)"
+ assert (
+ in_tensors is not None and len(in_tensors) > 0
+ ), "RelayModelInfo: input_tensors not found (Add TypeInfer details or provided types/shapes manually)"
+ assert (
+ out_tensors is not None and len(out_tensors) > 0
+ ), "RelayModelInfo: output tensors not found (Add TypeInfer details or provide types/shapes manually)"
super().__init__(in_tensors, out_tensors)
def get_tfgraph_inout(graph):
ops = graph.get_operations()
Loading