[dynamo,torch_function] __torch_function__ does not respect kwargs #117971
Labels
dynamo-tensor-subclasses
dynamo-torch-function
dynamo-triage-june2024
module: dynamo
module: __torch_function__
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
🐛 Describe the bug
Found when debugging some new failures coming from #117625.
Our implementation of torch_function does not trace the call within
if has_torch_function
in eager. This makes kwargs not to be populated correctly. For example inpytorch/torch/nn/functional.py
Lines 2232 to 2243 in c378001
we see that some kwargs are populated, even when all the args are passed as positional args. This a few calls further down where the implementation expects just 2 positional args:
pytorch/torch/nn/utils/_expanded_weights/embedding_expanded_weights.py
Line 16 in c378001
cc @hameerabbasi @rgommers @ezyang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @peterbell10 @aakhundov @mlazos
Versions
master
The text was updated successfully, but these errors were encountered: