Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
fix(ggml): only set backend after if guards
Browse files Browse the repository at this point in the history
  • Loading branch information
philpax committed Jul 16, 2023
1 parent 090735a commit d815857
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/ggml/src/tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ impl Tensor {
if current_backend != Backend::Cpu && backend == Backend::Cpu {
unimplemented!("Tensors cannot be moved from an accelerator to the CPU at present");
}
t.set_backend(backend);
if backend == Backend::Cpu {
return;
}
t.set_backend(backend);

#[cfg(feature = "cublas")]
unsafe {
Expand Down

0 comments on commit d815857

Please sign in to comment.