ANtutov requested wasmtime-wasi-reviewers for a review on PR #12490.
ANtutov opened PR #12490 from ANtutov:perf/wasi-nn-tensor-bytes to bytecodealliance:main:
<!-- Why these changes? -->
Previously the helper functions converting between Vec<f32> and Vec<u8> allocated intermediate vectors and iterated over the data twice, adding unnecessary overhead for large tensors and example code.<!-- What is changed? -->
Reimplemented f32_vec_to_bytes and bytes_to_f32_vec (and their copies in the ONNX and WinML examples) to build the output vectors in a single pass without temporary collections, while preserving little-endian encoding and the existing panic behavior on invalid input lengths.
alexcrichton commented on PR #12490:
cc @rahulchaphalkar @jlb6740
Last updated: Feb 24 2026 at 04:36 UTC