mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[dynamo][itertools] refactor itertools.islice to use polyfill (#133876)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/133876 Approved by: https://github.com/jansel ghstack dependencies: #133769, #133778, #133779, #133864, #133894
This commit is contained in:
committed by
PyTorch MergeBot
parent
a2566adfb6
commit
7d12e6dceb
@ -166,12 +166,6 @@ class ItertoolsVariable(VariableTracker):
|
||||
from_exc=e,
|
||||
)
|
||||
return variables.ListIteratorVariable(result, mutable_local=MutableLocal())
|
||||
elif self.value is itertools.islice:
|
||||
from .builder import SourcelessBuilder
|
||||
|
||||
return tx.inline_user_function_return(
|
||||
SourcelessBuilder.create(tx, polyfills.islice), args, kwargs
|
||||
)
|
||||
elif self.value is itertools.repeat:
|
||||
if len(args) < 2:
|
||||
return variables.RepeatIteratorVariable(
|
||||
|
||||
Reference in New Issue
Block a user