Skip to content

Commit

Permalink
Fix python binding
Browse files Browse the repository at this point in the history
  • Loading branch information
hugary1995 committed Sep 12, 2024
1 parent 9cd390d commit 28e8648
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/neml2/base.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,11 @@ tensors.TensorValue.set_ instead to modify the tensor value.
},
py::return_value_policy::reference,
"Get the sub-models registered to this model")
.def("get_parameter",
&Model::get_parameter,
py::return_value_policy::reference,
"Get a model parameter given its name")
.def(
"get_parameter",
[](Model & self, const std::string & name) { return &self.get_parameter(name); },
py::return_value_policy::reference,
"Get a model parameter given its name")
.def("set_parameter", &Model::set_parameter, "Set the value for a model parameter")
.def("set_parameters", &Model::set_parameters, "Set the values for multiple model parameters")
.def(
Expand Down

0 comments on commit 28e8648

Please sign in to comment.