Skip to content

Commit

Permalink
style: cargo clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Oct 26, 2023
1 parent 80b39ee commit 6ae9451
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions native/candlex/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ custom_unary_op!(Atanh, "atanh", |v| v.atanh(), (BF16, F16, F32, F64));
custom_unary_op!(BitNot, "bit_not", |v| !v, (U8, U32, I64));
custom_unary_op!(Cbrt, "cbrt", |v| v.cbrt(), (BF16, F16, F32, F64));
custom_unary_op!(Cosh, "cosh", |v| v.cosh(), (BF16, F16, F32, F64));
custom_unary_op!(Erfc, "erfc", |v| erfc(v), (BF16, F16, F32, F64));
custom_unary_op!(ErfInv, "erf_inv", |v| erf_inv(v), (BF16, F16, F32, F64));
custom_unary_op!(Erfc, "erfc", erfc, (BF16, F16, F32, F64));
custom_unary_op!(ErfInv, "erf_inv", erf_inv, (BF16, F16, F32, F64));
custom_unary_op!(Expm1, "expm1", |v| v.exp_m1(), (BF16, F16, F32, F64));
custom_unary_op!(Log1p, "ln_1p", |v| v.ln_1p(), (BF16, F16, F32, F64));
custom_unary_op!(Sigmoid, "sigmoid", |v| 1. / (1. + (-v).exp()), (F32, F64));
Expand Down
6 changes: 3 additions & 3 deletions native/candlex/src/tensors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub fn index_add(
pub fn chunk(t: ExTensor, num_chunks: usize) -> Result<Vec<ExTensor>, CandlexError> {
Ok(t.chunk(num_chunks, 0)?
.into_iter()
.map(|t| ExTensor::new(t))
.map(ExTensor::new)
.collect())
}

Expand Down Expand Up @@ -447,10 +447,10 @@ custom_binary_nif!(right_shift, Shr);
custom_binary_nif!(remainder, Remainder);

fn tuple_to_vec(term: Term) -> Result<Vec<usize>, rustler::Error> {
Ok(rustler::types::tuple::get_tuple(term)?
rustler::types::tuple::get_tuple(term)?
.iter()
.map(|elem| elem.decode())
.collect::<Result<_, _>>()?)
.collect::<Result<_, _>>()
}

fn vec_to_tuple(env: Env, vec: Vec<usize>) -> Result<Term, rustler::Error> {
Expand Down

0 comments on commit 6ae9451

Please sign in to comment.