← Back to events
ActiveSportsRelease

viable/strict/1789816992: [dynamo] Match CPython semantics in operator.length_hint (#196901)

What happened

Summary Fixes silent divergences between eager and torch.compile in operator.length_hint , which is used on the hot path by list.extend , list.__init__ , deque , and _PyList_AppendTakeRef -style preallocation. ( #195901 ) Divergences Dynamo's BuiltinVariable.call_length_hint returned the raw __length_hint__ result and did not implement the post-processing of CPython's PyObject_LengthHint ( Objects/abstract.c ). Four…

Summary assembled by rule from the sources below

Why it's spreading

Sources