I have an application that embeds wasmtime for host wasm component support. I have recently added the wasmtime-wasi-nn crate for wasi-nn support and so far it has worked out well when using the provided Engines within the crate.
I now would like to provide my own Engine(s) that are not part of the of the wasm-wasi-nn crate but I have run into a roadblock. When trying to provide the BackendExecutionContext trait impl I cannot access any of the wasmtime_wasi_nn::Tensor properties as they are set private and there is no impl for Tensor to enable accesses.
Would it be reasonable to add a impl for Tensor allowing access to the Tensor properties ? I see comments that the Tensor struct might be moved to each backend but its not clear how far off this might be.
Thanks
Yes, sounds reasonable to me. I suspect the tensor properties were simply not used publicly so they were default-private, but I don't see why they shouldn't be accessible. Are you interested in contributing a PR?
Andrew Brown said:
Yes, sounds reasonable to me. I suspect the tensor properties were simply not used publicly so they were default-private, but I don't see why they shouldn't be accessible. Are you interested in contributing a PR?
Yes I should be able to do that.
Here is the PR I created
https://github.com/bytecodealliance/wasmtime/pull/10493
Thanks!
Last updated: Dec 13 2025 at 17:03 UTC