Skip to content

Commit

Permalink
Remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
carrotflakes committed Sep 1, 2023
1 parent 66014a9 commit f7cc1b2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/functions/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn select(axis: usize, indices: Vec<usize>, 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])
Expand Down
2 changes: 1 addition & 1 deletion src/optimizers/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl<T: Send + Sync + 'static> Optimizer<T> for Fixed {
type State = ();

fn new_state(&self, shape: &[usize]) -> Self::State {
drop(shape);
let _ = shape;
()
}

Expand Down
4 changes: 2 additions & 2 deletions src/optimizers/sgd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ impl Optimizer<NDArray> 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));
}
}
Expand Down

0 comments on commit f7cc1b2

Please sign in to comment.