Avoid some redundant clone. (#731)

This commit is contained in:
Laurent Mazare
2023-09-04 09:18:32 +02:00
committed by GitHub
parent d0cdea95a5
commit e2f9f60ac2
2 changed files with 3 additions and 3 deletions

View File

@ -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,

View File

@ -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();