Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions extension/pybindings/pybindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ struct PyModule final {
cpp_inputs.push_back(EValue(py::cast<bool>(python_input)));
} else if (py::isinstance<py::int_>(python_input)) {
cpp_inputs.push_back(EValue(py::cast<int64_t>(python_input)));
} else if (py::isinstance<py::float_>(python_input)) {
cpp_inputs.push_back(EValue(py::cast<double>(python_input)));
Comment on lines +810 to +811
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Float scalar inputs are now converted to EValue(double), but there doesn’t appear to be pybindings coverage that exercises a program with a double/float scalar input (existing tests mainly use tensor-only inputs). Adding an end-to-end pybindings test that exports a module taking a float scalar input (e.g., alpha/beta in addmm, or a simple x * alpha) would prevent regressions across both ExecuTorchModule.run_method and ExecuTorchMethod.set_inputs paths.

Copilot uses AI. Check for mistakes.
} else {
throw std::runtime_error(
"Unsupported python type " + type_str +
Expand Down Expand Up @@ -1135,6 +1137,8 @@ struct PyMethod final {
cpp_inputs.push_back(EValue(py::cast<bool>(python_input)));
} else if (py::isinstance<py::int_>(python_input)) {
cpp_inputs.push_back(EValue(py::cast<int64_t>(python_input)));
} else if (py::isinstance<py::float_>(python_input)) {
cpp_inputs.push_back(EValue(py::cast<double>(python_input)));
} else {
throw std::runtime_error(
"Unsupported python type " + type_str +
Expand Down
Loading