Skip to content

Commit 2e8759f

Browse files
ezyangfacebook-github-bot
authored andcommitted
Add pyre fixme for downstream type errors from D65753120
Summary: X-link: meta-pytorch/captum#1439 X-link: facebook/Ax#3055 X-link: ctrl-labs/src2#38515 X-link: ctrl-labs/src2#38514 bypass-github-export-checks "The check is bugged, I exported all the required exports" Reviewed By: jermenkoo Differential Revision: D65826205 fbshipit-source-id: b08f00caaac8f3cc235bc280c4fe3f99089a0753
1 parent 92b12e7 commit 2e8759f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

torcheval/metrics/functional/classification/confusion_matrix.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,17 @@ def _confusion_matrix_update_input_check(
270270
f"got {input.shape}."
271271
)
272272
else:
273+
# pyre-fixme[58]: `>=` is not supported for operand types `Tensor` and
274+
# `Optional[int]`.
273275
if torch.max(input) >= num_classes:
274276
raise ValueError(
275277
"Got `input` prediction class which is too large for the number of classes, "
276278
f"num_classes: {num_classes} must be strictly greater than max class predicted: {torch.max(input)}."
277279
)
278280

279281
# check if num classes is high enough to cover targets.
282+
# pyre-fixme[58]: `>=` is not supported for operand types `Tensor` and
283+
# `Optional[int]`.
280284
if torch.max(target) >= num_classes:
281285
raise ValueError(
282286
"Got `target` class which is larger than the number of classes, "

0 commit comments

Comments
 (0)