Support LR schedulers (#334)

* Add a few LR schedulers

* Move parents's constructor call to the top

* Fix docstring

* refactor optimizers into two files

* add docs

* nit

* Fix Callable type annotation for python 3.8

---------

Co-authored-by: Awni Hannun <awni@apple.com>
Co-authored-by: Angelos Katharopoulos <a_katharopoulos@apple.com>
This commit is contained in:
Srimukh Sripada
2024-02-15 20:26:20 +01:00
committed by GitHub
parent 85143fecdd
commit 818cda16bc
10 changed files with 235 additions and 47 deletions

View File

@@ -971,6 +971,12 @@ void init_array(py::module_& m) {
return power(a, to_array(v, a.dtype()));
},
"other"_a)
.def(
"__rpow__",
[](const array& a, const ScalarOrArray v) {
return power(to_array(v, a.dtype()), a);
},
"other"_a)
.def(
"__ipow__",
[](array& a, const ScalarOrArray v) {