Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
document set_input parameters usage
Browse files Browse the repository at this point in the history
rahulchaphalkar committed Oct 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 8e49767 commit 7f84ed4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/wasi-nn/src/backend/pytorch.rs
Original file line number Diff line number Diff line change
@@ -93,6 +93,9 @@ struct PytorchExecutionContext {
id_type: Option<Id>,
}

/// `set_input` supports multiple positional parameters with `Id::Index`, and a single named parameter with `Id::Name`.
/// `set_input` may be removed in the future, with `compute` method taking a list of named parameters.
/// See [PR #77](https://github.com/WebAssembly/wasi-nn/pull/77), at which point multiple named parameters for `Tensor` inputs is planned to be supported in pytorch backend.
impl BackendExecutionContext for PytorchExecutionContext {
fn set_input(&mut self, id: Id, input_tensor: &Tensor) -> Result<(), BackendError> {
let kind = input_tensor.ty.try_into()?;

0 comments on commit 7f84ed4

Please sign in to comment.