Skip to content

Commit

Permalink
Bump version to v0.8.20
Browse files Browse the repository at this point in the history
  • Loading branch information
cryscan committed Nov 9, 2024
1 parent 0430272 commit 28e70a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions src/tensor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,6 @@ impl<T: Scalar, K: Kind> TensorReshape for TensorGpu<T, K> {
impl<T: Scalar, K: Kind> TensorGpu<T, K> {
#[cfg(not(target_arch = "wasm32"))]
pub fn back_in_place(&self) -> TensorCpu<T> {
use crate::context::ContextEvent;

if self.is_empty() {
return TensorCpu {
shape: self.shape,
Expand All @@ -497,7 +495,9 @@ impl<T: Scalar, K: Kind> TensorGpu<T, K> {
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);
Expand All @@ -516,8 +516,6 @@ impl<T: Scalar, K: Kind> TensorGpu<T, K> {

#[cfg(not(target_arch = "wasm32"))]
pub async fn back(&self) -> TensorCpu<T> {
use crate::context::ContextEvent;

if self.is_empty() {
return TensorCpu {
shape: self.shape,
Expand All @@ -539,7 +537,9 @@ impl<T: Scalar, K: Kind> TensorGpu<T, K> {

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);
Expand Down

0 comments on commit 28e70a5

Please sign in to comment.