Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
minghuaw committed Sep 18, 2024
1 parent 6d20b76 commit 260cf50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mlx-rs/examples/tutorial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ fn automatic_differentiation() {

let x = Array::from(1.5);

let mut dfdx = calculate_grad(f, &x);
let dfdx = calculate_grad(f, &x);
assert_eq!(dfdx.item::<f32>(), 2.0 * 1.5);

let mut dfdx2 = calculate_grad(|args| calculate_grad(f, args), &x);
let dfdx2 = calculate_grad(|args| calculate_grad(f, args), &x);
assert_eq!(dfdx2.item::<f32>(), 2.0);
}

Expand Down
2 changes: 1 addition & 1 deletion mlx-rs/src/ops/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ mod tests {
#[test]
fn test_view() {
let array = Array::from_slice(&[1i16, 2, 3], &[3]);
let mut new_array = array.view::<i8>();
let new_array = array.view::<i8>();

assert_eq!(new_array.dtype(), Dtype::Int8);
assert_eq!(new_array.shape(), &[6]);
Expand Down

0 comments on commit 260cf50

Please sign in to comment.