| /wasmtime-44.0.1/crates/wasi-nn/wit/ |
| H A D | wasi-nn.wit | 12 import tensor; 19 interface tensor { 27 enum tensor-type { 37 /// The tensor data. 44 type tensor-data = list<u8>; 46 resource tensor { 47 constructor(dimensions: tensor-dimensions, ty: tensor-type, data: tensor-data); 65 use tensor.{tensor}; 113 use tensor.{tensor}; 117 type named-tensor = tuple<string, tensor>; [all …]
|
| /wasmtime-44.0.1/crates/wasi-nn/src/backend/ |
| H A D | onnx.rs | 14 tensor::TensorElementType, 116 tensor: None, in init_execution_context() 126 tensor: None, in init_execution_context() 178 input.tensor.replace(tensor.clone()); in set_input() 229 input_slot.tensor.replace(input.tensor.clone()); in compute() 252 output.tensor.replace(tensor.clone()); in compute() 290 if let Some(tensor) = &output.tensor { in get_output() 313 tensor: Option<Tensor>, field 367 tensor.ty in matches() 410 match &slot.tensor { [all …]
|
| H A D | winml.rs | 208 tensor, in compute() 234 let tensor = to_tensor( in get_output() localVariable 238 tensor in get_output() 277 tensor in to_inspectable() 283 match tensor.ty { in to_inspectable() 316 let tensor = match tensor_kind { in to_tensor() localVariable 353 Ok(tensor) in to_tensor() 379 let tensor = Tensor { in fp16() localVariable 396 assert_eq!(t.unwrap(), tensor); in fp16() 407 let tensor = Tensor { in fp32() localVariable [all …]
|
| H A D | openvino.rs | 92 fn set_input(&mut self, id: Id, tensor: &Tensor) -> Result<(), BackendError> { in set_input() 94 let precision = tensor.ty.into(); in set_input() 95 let dimensions = tensor in set_input() 103 buffer.copy_from_slice(&tensor.data); in set_input() 121 let precision = input.tensor.ty.into(); in compute() 123 .tensor in compute() 131 buffer.copy_from_slice(&input.tensor.data); in compute() 160 tensor: Tensor { in compute()
|
| H A D | pytorch.rs | 114 let tensor = TchTensor::from_data_size(&input_tensor.data, &dimensions, kind) in set_input() localVariable 132 self.inputs[i] = Some(tensor); in set_input() 151 self.inputs.push(Some(tensor)); in set_input() 168 let kind = input.tensor.ty.try_into()?; in compute() 170 .tensor in compute() 176 let tensor = TchTensor::from_data_size(&input.tensor.data, &dimensions, kind) in compute() localVariable 178 self.inputs.push(Some(tensor)); in compute() 209 tensor: output_tensor, in compute()
|
| H A D | mod.rs | 82 fn set_input(&mut self, id: Id, tensor: &Tensor) -> Result<(), BackendError>; in set_input() 140 pub tensor: Tensor, field
|
| /wasmtime-44.0.1/crates/wasi-nn/src/ |
| H A D | wit.rs | 294 let tensor = Tensor { in new() localVariable 299 let tensor = self.table.push(tensor)?; in new() localVariable 300 Ok(tensor) in new() 304 let tensor = self.table.get(&tensor)?; in dimensions() localVariable 305 Ok(tensor.dimensions.clone()) in dimensions() 309 let tensor = self.table.get(&tensor)?; in ty() localVariable 310 Ok(tensor.ty) in ty() 314 let tensor = self.table.get(&tensor)?; in data() localVariable 315 Ok(tensor.data.clone()) in data() 319 self.table.delete(tensor)?; in drop() [all …]
|
| H A D | witx.rs | 190 tensor: &generated::types::Tensor, in set_input() 193 let tensor = crate::wit::types::Tensor { in set_input() localVariable 194 dimensions: memory.to_vec(tensor.dimensions)?, in set_input() 195 ty: tensor.type_.into(), in set_input() 196 data: memory.to_vec(tensor.data)?, in set_input() 198 Ok(exec_context.set_input(Id::Index(index), &tensor)?) in set_input() 225 let tensor = exec_context.get_output(Id::Index(index))?; in get_output() localVariable 232 if tensor.data.len() > destination.len() { in get_output() 233 Err(WasiNnError::NotEnoughMemory(tensor.data.len())) in get_output() 235 destination[..tensor.data.len()].copy_from_slice(&tensor.data); in get_output() [all …]
|
| H A D | lib.rs | 7 use crate::wit::generated_::wasi::nn::tensor::TensorType; 131 pub fn set_input(&mut self, id: Id, tensor: &Tensor) -> Result<(), BackendError> { in set_input() 132 self.0.set_input(id, tensor) in set_input()
|
| /wasmtime-44.0.1/crates/test-programs/src/ |
| H A D | nn.rs | 25 use self::wasi::nn::tensor::{Tensor, TensorType}; 49 let tensor = Tensor::new(&vec![1, 3, 224, 224], TensorType::Fp32, &input.1); in classify() localVariable 53 let input_tuple = (input.0.to_string(), tensor); in classify() 111 pub fn classify(graph: Graph, tensor: Vec<u8>) -> Result<Vec<f32>> { in classify() 117 context.set_input(0, TensorType::F32, &[1, 3, 224, 224], &tensor)?; in classify() 118 println!("[nn] set input tensor: {} bytes", tensor.len()); in classify()
|
| /wasmtime-44.0.1/crates/wasi-nn/examples/classification-component-onnx/src/ |
| H A D | main.rs | 17 tensor::{Tensor, TensorData, TensorDimensions, TensorType}, 72 let tensor = Tensor::new( in main() localVariable 77 let input_tensor = vec!(("data".to_string(), tensor)); in main() 82 let output_tensor = output_tensor_vec.iter().find_map(|(tensor_name, tensor)| { in main() 84 Some(tensor) in main()
|
| /wasmtime-44.0.1/crates/test-programs/src/bin/ |
| H A D | nn_wit_image_classification_openvino_named.rs | 7 let tensor: Vec<u8> = fs::read("fixture/tensor.bgr") in main() localVariable 9 let results = wit::classify(graph, ("input", tensor))?; in main()
|
| H A D | nn_wit_image_classification_winml_named.rs | 7 let tensor = fs::read("fixture/tensor.bgr") in main() localVariable 9 let results = wit::classify(graph, ("input", tensor))?; in main()
|
| H A D | nn_witx_image_classification_openvino_named.rs | 11 let tensor: Vec<u8> = fs::read("fixture/tensor.bgr") in main() localVariable 13 let results = witx::classify(graph, tensor)?; in main()
|
| H A D | nn_witx_image_classification_winml_named.rs | 11 let tensor = fs::read("fixture/tensor.bgr") in main() localVariable 13 let results = witx::classify(graph, tensor)?; in main()
|
| H A D | nn_wit_image_classification_onnx.rs | 13 let tensor = fs::read("fixture/000000062808.rgb") in main() localVariable 15 let results = wit::classify(graph, ("input", tensor))?; in main()
|
| H A D | nn_witx_image_classification_onnx.rs | 13 let tensor = fs::read("fixture/000000062808.rgb") in main() localVariable 15 let results = witx::classify(graph, tensor)?; in main()
|
| H A D | nn_wit_image_classification_openvino.rs | 15 let tensor = fs::read("fixture/tensor.bgr") in main() localVariable 17 let results = wit::classify(graph, ("input", tensor))?; in main()
|
| H A D | nn_witx_image_classification_openvino.rs | 15 let tensor = fs::read("fixture/tensor.bgr") in main() localVariable 17 let results = witx::classify(graph, tensor)?; in main()
|
| H A D | nn_wit_image_classification_pytorch.rs | 13 let tensor = fs::read("fixture/kitten.tensor") in main() localVariable 15 let output_buffer = wit::classify(graph, ("input", tensor))?; in main()
|
| H A D | nn_witx_image_classification_pytorch.rs | 13 let tensor = fs::read("fixture/kitten.tensor") in main() localVariable 15 let output_buffer = witx::classify(graph, tensor)?; in main()
|
| /wasmtime-44.0.1/crates/wasi-nn/witx/ |
| H A D | wasi-nn.witx | 30 (typename $tensor 78 (param $tensor $tensor)
|
| /wasmtime-44.0.1/crates/wasi-nn/examples/classification-example/src/ |
| H A D | main.rs | 28 let tensor = wasi_nn::Tensor { in main() localVariable 34 wasi_nn::set_input(context, 0, tensor).unwrap(); in main()
|
| /wasmtime-44.0.1/crates/wasi-nn/examples/classification-example/ |
| H A D | README.md | 30 …://download.01.org/openvinotoolkit/fixtures/mobilenet/tensor-1x224x224x3-f32.bgr -O fixture/tensor… 33 The `.bgr` file is a tensor representation of an image file (more details
|
| /wasmtime-44.0.1/crates/wasi-nn/examples/classification-example-named/ |
| H A D | README.md | 19 …://download.01.org/openvinotoolkit/fixtures/mobilenet/tensor-1x224x224x3-f32.bgr -O fixture/tensor…
|