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 |
| 14 | static int32_t act_init[] = {0}; |
| 15 | model->setOperandValue(act, act_init, sizeof(int32_t) * 1); |
| 16 | model->addOperation(ANEURALNETWORKS_FULLY_CONNECTED, {op1, op2, b0, act}, {op3}); |
| 17 | // Phase 3, inputs and outputs |
Jean-Luc Brouillet | 66d5cb6 | 2017-10-04 20:41:35 -0700 | [diff] [blame] | 18 | model->identifyInputsAndOutputs( |
Jean-Luc Brouillet | e68d924 | 2017-10-04 00:49:53 -0700 | [diff] [blame] | 19 | {op1, op2, b0}, |
| 20 | {op3}); |
| 21 | assert(model->isValid()); |
| 22 | } |
| 23 | |
| 24 | bool is_ignored(int i) { |
| 25 | static std::set<int> ignore = {}; |
| 26 | return ignore.find(i) != ignore.end(); |
| 27 | } |