diff --git a/Cargo.toml b/Cargo.toml index 244ce1c..348ed00 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ keywords = ["deep-learning", "language", "model", "rwkv"] license = "MIT OR Apache-2.0" name = "web-rwkv" repository = "https://github.com/cryscan/web-rwkv" -version = "0.8.19" +version = "0.8.20" [dependencies] ahash = "0.8" diff --git a/src/tensor/mod.rs b/src/tensor/mod.rs index 0ed302c..87201cf 100644 --- a/src/tensor/mod.rs +++ b/src/tensor/mod.rs @@ -475,8 +475,6 @@ impl TensorReshape for TensorGpu { impl TensorGpu { #[cfg(not(target_arch = "wasm32"))] pub fn back_in_place(&self) -> TensorCpu { - use crate::context::ContextEvent; - if self.is_empty() { return TensorCpu { shape: self.shape, @@ -497,7 +495,9 @@ impl TensorGpu { context.queue.submit(Some(encoder.finish())); let (sender, receiver) = tokio::sync::oneshot::channel(); - let _ = context.event().send(ContextEvent { buffer, sender }); + let _ = context + .event() + .send(crate::context::ContextEvent { buffer, sender }); let data = receiver.blocking_recv().unwrap(); let data = unsafe { let data = Box::leak(data); @@ -516,8 +516,6 @@ impl TensorGpu { #[cfg(not(target_arch = "wasm32"))] pub async fn back(&self) -> TensorCpu { - use crate::context::ContextEvent; - if self.is_empty() { return TensorCpu { shape: self.shape, @@ -539,7 +537,9 @@ impl TensorGpu { let (sender, receiver) = tokio::sync::oneshot::channel(); - let _ = context.event().send(ContextEvent { buffer, sender }); + let _ = context + .event() + .send(crate::context::ContextEvent { buffer, sender }); let data = receiver.await.unwrap(); let data = unsafe { let data = Box::leak(data);