Modifier and Type | Method and Description |
---|---|
void |
OrtSession.SessionOptions.addCPU(boolean useArena)
Adds the CPU as an execution backend, using the arena allocator if desired.
|
void |
OrtSession.SessionOptions.addCUDA()
Add CUDA as an execution backend, using device 0.
|
void |
OrtSession.SessionOptions.addCUDA(int deviceNum)
Add CUDA as an execution backend, using the specified CUDA device id.
|
void |
OrtSession.SessionOptions.addDnnl(boolean useArena)
Adds Intel's Deep Neural Network Library as an execution backend.
|
void |
OrtSession.SessionOptions.addNGraph(java.lang.String ngBackendType)
Adds NGraph as an execution backend.
|
void |
OrtSession.SessionOptions.addNnapi()
Adds Android's NNAPI as an execution backend.
|
void |
OrtSession.SessionOptions.addNuphar(boolean allowUnalignedBuffers,
java.lang.String settings)
Adds Nuphar as an execution backend.
|
void |
OrtSession.SessionOptions.addOpenVINO(java.lang.String deviceId)
Adds OpenVINO as an execution backend.
|
void |
OrtSession.SessionOptions.addTensorrt(int deviceNum)
Adds Nvidia's TensorRT as an execution backend.
|
void |
OrtEnvironment.close()
Closes the OrtEnvironment.
|
void |
OrtSession.close()
Closes the session, releasing it's resources.
|
static TensorInfo |
TensorInfo.constructFromBuffer(java.nio.Buffer buffer,
long[] shape,
OnnxJavaType type)
Constructs a TensorInfo from the supplied byte buffer.
|
static TensorInfo |
TensorInfo.constructFromJavaArray(java.lang.Object obj)
Constructs a TensorInfo from the supplied multidimensional Java array,
used to allocate the appropriate amount of native memory.
|
OrtSession |
OrtEnvironment.createSession(byte[] modelArray)
Create a session using the default
OrtSession.SessionOptions , model and the default memory allocator. |
OrtSession |
OrtEnvironment.createSession(byte[] modelArray,
OrtSession.SessionOptions options)
Create a session using the specified
OrtSession.SessionOptions , model and the default memory allocator. |
OrtSession |
OrtEnvironment.createSession(java.lang.String modelPath)
Create a session using the default
OrtSession.SessionOptions , model and the default memory allocator. |
OrtSession |
OrtEnvironment.createSession(java.lang.String modelPath,
OrtSession.SessionOptions options)
Create a session using the specified
OrtSession.SessionOptions , model and the default memory allocator. |
static OnnxTensor |
OnnxTensor.createTensor(OrtEnvironment env,
java.nio.ByteBuffer data,
long[] shape)
Create an OnnxTensor backed by a direct ByteBuffer.
|
static OnnxTensor |
OnnxTensor.createTensor(OrtEnvironment env,
java.nio.ByteBuffer data,
long[] shape,
OnnxJavaType type)
Create an OnnxTensor backed by a direct ByteBuffer.
|
static OnnxTensor |
OnnxTensor.createTensor(OrtEnvironment env,
java.nio.DoubleBuffer data,
long[] shape)
Create an OnnxTensor backed by a direct DoubleBuffer.
|
static OnnxTensor |
OnnxTensor.createTensor(OrtEnvironment env,
java.nio.FloatBuffer data,
long[] shape)
Create an OnnxTensor backed by a direct FloatBuffer.
|
static OnnxTensor |
OnnxTensor.createTensor(OrtEnvironment env,
java.nio.IntBuffer data,
long[] shape)
Create an OnnxTensor backed by a direct IntBuffer.
|
static OnnxTensor |
OnnxTensor.createTensor(OrtEnvironment env,
java.nio.LongBuffer data,
long[] shape)
Create an OnnxTensor backed by a direct LongBuffer.
|
static OnnxTensor |
OnnxTensor.createTensor(OrtEnvironment env,
java.lang.Object data)
Create a Tensor from a Java primitive or String multidimensional array.
|
static OnnxTensor |
OnnxTensor.createTensor(OrtEnvironment env,
java.nio.ShortBuffer data,
long[] shape)
Create an OnnxTensor backed by a direct ShortBuffer.
|
static OnnxTensor |
OnnxTensor.createTensor(OrtEnvironment env,
java.lang.String[] data,
long[] shape)
Create a tensor from a flattened string array.
|
java.util.Map<java.lang.String,NodeInfo> |
OrtSession.getInputInfo()
Returns the info objects for the inputs, including their names and types.
|
java.util.Map<java.lang.String,NodeInfo> |
OrtSession.getOutputInfo()
Returns the info objects for the outputs, including their names and types.
|
java.util.Map<java.lang.Object,java.lang.Object> |
OnnxMap.getValue()
Returns a weakly typed Map containing all the elements.
|
java.util.List<java.lang.Object> |
OnnxSequence.getValue()
Extracts a Java object from the native ONNX type.
|
java.lang.Object |
OnnxTensor.getValue()
Either returns a boxed primitive if the Tensor is a scalar, or a multidimensional array of
primitives if it has multiple dimensions.
|
java.lang.Object |
OnnxValue.getValue()
Returns the value as a Java object copying it out of the native heap.
|
java.lang.Object |
TensorInfo.makeCarrier()
Constructs an array the right shape and type to hold this tensor.
|
OrtSession.Result |
OrtSession.run(java.util.Map<java.lang.String,OnnxTensor> inputs)
Scores an input feed dict, returning the map of all inferred outputs.
|
OrtSession.Result |
OrtSession.run(java.util.Map<java.lang.String,OnnxTensor> inputs,
java.util.Set<java.lang.String> requestedOutputs)
Scores an input feed dict, returning the map of requested inferred outputs.
|
void |
OrtSession.SessionOptions.setExecutionMode(OrtSession.SessionOptions.ExecutionMode mode)
Sets the execution mode of this options object, overriding the old setting.
|
void |
OrtSession.SessionOptions.setInterOpNumThreads(int numThreads)
Sets the size of the CPU thread pool used for executing multiple request concurrently, if executing on a CPU.
|
void |
OrtSession.SessionOptions.setIntraOpNumThreads(int numThreads)
Sets the size of the CPU thread pool used for executing a single graph, if executing on a CPU.
|
void |
OrtSession.SessionOptions.setOptimizationLevel(OrtSession.SessionOptions.OptLevel level)
Sets the optimization level of this options object, overriding the old setting.
|
void |
OrtSession.SessionOptions.setOptimizedModelFilePath(java.lang.String outputPath)
Sets the output path for the optimized model.
|
void |
OrtEnvironment.setTelemetry(boolean sendTelemetry)
Turns on or off the telemetry.
|