From f7cc1b2549bfd8af25990d111ba8cbbc64c914fd Mon Sep 17 00:00:00 2001 From: carrotflakes Date: Fri, 1 Sep 2023 21:56:22 +0900 Subject: [PATCH] Remove warnings --- src/functions/select.rs | 2 +- src/optimizers/fixed.rs | 2 +- src/optimizers/sgd.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/functions/select.rs b/src/functions/select.rs index c8364f8..d2796a9 100644 --- a/src/functions/select.rs +++ b/src/functions/select.rs @@ -13,7 +13,7 @@ pub fn select(axis: usize, indices: Vec, x: &ComputedNDA) -> ComputedNDA false, "select", move |xs, ys, gys| { - drop(ys); + let _ = ys; let mut gx = NDArray::zeros(xs[0].shape()); for i in 0..indices.len() { gx.index_axis_mut(Axis(axis), indices[i]) diff --git a/src/optimizers/fixed.rs b/src/optimizers/fixed.rs index 2630831..c071693 100644 --- a/src/optimizers/fixed.rs +++ b/src/optimizers/fixed.rs @@ -13,7 +13,7 @@ impl Optimizer for Fixed { type State = (); fn new_state(&self, shape: &[usize]) -> Self::State { - drop(shape); + let _ = shape; () } diff --git a/src/optimizers/sgd.rs b/src/optimizers/sgd.rs index a6fc53f..64d75c6 100644 --- a/src/optimizers/sgd.rs +++ b/src/optimizers/sgd.rs @@ -17,12 +17,12 @@ impl Optimizer for SGD { type State = (); fn new_state(&self, shape: &[usize]) -> Self::State { - drop(shape); + let _ = shape; () } fn update(&mut self, data: &mut NDArray, state: &mut Self::State, grad: &NDArray) { - drop(state); + let _ = state; *data = &*data + grad.mul(scalar(-self.learning_rate)); } }