Corrected layout parsing error message. (#10651)

* Corrected error message.

* Corrected message.

* Small correction

* Corrected error message for source and target layout.
This commit is contained in:
Anastasia Popova 2022-03-01 16:03:09 +03:00 committed by GitHub
parent 9eca8515b8
commit 3f941e3c5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1000,8 +1000,14 @@ def parse_layouts_by_destination(s: str, parsed: dict, dest: str = None) -> None
elif m2:
found_g = m2.groups()
else:
raise Error("More then one layout provided for --{}layout without providing name.".format(
dest + '_' if dest else ''))
error_msg = "Invalid usage of --{}layout parameter. Please use following syntax for each tensor " \
"or operation name:" \
"\n name(nchw)" \
"\n name[n,c,h,w]".format(dest + '_' if dest else '')
if dest is None:
error_msg += "\n name(nhwc->[n,h,w,c])" \
"\n name[n,h,w,c]->[n,c,h,w]"
raise Error(error_msg)
write_found_layout(found_g[0], found_g[1], parsed, dest)