Skip to content

Commit

Permalink
Remove some unused clones
Browse files Browse the repository at this point in the history
  • Loading branch information
dae committed Aug 22, 2023
1 parent a423fe1 commit 551669a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/convertor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ mod tests {
.cloned()
.collect_vec()];
assert_eq!(revlogs.len(), 24394);
let revlogs_per_card = group_by_cid(revlogs.clone());
let revlogs_per_card = group_by_cid(revlogs);
assert_eq!(revlogs_per_card.len(), 3324);
let fsrs_items = revlogs_per_card
.into_iter()
Expand Down
4 changes: 2 additions & 2 deletions src/training.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl<B: Backend<FloatElem = f32>> Model<B> {
info!("retention: {}", &retention);
info!("logits: {}", &logits);
info!("labels: {}", &labels);
let loss = self.bceloss(retention.clone(), labels.clone().float());
let loss = self.bceloss(retention, labels.clone().float());
ClassificationOutput::new(loss, logits, labels)
}
}
Expand Down Expand Up @@ -138,7 +138,7 @@ pub fn train<B: ADBackend<FloatElem = f32>>(

PrettyJsonFileRecorder::<FullPrecisionSettings>::new()
.record(
model_trained.clone().into_record(),
model_trained.into_record(),
format!("{ARTIFACT_DIR}/model").into(),
)
.expect("Failed to save trained model");
Expand Down

0 comments on commit 551669a

Please sign in to comment.