ONE - On-device Neural Engine
Loading...
Searching...
No Matches
circle Namespace Reference

Functions

::circle::BuiltinOperator builtin_code_neutral (const ::circle::OperatorCode *opcode)
 
bool is_valid (const ::circle::OperatorCode *opcode)
 
bool is_custom (const ::circle::OperatorCode *opcode)
 
const char * tensor_type (const ::circle::Tensor *tensor)
 
template<typename T >
std::vector< T > as_index_vector (const flatbuffers::Vector< T > *flat_array)
 

Function Documentation

◆ as_index_vector()

template<typename T >
std::vector< T > circle::as_index_vector ( const flatbuffers::Vector< T > *  flat_array)

Definition at line 32 of file CircleMicroReaderHelper.h.

33{
34 if (flat_array == nullptr)
35 {
36 assert(false && "flat array is nullptr");
37 }
38
39 std::vector<T> ret(flat_array->Length());
40 for (uint32_t i = 0; i < flat_array->Length(); i++)
41 {
42 ret[i] = flat_array->Get(i);
43 }
44 return ret;
45}
return_type Get(uoffset_t i) const

References flatbuffers::Vector< T >::Get().

◆ builtin_code_neutral()

circle::BuiltinOperator circle::builtin_code_neutral ( const ::circle::OperatorCode *  opcode)

Definition at line 22 of file CircleMicroReaderHelper.cpp.

23{
24 assert(opcode != nullptr);
25 if (opcode->deprecated_builtin_code() == 127)
26 {
27 assert(opcode->builtin_code() >= 127);
28 return opcode->builtin_code();
29 }
30 // There was no 255(-1) value in v0.3
31 assert(opcode->deprecated_builtin_code() != -1);
32 return static_cast<::circle::BuiltinOperator>(opcode->deprecated_builtin_code());
33}

◆ is_custom()

bool circle::is_custom ( const ::circle::OperatorCode *  opcode)

Definition at line 41 of file CircleMicroReaderHelper.cpp.

42{
43 ::circle::BuiltinOperator code = opcode->builtin_code();
44 return (code == ::circle::BuiltinOperator_CUSTOM);
45}

◆ is_valid()

bool circle::is_valid ( const ::circle::OperatorCode *  opcode)

Definition at line 35 of file CircleMicroReaderHelper.cpp.

36{
37 ::circle::BuiltinOperator code = opcode->builtin_code();
38 return (::circle::BuiltinOperator_MIN <= code && code <= ::circle::BuiltinOperator_MAX);
39}

◆ tensor_type()

const char * circle::tensor_type ( const ::circle::Tensor *  tensor)

Definition at line 47 of file CircleMicroReaderHelper.cpp.

48{
49 return ::circle::EnumNameTensorType(tensor->type());
50}