Skip to content

Commit

Permalink
Merge pull request #204 from astnmsn/fix/wasm-async-recursion
Browse files Browse the repository at this point in the history
set async_recursion to ?Send for wasm32 arch
  • Loading branch information
pixelspark authored Mar 19, 2024
2 parents 7880ed8 + af090b5 commit df34358
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wonnx/src/optimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ impl<'model> Optimizer<'model> {
}

/// Optimize a branch of a graph (memoized)
#[async_recursion]
#[cfg_attr(target_arch = "wasm32", async_recursion(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_recursion)]
pub async fn optimize(
&mut self,
node: Arc<Node<'model>>,
Expand All @@ -310,7 +311,8 @@ impl<'model> Optimizer<'model> {

/// Optimize a branch of a graph. Takes a node an attempts to form a chain of nodes with single (dynamic) inputs by
/// traversing towards the inputs.
#[async_recursion]
#[cfg_attr(target_arch = "wasm32", async_recursion(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_recursion)]
async fn optimize_actual(
&mut self,
node: Arc<Node<'model>>,
Expand Down

0 comments on commit df34358

Please sign in to comment.