[Bug 294945] misc/pytorch: unspecified explicit return type, ambiguous conditional expression

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 02 May 2026 05:52:12 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294945

            Bug ID: 294945
           Summary: misc/pytorch: unspecified explicit return type,
                    ambiguous conditional expression
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: yuri@freebsd.org
          Reporter: milios@ccsys.com
             Flags: maintainer-feedback?(yuri@freebsd.org)
          Assignee: yuri@freebsd.org

as noted in Bug #294601 this probably started happening after the recent pybind
update

working patches already exist in misc/py-pytorch

files/patch-torch_csrc_jit_python_init.cpp
files/patch-torch_csrc_utils_python__arg__parser.cpp

/usr/ports/misc/pytorch/work/pytorch-v2.8.0/torch/csrc/jit/python/init.cpp:1821:11:
error: return type 'Tuple<pybind11::cpp_function &, pybind11::list &>' must
match previous return type 'Tuple<pybind11::none, pybind11::none>' when lambda
expression has unspecified explicit return type
 1821 |           return py::make_tuple(func, overload_names);
      |           ^
/usr/ports/misc/pytorch/work/pytorch-v2.8.0/torch/csrc/jit/python/init.cpp:1848:11:
error: return type 'Tuple<[...], pybind11::none>' must match previous return
type 'Tuple<[...], pybind11::object &>' when lambda expression has unspecified
explicit return type
 1848 |           return py::make_tuple(false, py::none());
      |           ^
2 errors generated.

/usr/ports/misc/pytorch/work/pytorch-v2.8.0/torch/csrc/utils/python_arg_parser.cpp:677:7:
error: conditional expression is ambiguous; 'Tuple<[2 * ...], (no argument)>'
can be converted to 'Tuple<[2 * ...], pybind11::handle>' and vice versa
  677 |       ? py::make_tuple(py::handle(self), py::handle(index))
      |       ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  678 |       : py::make_tuple(py::handle(self), py::handle(index),
py::handle(val));
      |        
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

-- 
You are receiving this mail because:
You are the assignee for the bug.