Remove unnecessary expect_true in split_with_sizes (#133439)

Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/133439
Approved by: https://github.com/albanD
This commit is contained in:
Edward Z. Yang 2024-08-24 21:09:56 -04:00 committed by PyTorch MergeBot
parent c7ca89a11a
commit bdfc1d3987

View file

@ -1414,13 +1414,9 @@ def split_with_sizes(
start_idx = 0
# Avoid importing sympy at a module level
from torch.fx.experimental.symbolic_shapes import expect_true
for i in range(num_splits):
length = split_sizes[i]
# We know this is true thanks to the sum, but this assertion helps
# out our internal reasoning
expect_true(start_idx + length <= self.shape[dim])
splits.append(self.narrow(dim, start_idx, length))
start_idx += length
return splits