Fix exception causes all over the codebase (#90271)

This is the continuation to #90134 and hopefully the final PR in this series.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/90271
Approved by: https://github.com/kit1980
This commit is contained in:
Ram Rachum
2022-12-07 04:28:56 +00:00
committed by PyTorch MergeBot
parent 8f079b895b
commit 351d73b97f
63 changed files with 150 additions and 147 deletions

View File

@ -137,10 +137,10 @@ def validate_shape_inference_header(
with open(shape_inference_hdr, "r") as f:
shape_infr_decls = f.read()
shape_infr_decl_lines = set(shape_infr_decls.split("\n"))
except IOError:
except IOError as e:
raise AssertionError(
f"Unable to read from the specified shape_inference_hdr file: {shape_inference_hdr}"
)
) from e
shape_infr_regex = r"compute_shape_(\w+)"
actual_shape_infr_name_counts = Counter(