Skip to content

Commit

Permalink
reland map/zip iterator related changes (#135074)
Browse files Browse the repository at this point in the history
Summary:
X-link: pytorch/pytorch#135074
Approved by: https://github.com/jansel, https://github.com/anijain2305, https://github.com/mlazos

Reviewed By: kit1980

Differential Revision: D62211019

Pulled By: williamwen42

fbshipit-source-id: 3e4cf12548bb95b66ee7272a6d77ebffa93b6046
  • Loading branch information
williamwen42 authored and facebook-github-bot committed Sep 7, 2024
1 parent cdceb78 commit 5ee3599
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1608,8 +1608,12 @@ def same(
"""Check correctness to see if ref and res match"""
if fp64_ref is None:
fp64_ref = ref
if isinstance(ref, (list, tuple, torch.nn.ParameterList, torch.Size)):
assert isinstance(res, (list, tuple)), f"type mismatch {type(ref)} {type(res)}"
if isinstance(
ref, (list, tuple, collections.deque, torch.nn.ParameterList, torch.Size)
):
assert isinstance(
res, (list, tuple, collections.deque)
), f"type mismatch {type(ref)} {type(res)}"
if len(ref) != len(res):
log_error("Length mismatch")
return False
Expand Down

0 comments on commit 5ee3599

Please sign in to comment.