Skip to content

Most visited

Recently visited

navigation

NeuralNetworks.h File Reference

NeuralNetworks.h File Reference

Data Structures

struct  ANeuralNetworksOperandType
 

Typedefs

typedef struct ANeuralNetworksMemory ANeuralNetworksMemory
 
typedef struct ANeuralNetworksModel ANeuralNetworksModel
 
typedef struct ANeuralNetworksCompilation ANeuralNetworksCompilation
 
typedef struct ANeuralNetworksExecution ANeuralNetworksExecution
 
typedef struct ANeuralNetworksOperandType ANeuralNetworksOperandType
 
typedef int32_t ANeuralNetworksOperationType
 
typedef struct ANeuralNetworksEvent ANeuralNetworksEvent
 

Enumerations

enum  OperandCode {
  ANEURALNETWORKS_FLOAT32 = 0, ANEURALNETWORKS_INT32 = 1, ANEURALNETWORKS_UINT32 = 2, ANEURALNETWORKS_TENSOR_FLOAT32 = 3,
  ANEURALNETWORKS_TENSOR_INT32 = 4, ANEURALNETWORKS_TENSOR_QUANT8_ASYMM = 5
}
 
enum  OperationCode {
  ANEURALNETWORKS_ADD = 0, ANEURALNETWORKS_AVERAGE_POOL_2D = 1, ANEURALNETWORKS_CONCATENATION = 2, ANEURALNETWORKS_CONV_2D = 3,
  ANEURALNETWORKS_DEPTHWISE_CONV_2D = 4, ANEURALNETWORKS_DEPTH_TO_SPACE = 5, ANEURALNETWORKS_DEQUANTIZE = 6, ANEURALNETWORKS_EMBEDDING_LOOKUP = 7,
  ANEURALNETWORKS_FLOOR = 8, ANEURALNETWORKS_FULLY_CONNECTED = 9, ANEURALNETWORKS_HASHTABLE_LOOKUP = 10, ANEURALNETWORKS_L2_NORMALIZATION = 11,
  ANEURALNETWORKS_L2_POOL_2D = 12, ANEURALNETWORKS_LOCAL_RESPONSE_NORMALIZATION = 13, ANEURALNETWORKS_LOGISTIC = 14, ANEURALNETWORKS_LSH_PROJECTION = 15,
  ANEURALNETWORKS_LSTM = 16, ANEURALNETWORKS_MAX_POOL_2D = 17, ANEURALNETWORKS_MUL = 18, ANEURALNETWORKS_RELU = 19,
  ANEURALNETWORKS_RELU1 = 20, ANEURALNETWORKS_RELU6 = 21, ANEURALNETWORKS_RESHAPE = 22, ANEURALNETWORKS_RESIZE_BILINEAR = 23,
  ANEURALNETWORKS_RNN = 24, ANEURALNETWORKS_SOFTMAX = 25, ANEURALNETWORKS_SPACE_TO_DEPTH = 26, ANEURALNETWORKS_SVDF = 27,
  ANEURALNETWORKS_TANH = 28
}
 
enum  FuseCode { ANEURALNETWORKS_FUSED_NONE = 0, ANEURALNETWORKS_FUSED_RELU = 1, ANEURALNETWORKS_FUSED_RELU1 = 2, ANEURALNETWORKS_FUSED_RELU6 = 3 }
 
enum  PaddingCode { ANEURALNETWORKS_PADDING_SAME = 1, ANEURALNETWORKS_PADDING_VALID = 2 }
 
enum  PreferenceCode { ANEURALNETWORKS_PREFER_LOW_POWER = 0, ANEURALNETWORKS_PREFER_FAST_SINGLE_ANSWER = 1, ANEURALNETWORKS_PREFER_SUSTAINED_SPEED = 2 }
 
enum  ResultCode {
  ANEURALNETWORKS_NO_ERROR = 0, ANEURALNETWORKS_OUT_OF_MEMORY = 1, ANEURALNETWORKS_INCOMPLETE = 2, ANEURALNETWORKS_UNEXPECTED_NULL = 3,
  ANEURALNETWORKS_BAD_DATA = 4, ANEURALNETWORKS_OP_FAILED = 5, ANEURALNETWORKS_UNMAPPABLE = 5, ANEURALNETWORKS_BAD_STATE = 6
}
 
enum  { ANEURALNETWORKS_MAX_SIZE_OF_IMMEDIATELY_COPIED_VALUES = 128 }
 

Functions

int ANeuralNetworksMemory_createFromFd (size_t size, int protect, int fd, size_t offset, ANeuralNetworksMemory **memory)
 
void ANeuralNetworksMemory_free (ANeuralNetworksMemory *memory)
 
int ANeuralNetworksModel_create (ANeuralNetworksModel **model)
 
void ANeuralNetworksModel_free (ANeuralNetworksModel *model)
 
int ANeuralNetworksModel_finish (ANeuralNetworksModel *model)
 
int ANeuralNetworksModel_addOperand (ANeuralNetworksModel *model, const ANeuralNetworksOperandType *type)
 
int ANeuralNetworksModel_setOperandValue (ANeuralNetworksModel *model, int32_t index, const void *buffer, size_t length)
 
int ANeuralNetworksModel_setOperandValueFromMemory (ANeuralNetworksModel *model, int32_t index, const ANeuralNetworksMemory *memory, size_t offset, size_t length)
 
int ANeuralNetworksModel_addOperation (ANeuralNetworksModel *model, ANeuralNetworksOperationType type, uint32_t inputCount, const uint32_t *inputs, uint32_t outputCount, const uint32_t *outputs)
 
int ANeuralNetworksModel_identifyInputsAndOutputs (ANeuralNetworksModel *model, uint32_t inputCount, const uint32_t *inputs, uint32_t outputCount, const uint32_t *outputs)
 
int ANeuralNetworksCompilation_create (ANeuralNetworksModel *model, ANeuralNetworksCompilation **compilation)
 
void ANeuralNetworksCompilation_free (ANeuralNetworksCompilation *compilation)
 
int ANeuralNetworksCompilation_setPreference (ANeuralNetworksCompilation *compilation, int32_t preference)
 
int ANeuralNetworksCompilation_finish (ANeuralNetworksCompilation *compilation)
 
int ANeuralNetworksExecution_create (ANeuralNetworksCompilation *compilation, ANeuralNetworksExecution **execution)
 
void ANeuralNetworksExecution_free (ANeuralNetworksExecution *execution)
 
int ANeuralNetworksExecution_setInput (ANeuralNetworksExecution *execution, int32_t index, const ANeuralNetworksOperandType *type, const void *buffer, size_t length)
 
int ANeuralNetworksExecution_setInputFromMemory (ANeuralNetworksExecution *execution, int32_t index, const ANeuralNetworksOperandType *type, const ANeuralNetworksMemory *memory, size_t offset, size_t length)
 
int ANeuralNetworksExecution_setOutput (ANeuralNetworksExecution *execution, int32_t index, const ANeuralNetworksOperandType *type, void *buffer, size_t length)
 
int ANeuralNetworksExecution_setOutputFromMemory (ANeuralNetworksExecution *execution, int32_t index, const ANeuralNetworksOperandType *type, const ANeuralNetworksMemory *memory, size_t offset, size_t length)
 
int ANeuralNetworksExecution_startCompute (ANeuralNetworksExecution *execution, ANeuralNetworksEvent **event)
 
int ANeuralNetworksEvent_wait (ANeuralNetworksEvent *event)
 
void ANeuralNetworksEvent_free (ANeuralNetworksEvent *event)
 
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)