Skip to content

Commit

Permalink
Avoid some redundant clone. (huggingface#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed Sep 4, 2023
1 parent d0cdea9 commit e2f9f60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions candle-nn/tests/batch_norm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ fn batch_norm() -> Result<()> {
);
let bn2 = BatchNorm::new(
5,
running_mean.clone(),
running_var.clone(),
running_mean,
running_var,
Tensor::new(&[0.5f32], &Device::Cpu)?.broadcast_as(5)?,
Tensor::new(&[-1.5f32], &Device::Cpu)?.broadcast_as(5)?,
1e-8,
Expand Down
2 changes: 1 addition & 1 deletion candle-wasm-examples/llama2-c/src/bin/m.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Model {
let tokens = self
.inner
.tokenizer
.encode(prompt.to_string(), true)
.encode(prompt, true)
.map_err(|m| JsError::new(&m.to_string()))?
.get_ids()
.to_vec();
Expand Down

0 comments on commit e2f9f60

Please sign in to comment.