Class NativeNetwork

Inheritance Relationships

Base Type

  • public com.qualcomm.qti.snpe.NeuralNetwork (exhale_interface_interfacecom_1_1qualcomm_1_1qti_1_1snpe_1_1NeuralNetwork)

Class Documentation

com::qualcomm::qti::snpe::internal::NativeNetwork : public com.qualcomm.qti.snpe.NeuralNetwork

Public Functions

inline  NativeNetwork (final Runtime runtime, final NativeBufferOutputStream modelBuffer, final Set< String > outputLayerNames, final boolean isDebugEnabled, final PerformanceProfile performanceProfile, final ProfilingLevel profileLevel, final ExecutionPriorityHint executionPriorityHint, boolean isCpuFallbackEnabled, boolean unsignedPD, boolean useUserSuppliedBuffers, boolean isInitCacheEnabled, boolean isDlCacheAvailable, boolean cpuFxpMode, final String storageDirectory, final String dspCachePath, final Map< String, int[]> inputDimensions, boolean unconsumedTensorsOutput)
inline  NativeNetwork (final Runtime runtime, final File modelFile, final Set< String > outputLayerNames, final boolean isDebugEnabled, final PerformanceProfile performanceProfile, final ProfilingLevel profileLevel, final ExecutionPriorityHint executionPriorityHint, boolean isCpuFallbackEnabled, boolean unsignedPD, boolean useUserSuppliedBuffers, boolean isInitCacheEnabled, boolean isDlCacheAvailable, boolean cpuFxpMode, final String storageDirectory, final String dspCachePath, final Map< String, int[]> inputDimensions, boolean unconsumedTensorsOutput)
inline Map< String, FloatTensor > execute (final Map< String, FloatTensor > inputs)

Forward propagates the inputs through the neural network.

Parameters

inputs – map of input name and tensor.

Returns

a map of output name and tensor.

inline boolean execute (Map< String, ? extends UserBufferTensor > inputs, Map< String, ? extends UserBufferTensor > outputs)

Forward propagates the inputs through the neural network.

Parameters

inputs – map of input name and user buffer tensor.

Returns

a map of output name and user buffer tensor.

inline FloatTensor createFloatTensor (final int... shape)

Creates a FloatTensor instance with the specified shape.

Parameters

shape – tensor shape.

Returns

newly created instance.

inline TF8UserBufferTensor createTF8UserBufferTensor (final int size, final int[] strides, int stepExactly0, float quantizedStepSize, ByteBuffer userBuffer)

Creates a TF8UserBufferTensor instance to wrap a user buffer.

Parameters
  • size – total size of the buffer, in bytes

  • strides – total number of bytes between elements in each dimension

  • stepExactly0 – step value that represents exactly 0.0

  • quantizedStepSize – step size

  • userBuffer – byte buffer that contains user data. This buffer must have been allocated using direct allocation and possess native byte ordering.

Returns

newly created instance

inline TF16UserBufferTensor createTF16UserBufferTensor (final int size, final int[] strides, int stepExactly0, float quantizedStepSize, ByteBuffer userBuffer)

Creates a TF16UserBufferTensor instance to wrap a user buffer.

Parameters
  • size – total size of the buffer, in bytes

  • strides – total number of bytes between elements in each dimension

  • stepExactly0 – step value that represents exactly 0.0

  • quantizedStepSize – step size

  • userBuffer – byte buffer that contains user data. This buffer must have been allocated using direct allocation and possess native byte ordering.

Returns

newly created instance

inline Map<String, int[]> getInputTensorsShapes()
Returns

a map of the input tensors(s) shape(s).

inline Map<String, int[]> getOutputTensorsShapes()
Returns

a map of the input tensors(s) shape(s).

inline Set<String> getInputTensorsNames()
Returns

a set with the input tensor(s) name(s).

inline Set<String> getOutputTensorsNames()
Returns

a set with the output tensor(s) name(s).

inline TensorAttributes getTensorAttributes(String name)
Parameters

name – name of the network tensor.

Returns

object representing the attributes of the tensor.

inline String getModelVersion()
Returns

the user defined model version.

inline Runtime getRuntime()

See also

com.qualcomm.qti.snpe.SNPE.NeuralNetworkBuilder::setRuntimeOrder(Runtime…)

Returns

The neural network’s selected runtime.

inline Set<String> getOutputLayers()

Returns

The selected output layer(s) name(s).

inline synchronized void release ()

Releases the neural network’s resources. After this call you can no longer invoke any methods on this class instance.

Public Static Functions

static inline synchronized boolean isRuntimeAvailable (final Runtime runtime, final RuntimeCheckOption runtimeCheckOption)

Protected Functions

inline void finalize()