Skip to content

Commit

Permalink
Fixes reference to py::class - should be a value
Browse files Browse the repository at this point in the history
  • Loading branch information
auto-differentiation-dev committed Mar 23, 2024
1 parent a5c06af commit d2fcc5b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bindings/python/src/real.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ inline T py_floordiv(const T1& x, const T2& y)
template <class T>
void py_real(py::module_& m)
{
auto& c = py::class_<T>(m, "Real", py::dynamic_attr(),
"active arithmetic type for first order adjoint mode")
.def(py::init<double>())
.def(py::init<>());
auto c = py::class_<T>(m, "Real", py::dynamic_attr(),
"active arithmetic type for first order adjoint mode");

add_extra_methods(c);

c.def(py::self == py::self)
c.def(py::init<double>())
.def(py::init<>())
.def(py::self == py::self)
.def(py::self != py::self)
.def(py::self >= py::self)
.def(py::self <= py::self)
Expand Down Expand Up @@ -193,4 +191,6 @@ void py_real(py::module_& m)
"real", [](const T& x) { return x; }, "real part")
.def(
"imag", [](const T&) { return T(0.0); }, "imaginary part");

add_extra_methods(c);
}

0 comments on commit d2fcc5b

Please sign in to comment.