Alexey Gerasev
Alexey Gerasev
> Maybe in that case you could have some specific optimizer that would perform the aggregation and for which step would take multiple grad-store? I didn't consider customizing optimizer, thanks...
@LaurentMazare, what do you think about this PR? Has it a chance to be merged? Or maybe it's better to simply expose `GradStore` internal storage like it's done in [`VarMap.data()`](https://docs.rs/candle-nn/0.3.3/candle_nn/var_map/struct.VarMap.html#method.data)?
Thanks for feature request! I've added `const fn` constructor for RBs with `Array` storage ([LocalRb](https://docs.rs/ringbuf/0.4.0-rc.4/ringbuf/rb/local/struct.LocalRb.html#method.new), [SharedRb](https://docs.rs/ringbuf/0.4.0-rc.4/ringbuf/rb/shared/struct.SharedRb.html#method.new))
Here is a simple example: ```rust use atomig::{Atom, Atomic}; use std::{ sync::{atomic::Ordering, Arc}, thread, }; fn spawn(atomic: Arc) where ::Impl: Send + Sync, ```
Thank you for your PR! But `split_ref` requires mutable reference intentionally. It's unsafe to implement `split_ref` for immutable reference because then it can be called multiple times on the same...
Also I see that you are using [`Lazy`](https://docs.rs/once_cell/latest/once_cell/sync/struct.Lazy.html) which internally uses spinlocks AFAIK. Please note that using spinlocks is not a good practice, especially in RTOS, as it can lead...