Skip to content

Commit 844aea1

Browse files
authored
drop nll_loss shapes forbidden by PT 2.9 (#2508)
1 parent 3cba554 commit 844aea1

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

‎thunder/tests/opinfos.py‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9529,7 +9529,6 @@ def nll_loss_sample_generator(op, device, dtype, requires_grad, **kwargs):
95299529
if target.ndim != 0:
95309530
# sprinkle ignore_index in the target, verify correctness, see issue 1744.
95319531
target = torch.where(make(target_shape, low=0.0, high=1.0, requires_grad=False) > 0.3, target, ignore_index)
9532-
95339532
yield SampleInput(
95349533
a,
95359534
target=target,
@@ -9539,13 +9538,16 @@ def nll_loss_sample_generator(op, device, dtype, requires_grad, **kwargs):
95399538
)
95409539

95419540
# Test empty input and target tensor short-circuit
9542-
for reduction_str, ignore_index in itertools.product(reduction_options, ignore_index_options):
9543-
yield SampleInput(
9544-
torch.tensor([], device=device, dtype=dtype),
9545-
torch.tensor([], device=device, dtype=torch.long),
9546-
ignore_index=ignore_index,
9547-
reduction=reduction_str,
9548-
)
9541+
# PyTorch disallows these inputs as of
9542+
# https://github.com/pytorch/pytorch/pull/161412
9543+
# so we drop this shape
9544+
# for reduction_str, ignore_index in itertools.product(reduction_options, ignore_index_options):
9545+
# yield SampleInput(
9546+
# torch.tensor([], device=device, dtype=dtype),
9547+
# torch.tensor([], device=device, dtype=torch.long),
9548+
# ignore_index=ignore_index,
9549+
# reduction=reduction_str,
9550+
# )
95499551

95509552

95519553
def nll_loss_error_generator(op, device, dtype=torch.float32, **kwargs):

0 commit comments

Comments
 (0)