Skip to content

Commit

Permalink
Update wasi-nn.wit
Browse files Browse the repository at this point in the history
Support multi-device memory residency of tensors.
  • Loading branch information
geekbeast authored Mar 18, 2024
1 parent 06c30c0 commit 2da0850
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions wit/wasi-nn.wit
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,17 @@ interface tensor {
// Describe the type of element in the tensor (e.g., `f32`).
ty: func() -> tensor-type;

// Return the tensor data.
data: func() -> tensor-data;
// Return the tensor data. Returns an error if not a cpu tensor.
data: func() -> result<tensor-data, error>;

//Copies tensor to cpu.
cpu: func() -> tensor;

//Copies tensor to gpu.
gpu: func() -> tensor;

//Copies tensor to device
to: func(device: execution-target) -> tensor;
}
}

Expand Down

0 comments on commit 2da0850

Please sign in to comment.