Skip to content

Commit bc3438b

Browse files
committed
Clean pyright warning
stack-info: PR: #335, branch: oulgen/stack/25
1 parent 5840834 commit bc3438b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

helion/_testing.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,16 @@ def check_example(
150150
args,
151151
**kwargs,
152152
)
153-
skip_accuracy or torch.testing.assert_close(
154-
result.to(torch.float32), # pyright: ignore[reportAttributeAccessIssue]
155-
expected.to(torch.float32),
156-
atol=1e-1,
157-
rtol=1e-2,
158-
) # pyright: ignore[reportUnusedExpression]
153+
154+
assert isinstance(result, torch.Tensor)
155+
156+
if not skip_accuracy:
157+
torch.testing.assert_close(
158+
result.to(torch.float32),
159+
expected.to(torch.float32),
160+
atol=1e-1,
161+
rtol=1e-2,
162+
)
159163
return code
160164

161165

0 commit comments

Comments
 (0)