trunk/07622962ce62fa3352b7e855186321a55bc1daa7: [dynamo] Fix callable attributes of polyfilled functions (#200361)
- PyTorch: 2135 events in the last 90 days
- PyTorch: 2106th Release in the last 90 days
- Previous: earlier the same day · viable/strict/1791622520
What happened
Calling a polyfilled function's __torch_dynamo_polyfill__ or __wrapped__ attribute during tracing raises "Polyfill handler ... does not have a traceable function". PolyfilledFunctionVariable.call_method assumes the attribute is itself a registered polyfill, although it can be an ordinary Python function. Build callable attributes through the normal variable dispatcher, retaining their attribute source for guards. On…
Summary assembled by rule from the sources below