public interface OnnxValue
extends java.lang.AutoCloseable
OnnxTensor
, OnnxSequence
and OnnxMap
. Will be sealed to these types one day.
Does not support sparse tensors.
Modifier and Type | Interface and Description |
---|---|
static class |
OnnxValue.OnnxValueType
The type of the
OnnxValue , mirroring the id in the C API. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the OnnxValue, freeing it's native memory.
|
static void |
close(java.lang.Iterable<? extends OnnxValue> itr)
Calls close on each element of the iterable.
|
static void |
close(java.util.Map<java.lang.String,? extends OnnxValue> map)
Calls close on each
OnnxValue in the map. |
ValueInfo |
getInfo()
Gets the type info object associated with this OnnxValue.
|
OnnxValue.OnnxValueType |
getType()
Gets the type of this OnnxValue.
|
java.lang.Object |
getValue()
Returns the value as a Java object copying it out of the native heap.
|
OnnxValue.OnnxValueType getType()
java.lang.Object getValue() throws OrtException
OnnxTensor.getByteBuffer()
etc.
Overridden by the subclasses with a more specific type if available.
OrtException
- If an error occurred reading the value.ValueInfo getInfo()
void close()
close
in interface java.lang.AutoCloseable
static void close(java.lang.Iterable<? extends OnnxValue> itr)
itr
- An iterable of closeable OnnxValues.