ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Convert.cpp File Reference
#include "Convert.h"
#include <stdexcept>

Go to the source code of this file.

Functions

circle::Padding as_circle_padding (const circlechef::Padding &value)
 
circle::ActivationFunctionType as_circle_activation (const circlechef::Activation &value)
 
circle::TensorType as_circle_tensortype (const circlechef::TensorType &value)
 

Function Documentation

◆ as_circle_activation()

circle::ActivationFunctionType as_circle_activation ( const circlechef::Activation &  value)

Definition at line 36 of file Convert.cpp.

37{
38 switch (value)
39 {
40 case circlechef::NONE:
41 return circle::ActivationFunctionType_NONE;
42 case circlechef::RELU:
43 return circle::ActivationFunctionType_RELU;
44 case circlechef::RELU6:
45 return circle::ActivationFunctionType_RELU6;
46 default:
47 break;
48 }
49
50 throw std::runtime_error{"Unknown activation"};
51}

Referenced by BCQFullyConnectedChef::value(), FullyConnectedChef::value(), GRUChef::value(), and InstanceNormChef::value().

◆ as_circle_padding()

circle::Padding as_circle_padding ( const circlechef::Padding &  value)

Definition at line 21 of file Convert.cpp.

22{
23 switch (value)
24 {
25 case circlechef::SAME:
26 return circle::Padding_SAME;
27 case circlechef::VALID:
28 return circle::Padding_VALID;
29 default:
30 break;
31 }
32
33 throw std::runtime_error{"Unknown padding value"};
34}

◆ as_circle_tensortype()

circle::TensorType as_circle_tensortype ( const circlechef::TensorType &  value)

Definition at line 53 of file Convert.cpp.

54{
55 switch (value)
56 {
57 case circlechef::FLOAT32:
58 return circle::TensorType_FLOAT32;
59 case circlechef::INT64:
60 return circle::TensorType_INT64;
61 case circlechef::INT32:
62 return circle::TensorType_INT32;
63 case circlechef::INT16:
64 return circle::TensorType_INT16;
65 case circlechef::INT4:
66 return circle::TensorType_INT4;
67 case circlechef::UINT8:
68 return circle::TensorType_UINT8;
69 case circlechef::UINT4:
70 return circle::TensorType_UINT4;
71 case circlechef::STRING:
72 return circle::TensorType_STRING;
73 case circlechef::BOOL:
74 return circle::TensorType_BOOL;
75 case circlechef::MXFP4:
76 return circle::TensorType_MXFP4;
77 case circlechef::MXINT8:
78 return circle::TensorType_MXINT8;
79 default:
80 break;
81 }
82
83 throw std::runtime_error{"Unknown tensor type"};
84}