public class OnnxSequence extends Object implements OnnxValue
OnnxValue
s all of the same type.
Supports the types mentioned in "onnxruntime_c_api.h", currently
OnnxValue.OnnxValueType
Modifier and Type | Method and Description |
---|---|
protected void |
checkClosed()
Checks if the OnnxValue is closed, if so throws
IllegalStateException . |
void |
close()
Closes this sequence, releasing the native memory backing it and it's elements.
|
SequenceInfo |
getInfo()
Gets the type info object associated with this OnnxValue.
|
OnnxValue.OnnxValueType |
getType()
Gets the type of this OnnxValue.
|
List<? extends OnnxValue> |
getValue()
Extracts a Java list of the
OnnxValue s which can then be further unwrapped. |
boolean |
isClosed()
Checks if this value is closed (i.e., the native object has been released).
|
String |
toString() |
public OnnxValue.OnnxValueType getType()
OnnxValue
public List<? extends OnnxValue> getValue() throws OrtException
OnnxValue
s which can then be further unwrapped.
Returns either a List
of either OnnxTensor
or OnnxMap
.
Note unlike the other OnnxValue.getValue()
methods, this does not copy the values
themselves into the Java heap, it merely exposes them as OnnxValue
instances, allowing
users to use the faster copy methods available for OnnxTensor
. This also means that
those values need to be closed separately from this instance, and are not closed by close()
on this object.
getValue
in interface OnnxValue
OrtException
- If the runtime failed to read an element.public SequenceInfo getInfo()
OnnxValue
public boolean isClosed()
OnnxValue
public void close()
close
in interface OnnxValue
close
in interface AutoCloseable
protected void checkClosed()
IllegalStateException
.Copyright © 2024. All rights reserved.