Skip to content

Commit

Permalink
Makes classes support dynamic attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
auto-differentiation-dev committed Mar 23, 2024
1 parent a2ad3a2 commit 62cadb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bindings/python/src/real.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ 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", "active arithmetic type for first order adjoint mode")
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<>())
.def(py::self == py::self)
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/src/tape.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ using AReal = mode::active_type;

void py_tape(py::module_ &m)
{
py::class_<Tape>(m, "Tape")
py::class_<Tape>(m, "Tape", py::dynamic_attr())
.def(py::init([] { return std::make_unique<Tape>(false); }),
"constructs a tape without activating it")
.def(
Expand Down

0 comments on commit 62cadb6

Please sign in to comment.