From 2da08500658b423bf9ec2c3c19601eb4f614702d Mon Sep 17 00:00:00 2001 From: Matthew Tamayo-Rios Date: Mon, 18 Mar 2024 08:54:51 -0700 Subject: [PATCH] Update wasi-nn.wit Support multi-device memory residency of tensors. --- wit/wasi-nn.wit | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wit/wasi-nn.wit b/wit/wasi-nn.wit index 3e54249..13f25b7 100644 --- a/wit/wasi-nn.wit +++ b/wit/wasi-nn.wit @@ -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; + + //Copies tensor to cpu. + cpu: func() -> tensor; + + //Copies tensor to gpu. + gpu: func() -> tensor; + + //Copies tensor to device + to: func(device: execution-target) -> tensor; } }