Jean-Luc Brouillet | e68d924 | 2017-10-04 00:49:53 -0700 | [diff] [blame] | 1 | // Generated file (from: fully_connected_quant8_large.mod.py). Do not edit |
| 2 | void CreateModel(Model *model) { |
| 3 | OperandType type3(Type::INT32, {}); |
Miao Wang | 238a880 | 2017-10-04 17:35:03 -0700 | [diff] [blame] | 4 | OperandType type1(Type::TENSOR_INT32, {1}, 0.04, 0); |
Jean-Luc Brouillet | e68d924 | 2017-10-04 00:49:53 -0700 | [diff] [blame] | 5 | OperandType type2(Type::TENSOR_QUANT8_ASYMM, {1, 1}, 1.f, 0); |
| 6 | OperandType type0(Type::TENSOR_QUANT8_ASYMM, {1, 5}, 0.2, 0); |
Jean-Luc Brouillet | e68d924 | 2017-10-04 00:49:53 -0700 | [diff] [blame] | 7 | // Phase 1, operands |
| 8 | auto op1 = model->addOperand(&type0); |
| 9 | auto op2 = model->addOperand(&type0); |
| 10 | auto b0 = model->addOperand(&type1); |
| 11 | auto op3 = model->addOperand(&type2); |
| 12 | auto act = model->addOperand(&type3); |
| 13 | // Phase 2, operations |
Miao Wang | bee07f7 | 2017-10-09 10:43:21 -0700 | [diff] [blame^] | 14 | static uint8_t op2_init[] = {10, 20, 20, 20, 10}; |
| 15 | model->setOperandValue(op2, op2_init, sizeof(uint8_t) * 5); |
| 16 | static int32_t b0_init[] = {10}; |
| 17 | model->setOperandValue(b0, b0_init, sizeof(int32_t) * 1); |
Jean-Luc Brouillet | e68d924 | 2017-10-04 00:49:53 -0700 | [diff] [blame] | 18 | static int32_t act_init[] = {0}; |
| 19 | model->setOperandValue(act, act_init, sizeof(int32_t) * 1); |
| 20 | model->addOperation(ANEURALNETWORKS_FULLY_CONNECTED, {op1, op2, b0, act}, {op3}); |
| 21 | // Phase 3, inputs and outputs |
Jean-Luc Brouillet | 66d5cb6 | 2017-10-04 20:41:35 -0700 | [diff] [blame] | 22 | model->identifyInputsAndOutputs( |
Miao Wang | bee07f7 | 2017-10-09 10:43:21 -0700 | [diff] [blame^] | 23 | {op1}, |
Jean-Luc Brouillet | e68d924 | 2017-10-04 00:49:53 -0700 | [diff] [blame] | 24 | {op3}); |
| 25 | assert(model->isValid()); |
| 26 | } |
| 27 | |
| 28 | bool is_ignored(int i) { |
| 29 | static std::set<int> ignore = {}; |
| 30 | return ignore.find(i) != ignore.end(); |
| 31 | } |