mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-26 00:24:53 +08:00
[BE]: Simplify some list comps to generators C419 (#132578)
Simplifies some list comprehensions to generator which is more efficient. Automatically applied diffs for the most part with ruff Pull Request resolved: https://github.com/pytorch/pytorch/pull/132578 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
4226ed1585
commit
fd4b649e6c
@ -414,8 +414,8 @@ def jagged_from_list(
|
||||
)
|
||||
|
||||
# compute this now since it's easy
|
||||
min_seqlen = min([t.shape[0] for t in tensors])
|
||||
max_seqlen = max([t.shape[0] for t in tensors])
|
||||
min_seqlen = min(t.shape[0] for t in tensors)
|
||||
max_seqlen = max(t.shape[0] for t in tensors)
|
||||
ret_nt = nested_view_from_values_offsets(
|
||||
values, offsets, min_seqlen=min_seqlen, max_seqlen=max_seqlen
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user