Skip to content

caffe2/aten bridge doesn't handle overloads with ambiguous defaulting #43945

@bhosmer

Description

@bhosmer

The bridge infra generated by gen_op.py isn't designed to handle calls to multiple op overloads whose defaulting may produce ambiguous calls. For example, the two overloads

- func: ambig.a(Tensor self, int? i=0) -> Tensor

- func: ambig.b(Tensor self, bool? b=False) -> Tensor

will produce (among others) a binding that contains the C++ call ambig(self), resulting in a C++ compiler error.

This can prevent intuitive overloading schemes from working (see e.g. #42190). It should be possible to disambiguate by supplying default arguments explicitly.

cc @ezyang @bhosmer @smessmer @ljk53

Metadata

Metadata

Assignees

Labels

caffe2module: codegenIssues related to the codegen for Aten and Autogradmodule: internalsRelated to internal abstractions in c10 and ATentriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions