Class PanamaNnGraphExecutionContext
java.lang.Object
ai.tegmentum.wasmtime4j.panama.wasi.nn.PanamaNnGraphExecutionContext
- All Implemented Interfaces:
ai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext,AutoCloseable
public final class PanamaNnGraphExecutionContext
extends Object
implements ai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext
Panama implementation of the NnGraphExecutionContext interface for WASI-NN inference.
Output tensors are deserialized from the same format as JNI:
[num_dims:i32LE][dim0:i32LE]...[dimN:i32LE][tensor_type:i32LE][data bytes].
- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface ai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext
ai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext.NnTensorMetadata -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()List<ai.tegmentum.wasmtime4j.wasi.nn.NnTensor> List<ai.tegmentum.wasmtime4j.wasi.nn.NnTensor> computeByIndex(ai.tegmentum.wasmtime4j.wasi.nn.NnTensor... inputs) List<ai.tegmentum.wasmtime4j.wasi.nn.NnTensor> ai.tegmentum.wasmtime4j.wasi.nn.NnGraphgetGraph()intlongai.tegmentum.wasmtime4j.wasi.nn.NnTensorgetOutput(int index) ai.tegmentum.wasmtime4j.wasi.nn.NnTensorintbooleanisValid()voidsetInput(int index, ai.tegmentum.wasmtime4j.wasi.nn.NnTensor tensor) void
-
Method Details
-
getNativeHandle
public long getNativeHandle()- Specified by:
getNativeHandlein interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext
-
getGraph
public ai.tegmentum.wasmtime4j.wasi.nn.NnGraph getGraph()- Specified by:
getGraphin interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext
-
compute
public List<ai.tegmentum.wasmtime4j.wasi.nn.NnTensor> compute(List<ai.tegmentum.wasmtime4j.wasi.nn.NnTensor> inputs) throws ai.tegmentum.wasmtime4j.wasi.nn.NnException - Specified by:
computein interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext- Throws:
ai.tegmentum.wasmtime4j.wasi.nn.NnException
-
computeByIndex
public List<ai.tegmentum.wasmtime4j.wasi.nn.NnTensor> computeByIndex(ai.tegmentum.wasmtime4j.wasi.nn.NnTensor... inputs) throws ai.tegmentum.wasmtime4j.wasi.nn.NnException - Specified by:
computeByIndexin interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext- Throws:
ai.tegmentum.wasmtime4j.wasi.nn.NnException
-
setInput
public void setInput(int index, ai.tegmentum.wasmtime4j.wasi.nn.NnTensor tensor) throws ai.tegmentum.wasmtime4j.wasi.nn.NnException - Specified by:
setInputin interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext- Throws:
ai.tegmentum.wasmtime4j.wasi.nn.NnException
-
setInput
public void setInput(String name, ai.tegmentum.wasmtime4j.wasi.nn.NnTensor tensor) throws ai.tegmentum.wasmtime4j.wasi.nn.NnException - Specified by:
setInputin interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext- Throws:
ai.tegmentum.wasmtime4j.wasi.nn.NnException
-
computeNoInputs
public List<ai.tegmentum.wasmtime4j.wasi.nn.NnTensor> computeNoInputs() throws ai.tegmentum.wasmtime4j.wasi.nn.NnException- Specified by:
computeNoInputsin interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext- Throws:
ai.tegmentum.wasmtime4j.wasi.nn.NnException
-
getOutput
public ai.tegmentum.wasmtime4j.wasi.nn.NnTensor getOutput(int index) throws ai.tegmentum.wasmtime4j.wasi.nn.NnException - Specified by:
getOutputin interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext- Throws:
ai.tegmentum.wasmtime4j.wasi.nn.NnException
-
getOutput
public ai.tegmentum.wasmtime4j.wasi.nn.NnTensor getOutput(String name) throws ai.tegmentum.wasmtime4j.wasi.nn.NnException - Specified by:
getOutputin interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext- Throws:
ai.tegmentum.wasmtime4j.wasi.nn.NnException
-
getInputCount
public int getInputCount()- Specified by:
getInputCountin interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext
-
getOutputCount
public int getOutputCount()- Specified by:
getOutputCountin interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext
-
getInputMetadata
-
getOutputMetadata
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceai.tegmentum.wasmtime4j.wasi.nn.NnGraphExecutionContext
-