|
ailia_tflite
1.2.4.0
|
Public Member Functions | |
| static Int32 | ailiaTFLiteGetEnvironmentCount (ref UInt64 env_count) |
| Get the number of available calculation environments. More... | |
| static Int32 | ailiaTFLiteGetEnvironment (Int32[] env) |
| Get a list of calculation environments. More... | |
| static Int32 | ailiaTFLiteCreate (ref IntPtr instance, byte[] tflite, UInt64 tflite_length, IntPtr pmalloc, IntPtr pmemcpy, IntPtr pfree, IntPtr phandle, Int32 env_id, Int32 memory_mode, UInt32 flags) |
| Create ailia TFLite runtime instances. More... | |
| static void | ailiaTFLiteDestroy (IntPtr instance) |
| Discard the instance of ailia TFLite runtime. More... | |
| static Int32 | ailiaTFLiteGetCpuFeatures (IntPtr instance, ref Int32 cpu_features) |
| Get the CPU instruction to use. More... | |
| static Int32 | ailiaTFLiteSetCpuFeatures (IntPtr instance, Int32 cpu_features) |
| Set the CPU instruction to use. More... | |
| static Int32 | ailiaTFLiteGetDeviceCount (IntPtr instance, ref UInt64 device_count) |
| Get the number of available devices. More... | |
| static Int32 | ailiaTFLiteGetDeviceName (IntPtr instance, Int32 device_idx, ref IntPtr name) |
| Get the name of the specified index device. More... | |
| static Int32 | ailiaTFLiteGetDeviceExtraInfo (IntPtr instance, Int32 device_idx, ref IntPtr info) |
| Get the detailed information of the specified index device. More... | |
| static Int32 | ailiaTFLiteSelectDevices (IntPtr instance, Int32[] device_idxes, UInt64 idx_count) |
| Specify the index of the device to use. More... | |
| static Int32 | ailiaTFLiteGetSelectedDeviceIndexes (IntPtr instance, Int32[] device_idxes, ref UInt64 idx_count) |
| Get the index and number of devices used. More... | |
| static Int32 | ailiaTFLiteAllocateTensors (IntPtr instance) |
| Ensure the internal buffer of ailia TFLite runtime. More... | |
| static Int32 | ailiaTFLiteResizeInputTensor (IntPtr instance, Int32 input_index, Int32[] shape, Int32 dim) |
| Change the shape of Tensor of the specified input index. More... | |
| static Int32 | ailiaTFLiteGetNumberOfInputs (IntPtr instance, ref Int32 num_of_input_tensor) |
| Get the number of TENSOR in the TFLITE model. More... | |
| static Int32 | ailiaTFLiteGetInputTensorIndex (IntPtr instance, ref Int32 tensor_index, Int32 input_index) |
| Get Tensor's index from index in Tensor. More... | |
| static Int32 | ailiaTFLiteGetNumberOfOutputs (IntPtr instance, ref Int32 num_of_output_tensor) |
| Get the number of TENSOR of the TFLITE model. More... | |
| static Int32 | ailiaTFLiteGetOutputTensorIndex (IntPtr instance, ref Int32 tensor_index, Int32 output_index) |
| Obtain Tensor's index from index of output Tensor. More... | |
| static Int32 | ailiaTFLiteGetTensorDimension (IntPtr instance, ref Int32 tensor_dim, Int32 tensor_index) |
| Get the dimension of index number Tensor. More... | |
| static Int32 | ailiaTFLiteGetTensorShape (IntPtr instance, Int32[] shape, Int32 tensor_index) |
| Get the shape of the index number Tensor. More... | |
| static Int32 | ailiaTFLiteGetTensorShapeSignature (IntPtr instance, Int32[] shape, Int32 tensor_index) |
| Get the undecided dimensional form of Tensor of index number. More... | |
| static Int32 | ailiaTFLiteGetTensorType (IntPtr instance, ref sbyte tensor_type, Int32 tensor_index) |
| Get the Data type of TENSOR in Index. More... | |
| static Int32 | ailiaTFLiteGetTensorBuffer (IntPtr instance, ref IntPtr buffer, Int32 tensor_index) |
| Obtain a storage buffer in Tensor's data. More... | |
| static Int32 | ailiaTFLiteGetTensorName (IntPtr instance, ref IntPtr name, Int32 tensor_index) |
| Get the name of the index number Tensor. More... | |
| static Int32 | ailiaTFLiteGetTensorQuantizationCount (IntPtr instance, ref Int32 count, Int32 tensor_index) |
| Get the number of quantified parameters of index number Tensor. More... | |
| static Int32 | ailiaTFLiteGetTensorQuantizationScale (IntPtr instance, float[] scale, Int32 tensor_index) |
| Get the scale of the quantified parameter of the index number TENSOR. More... | |
| static Int32 | ailiaTFLiteGetTensorQuantizationZeroPoint (IntPtr instance, Int64[] zero_point, Int32 tensor_index) |
| Get the zero point of the quantified parameter of the index number TENSOR. More... | |
| static Int32 | ailiaTFLiteGetTensorQuantizationQuantizedDimension (IntPtr instance, ref Int32 axis, Int32 tensor_index) |
| Get the axis of the integrated TENSOR quantization parameter. More... | |
| static Int32 | ailiaTFLitePredict (IntPtr instance) |
| Do inference. More... | |
| static Int32 | ailiaTFLiteGetNodeCount (IntPtr instance, ref Int32 count) |
| Get the number of node. More... | |
| static Int32 | ailiaTFLiteGetNodeOperator (IntPtr instance, ref Int32 op, Int32 node_index) |
| Get node_index number Operator. More... | |
| static Int32 | ailiaTFLiteGetNodeInputCount (IntPtr instance, ref Int32 count, Int32 node_index) |
| Node_index gets the number of node input. More... | |
| static Int32 | ailiaTFLiteGetNodeInputTensorIndex (IntPtr instance, ref Int32 tensor_index, Int32 node_index, Int32 input_index) |
| Node_index Acquires the index of Tensor in the input input of node. More... | |
| static Int32 | ailiaTFLiteGetNodeOutputCount (IntPtr instance, ref Int32 count, Int32 node_index) |
| Node_index gets the number of node output. More... | |
| static Int32 | ailiaTFLiteGetNodeOutputTensorIndex (IntPtr instance, ref Int32 tensor_index, Int32 node_index, Int32 output_index) |
| static Int32 | ailiaTFLiteGetNodeOption (IntPtr instance, IntPtr value, Int32 node_index, string key) |
| static Int32 | ailiaTFLiteGetOperatorName (ref IntPtr name, Int32 op) |
| static Int32 | ailiaTFLiteSetProfileMode (IntPtr instance, Int32 mode) |
| Set the profile mode. More... | |
| static Int32 | ailiaTFLiteGetSummaryLength (IntPtr instance, ref UInt64 buffer_size) |
| Get the size of the buffer required for network Summary. More... | |
| static Int32 | ailiaTFLiteGetSummary (IntPtr instance, byte[] buffer, UInt64 buffer_size) |
| Displays the name and shape of each node. More... | |
| static Int32 | ailiaTFLiteGetErrorDetail (IntPtr instance, ref IntPtr buffer) |
| Returns the error details. More... | |
| static Int32 | ailiaTFLiteSetScratchBuffer (IntPtr instance, IntPtr int_buffer, UInt64 int_buffer_size, IntPtr mid_buffer, UInt64 mid_buffer_size, IntPtr ext_buffer, UInt64 ext_buffer_size) |
| Set a scratch buffer. More... | |
| static Int32 | ailiaTFLiteGetScratchBufferUsage (IntPtr instance, ref UInt64 int_buffer_size, ref UInt64 mid_buffer_size, ref UInt64 ext_buffer_size) |
| Get the maximum usage of the scratch buffer. More... | |
| static Int32 | ailiaTFLiteMklSetNumThreads (Int32 num_threads) |
| Set the number of threads used by MKL. More... | |
| static Int32 | ailiaTFLiteMklDisableFastMM () |
| Disable the mkl fastmm. More... | |
| static IntPtr | ailiaTFLiteGetVersion () |
| Get the library version. More... | |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteAllocateTensors | ( | IntPtr | instance | ) |
Ensure the internal buffer of ailia TFLite runtime.
| instance | ailia TFLite runtime instance pointer |
Update the internal shape and secure the buffer required for inference.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteCreate | ( | ref IntPtr | instance, |
| byte[] | tflite, | ||
| UInt64 | tflite_length, | ||
| IntPtr | pmalloc, | ||
| IntPtr | pmemcpy, | ||
| IntPtr | pfree, | ||
| IntPtr | phandle, | ||
| Int32 | env_id, | ||
| Int32 | memory_mode, | ||
| UInt32 | flags | ||
| ) |
Create ailia TFLite runtime instances.
| instance | ailia TFLite runtime Pointter to instance pointer |
| tflite | Pointter to TFLITE model |
| tflite_length | TFLITE length (byte unit) |
| pmalloc | MALLOC function pointer (use malloc in the case of null) |
| pmemcpy | MEMCPY function pointer (use Memcpy for null) |
| pfree | FREE function pointer (use free in the case of null) |
| phandle | Handle passed to Memoria Locator (NULL when using standard allocator) |
| env_id | Progress execution environment used for calculation (AILIA_TFLITE_ENV_NAPI_*) |
| memory_mode | Memory mode (AILIA_TFLITE_MEMORY_MODE_*) |
| flags | Flag (logical sum of AILIA_TFLITE_FLAG_*) |
Open the TFLITE model and create ailia TFLite runtime instances. We will also secure the necessary internal buffers. If the instance fails, you need to call AILIATFLITEDESTROY if you store anything other than NULL in Instance.
| static void ailiaTFLite.AiliaTFLite.ailiaTFLiteDestroy | ( | IntPtr | instance | ) |
Discard the instance of ailia TFLite runtime.
| instance | ailia TFLite runtime instance pointer |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetCpuFeatures | ( | IntPtr | instance, |
| ref Int32 | cpu_features | ||
| ) |
Get the CPU instruction to use.
| instance | ailia TFLite runtime instance pointer |
| cpu_features | AILIA_TFLITE_CPU_FEATURES_XXX logical sum |
Get the CPU instruction to use. By default, it returns the CPU instruction obtained from the CPU information. After calling ailiaTFLiteSetCpuFeatures, return the set CPU instruction.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetDeviceCount | ( | IntPtr | instance, |
| ref UInt64 | device_count | ||
| ) |
Get the number of available devices.
| instance | ailia TFLite runtime instance pointer |
| device_count | Device storage destination |
Get the number of available devices.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetDeviceExtraInfo | ( | IntPtr | instance, |
| Int32 | device_idx, | ||
| ref IntPtr | info | ||
| ) |
Get the detailed information of the specified index device.
| instance | ailia TFLite runtime instance pointer |
| device_idx | Index number in the number acquired by AILIATFLITEGETDEVICECOUNT () |
| info | Detailed information of the device information string storage destination |
Get the detailed information of the specified index device.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetDeviceName | ( | IntPtr | instance, |
| Int32 | device_idx, | ||
| ref IntPtr | name | ||
| ) |
Get the name of the specified index device.
| instance | ailia TFLite runtime instance pointer |
| device_idx | Index number in the number acquired by AILIATFLITEGETDEVICECOUNT () |
| name | Device storage destination with the name of the device |
Get the name of the specified index device.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetEnvironment | ( | Int32[] | env | ) |
Get a list of calculation environments.
| env | Arrangement of storage destination of calculation environmental information |
Give the size of the ailiaTFLiteGetEnvironmentCount() to input to the input.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetEnvironmentCount | ( | ref UInt64 | env_count | ) |
Get the number of available calculation environments.
| env_count | Pointter to the number of calculation environment information |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetErrorDetail | ( | IntPtr | instance, |
| ref IntPtr | buffer | ||
| ) |
Returns the error details.
| instance | ailia TFLite runtime instance pointer |
| buffer | Error detailed pointer to string |
The string does not need to be released. The validity period of the string is to call the AILIA API.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetInputTensorIndex | ( | IntPtr | instance, |
| ref Int32 | tensor_index, | ||
| Int32 | input_index | ||
| ) |
Get Tensor's index from index in Tensor.
| instance | ailia TFLite runtime instance pointer |
| tensor_index | Pointer to the destination of Tensor's index |
| input_index | INDEX of input Tensor (0 ~ Number of input Tensor-1) |
Convert from index in Tensor to index of Tensor. The upper limit of INDEX is ailiaTFLiteGetNumberOfInputs() -1.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetNodeCount | ( | IntPtr | instance, |
| ref Int32 | count | ||
| ) |
Get the number of node.
| instance | ailia TFLite runtime instance pointer |
| count | Pointter to the number of node stored |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetNodeInputCount | ( | IntPtr | instance, |
| ref Int32 | count, | ||
| Int32 | node_index | ||
| ) |
Node_index gets the number of node input.
| instance | ailia TFLite runtime instance pointer |
| count | Pointter to the storage destination of the number of input |
| node_index | Node index |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetNodeInputTensorIndex | ( | IntPtr | instance, |
| ref Int32 | tensor_index, | ||
| Int32 | node_index, | ||
| Int32 | input_index | ||
| ) |
Node_index Acquires the index of Tensor in the input input of node.
| instance | ailia TFLite runtime instance pointer |
| tensor_index | Pointer to the destination of Tensor's index |
| node_index | Node index |
| input_index | INDEX for input |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetNodeOperator | ( | IntPtr | instance, |
| ref Int32 | op, | ||
| Int32 | node_index | ||
| ) |
Get node_index number Operator.
| instance | ailia TFLite runtime instance pointer |
| op | Pointter to the destination of Operator |
| node_index | Node index |
The ENUM value of Operator is the same as the internal value of the TFLite file. For more information, see TensorFlow/Lite/Schema/Schema.fbs files in TensorFlow source tree.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetNodeOption | ( | IntPtr | instance, |
| IntPtr | value, | ||
| Int32 | node_index, | ||
| string | key | ||
| ) |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetNodeOutputCount | ( | IntPtr | instance, |
| ref Int32 | count, | ||
| Int32 | node_index | ||
| ) |
Node_index gets the number of node output.
| instance | ailia TFLite runtime instance pointer |
| count | Pointter to the storage destination of the number of output |
| node_index | Node index |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetNodeOutputTensorIndex | ( | IntPtr | instance, |
| ref Int32 | tensor_index, | ||
| Int32 | node_index, | ||
| Int32 | output_index | ||
| ) |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetNumberOfInputs | ( | IntPtr | instance, |
| ref Int32 | num_of_input_tensor | ||
| ) |
Get the number of TENSOR in the TFLITE model.
| instance | ailia TFLite runtime instance pointer |
| num_of_input_tensor | Pointter to the number of model input TENSOR |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetNumberOfOutputs | ( | IntPtr | instance, |
| ref Int32 | num_of_output_tensor | ||
| ) |
Get the number of TENSOR of the TFLITE model.
| instance | ailia TFLite runtime instance pointer |
| num_of_output_tensor | Pointter to the number of model output TENSOR |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetOperatorName | ( | ref IntPtr | name, |
| Int32 | op | ||
| ) |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetOutputTensorIndex | ( | IntPtr | instance, |
| ref Int32 | tensor_index, | ||
| Int32 | output_index | ||
| ) |
Obtain Tensor's index from index of output Tensor.
| instance | ailia TFLite runtime instance pointer |
| tensor_index | Pointer to the destination of Tensor's index |
| output_index | Output TENSOR index (0 ~ Number of output Tensor-1) |
Convert from Index in Tensor to Tensor Index. The upper limit of INDEX is ailiaTFLiteGetNumberOfOutputs () -1.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetScratchBufferUsage | ( | IntPtr | instance, |
| ref UInt64 | int_buffer_size, | ||
| ref UInt64 | mid_buffer_size, | ||
| ref UInt64 | ext_buffer_size | ||
| ) |
Get the maximum usage of the scratch buffer.
| instance | ailia TFLite runtime instance pointer |
| int_buffer_size | Size of scratch buffer (L2) |
| mid_buffer_size | Size of scratch buffer (MSMC) |
| ext_buffer_size | Size of scratch buffer (DDR) |
You can get the size of the necessary scratch buffer by inferring in the first large scratch buffer size. Since the value considering the alignment performed inside is returned, the acquired value can be used directly without considering the alignment.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetSelectedDeviceIndexes | ( | IntPtr | instance, |
| Int32[] | device_idxes, | ||
| ref UInt64 | idx_count | ||
| ) |
Get the index and number of devices used.
| instance | ailia TFLite runtime instance pointer |
| device_idxes | A array that store indexes.Prepare an array with the maximum number of obtained in AILIATFLITEGETDEVICECOUNT (). |
| idx_count | Destination of the number of arrays |
Get the index and number of devices used.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetSummary | ( | IntPtr | instance, |
| byte[] | buffer, | ||
| UInt64 | buffer_size | ||
| ) |
Displays the name and shape of each node.
| instance | ailia TFLite runtime instance pointer |
| buffer | SUMMARY output string pointer |
| buffer_size | The size of the output buffer (including the terminal NULL character).Set the value obtained by AILIATFLITITEGETSUMMARYLENGTH (). |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetSummaryLength | ( | IntPtr | instance, |
| ref UInt64 | buffer_size | ||
| ) |
Get the size of the buffer required for network Summary.
| instance | ailia TFLite runtime instance pointer |
| buffer_size | Pointter to the storage destination of the size of the buffer (including the terminal NULL character) |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetTensorBuffer | ( | IntPtr | instance, |
| ref IntPtr | buffer, | ||
| Int32 | tensor_index | ||
| ) |
Obtain a storage buffer in Tensor's data.
| instance | ailia TFLite runtime instance pointer |
| buffer | Pointter to the destination of the pointer to the data storage buffer |
| tensor_index | Tensor's index |
The life of the storage buffer that can be obtained with Buffer is valid until either ailiaTFLiteAllocateTensors/ailiaTFLiteResizeInputTensor/ailiaTFLiteDestroy is called. The value of the storage buffer is changed when ailiaTFLitePredict is called. There is no need to open the storage buffer at the caller.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetTensorDimension | ( | IntPtr | instance, |
| ref Int32 | tensor_dim, | ||
| Int32 | tensor_index | ||
| ) |
Get the dimension of index number Tensor.
| instance | ailia TFLite runtime instance pointer |
| tensor_dim | Pointter to the specified Tensor's dimension |
| tensor_index | Tensor's index |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetTensorName | ( | IntPtr | instance, |
| ref IntPtr | name, | ||
| Int32 | tensor_index | ||
| ) |
Get the name of the index number Tensor.
| instance | ailia TFLite runtime instance pointer |
| name | Pointter to the destination of the character string pointer named Tensor |
| tensor_index | Tensor's index |
The life of the string pointer that can be obtained in name is effective until calling ailiaTFLiteDestroy. There is no need to open the string pointer at the caller.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetTensorQuantizationCount | ( | IntPtr | instance, |
| ref Int32 | count, | ||
| Int32 | tensor_index | ||
| ) |
Get the number of quantified parameters of index number Tensor.
| instance | ailia TFLite runtime instance pointer |
| count | Pointter to the number of quantified parameters |
| tensor_index | Tensor's index |
Get the number of quantified parameters associated with the specified Tensor. If there is no quantization parameter in the specified Tensor, 0 is stored.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetTensorQuantizationQuantizedDimension | ( | IntPtr | instance, |
| ref Int32 | axis, | ||
| Int32 | tensor_index | ||
| ) |
Get the axis of the integrated TENSOR quantization parameter.
| instance | ailia TFLite runtime instance pointer |
| axis | Pointter to the destination of the axis of the quantized parameter |
| tensor_index | Tensor's index |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetTensorQuantizationScale | ( | IntPtr | instance, |
| float[] | scale, | ||
| Int32 | tensor_index | ||
| ) |
Get the scale of the quantified parameter of the index number TENSOR.
| instance | ailia TFLite runtime instance pointer |
| scale | Pointter to the storage destination of the quantized parameter |
| tensor_index | Tensor's index |
Tensor is quantized and stored in the following formula. Quantization value = zero_point * round(input/scale) Acquired by scale: ailiaTFLiteGetTensorQuantizationScale Acquired by zero_point: ailiaTFliteGetTensorQuantizationZeroPoint scale should secure more than the number of elements obtained in ailiaTFLiteGetTensorQuantizationCount.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetTensorQuantizationZeroPoint | ( | IntPtr | instance, |
| Int64[] | zero_point, | ||
| Int32 | tensor_index | ||
| ) |
Get the zero point of the quantified parameter of the index number TENSOR.
| instance | ailia TFLite runtime instance pointer |
| zero_point | Pointter to the destination of zero points of quantization parameters |
| tensor_index | Tensor's index |
See ailiaTFLiteGetTensorQuantizationScale for description of quantification. For zero_point, secure a buffer that is more than the number of elements acquired in ailiaTFLiteGetTensorQuantizationCountで.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetTensorShape | ( | IntPtr | instance, |
| Int32[] | shape, | ||
| Int32 | tensor_index | ||
| ) |
Get the shape of the index number Tensor.
| instance | ailia TFLite runtime instance pointer |
| shape | Tensor shape storage destination |
| tensor_index | Tensor's index |
Store the shape of the specified Tensor in Shape. Shape should secure a buffer that is more than the dimensions acquired by ailiaTFLiteGetTensorDimension.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetTensorShapeSignature | ( | IntPtr | instance, |
| Int32[] | shape, | ||
| Int32 | tensor_index | ||
| ) |
Get the undecided dimensional form of Tensor of index number.
| instance | ailia TFLite runtime instance pointer |
| shape | Tensor shape storage destination |
| tensor_index | Tensor's index |
Store the undecided dimensional information of the specified Tensor in Shape. -1 is stored for dimensions with undecided shape. If the specified Tensor does not contain an undecided dimension, it will be the same result as ailiaTFLiteGetTensorShape. Shape should secure a buffer that is more than the dimensions acquired by ailiaTFLiteGetTensorDimension.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteGetTensorType | ( | IntPtr | instance, |
| ref sbyte | tensor_type, | ||
| Int32 | tensor_index | ||
| ) |
Get the Data type of TENSOR in Index.
| instance | ailia TFLite runtime instance pointer |
| tensor_type | Specified TENSOR data type storage destination |
| tensor_index | Tensor's index |
| static IntPtr ailiaTFLite.AiliaTFLite.ailiaTFLiteGetVersion | ( | ) |
Get the library version.
The return value does not need to be released.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteMklDisableFastMM | ( | ) |
Disable the mkl fastmm.
mkl_disable_fast_mm is called to disable FastMM.It affects all instances. Mkl increases the memory monotonously until mkl_Free_buffers is called to secure memory for each thread. This work memory is kept until mkl_Free_buffers is called in ailiaTFLiteDestroy. By disabling the fastmm, you can specify not to secure memory for each thread. In an environment that does not use Mkl (MacOS, etc.), return AILIA_TFLITE_STATUS_INVALID_STATE.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteMklSetNumThreads | ( | Int32 | num_threads | ) |
Set the number of threads used by MKL.
| num_threads | Number of threads (1 or more) |
Change the MKL thread number by calling mkl_set_num_threads.It affects all instances. By default, it will be automatically set. In an environment that does not use Mkl (MacOS, etc.), return AILIA_TFLITE_STATUS_INVALID_STATE.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLitePredict | ( | IntPtr | instance | ) |
Do inference.
| instance | ailia TFLite runtime instance pointer |
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteResizeInputTensor | ( | IntPtr | instance, |
| Int32 | input_index, | ||
| Int32[] | shape, | ||
| Int32 | dim | ||
| ) |
Change the shape of Tensor of the specified input index.
| instance | ailia TFLite runtime instance pointer |
| input_index | 0 ~ Input Tensor number-1 |
| shape | New shape |
| dim | dimension |
Change the shape of the input Tensor. Calling this function to open the secured internal buffer You need to call ailiaTFLiteAllocateTensors. Also, since the shape of the intermediate Tensor may change depending on the input shape. After calling this function, the results of the acquisition API may be fraudulent until the ailiaTFLiteAllocateTensors is called. The upper limit of INDEX is ailiaTFLiteGetNumberOfInputs() -1. If the specified Tensor does not contain an undecided dimension (if the Shape obtained in the ailiaTFLiteGetTensorShapeSignature does not include -1) will be an error.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteSelectDevices | ( | IntPtr | instance, |
| Int32[] | device_idxes, | ||
| UInt64 | idx_count | ||
| ) |
Specify the index of the device to use.
| instance | ailia TFLite runtime instance pointer |
| device_idxes | Arrangement with index number |
| idx_count | Number of arrays |
Specify the index of the device to use. Multiple specification can be specified. There are operators that are not implemented in NNAPI. Therefore, it is necessary to offload non compatible operators to CPU by specifying both DSP and CPU.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteSetCpuFeatures | ( | IntPtr | instance, |
| Int32 | cpu_features | ||
| ) |
Set the CPU instruction to use.
| instance | ailia TFLite runtime instance pointer |
| cpu_features | AILIA_TFLITE_CPU_FEATURES_XXX logical sum |
Set the CPU instruction to use. If an unusable CPU instruction is set, return AILIA_TFLITE_STATUS_OUT_OF_RANGE.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteSetProfileMode | ( | IntPtr | instance, |
| Int32 | mode | ||
| ) |
Set the profile mode.
| instance | ailia TFLite runtime instance pointer |
| mode | Profile mode (AILIA_TFLITE_PROFILE_MODE_*) |
Specify the profile mode.The default is invalid. When the profile mode is enabled, the profile result is added to the output of ailiaTFLiteGetSummary. It must be executed immediately after ailiaTFLiteCreate. If you call after ailiaTFLiteAllocateTensors, AILIA_TFLITE_STATUS_INVALID_STATE will be returned.
| static Int32 ailiaTFLite.AiliaTFLite.ailiaTFLiteSetScratchBuffer | ( | IntPtr | instance, |
| IntPtr | int_buffer, | ||
| UInt64 | int_buffer_size, | ||
| IntPtr | mid_buffer, | ||
| UInt64 | mid_buffer_size, | ||
| IntPtr | ext_buffer, | ||
| UInt64 | ext_buffer_size | ||
| ) |
Set a scratch buffer.
| instance | ailia TFLite runtime instance pointer |
| int_buffer | Pointer to scratch buffer (L2) |
| int_buffer_size | Size of scratch buffer (L2) (64 byte or above) |
| mid_buffer | Pointer to scratch buffer (MSMC) |
| mid_buffer_size | Size of scratch buffer (MSMC) |
| ext_buffer | Pointer to scratch buffer (DDR) |
| ext_buffer_size | Size of scratch buffer (DDR) |
Set the scratch buffer used for mmalib.It is valid only when env_mmalib is specified. The alignment of the buffer is performed internally, so there is no need to consider alignment. If you specify 0 for a buffer size other than L2, you can disable the specified buffer. If you specify * env_mmalib, execute ailiaTFLiteAllocateTensors without calling this function, return AILIA_TFLITE_STATUS_INVALID_STATE. The scratch buffer can be changed each time ailiaTFLitePredict is called. However, the size of the scratch buffer must be the same as the value used in ailiaTFLiteAllocateTensors. Because it is used as a work area of non -permanent data, it is possible to give the same buffer to multiple instances for single threads.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |