1 // Generated file (from: svdf_relaxed.mod.py). Do not edit 2 void CreateModel(Model *model) { 3 OperandType type5(Type::INT32, {}); 4 OperandType type0(Type::TENSOR_FLOAT32, {2, 3}); 5 OperandType type4(Type::TENSOR_FLOAT32, {2, 40}); 6 OperandType type6(Type::TENSOR_FLOAT32, {2, 4}); 7 OperandType type2(Type::TENSOR_FLOAT32, {4, 10}); 8 OperandType type1(Type::TENSOR_FLOAT32, {4, 3}); 9 OperandType type3(Type::TENSOR_FLOAT32, {4}); 10 // Phase 1, operands 11 auto input = model->addOperand(&type0); 12 auto weights_feature = model->addOperand(&type1); 13 auto weights_time = model->addOperand(&type2); 14 auto bias = model->addOperand(&type3); 15 auto state_in = model->addOperand(&type4); 16 auto rank_param = model->addOperand(&type5); 17 auto activation_param = model->addOperand(&type5); 18 auto state_out = model->addOperand(&type4); 19 auto output = model->addOperand(&type6); 20 // Phase 2, operations 21 static int32_t rank_param_init[] = {1}; 22 model->setOperandValue(rank_param, rank_param_init, sizeof(int32_t) * 1); 23 static int32_t activation_param_init[] = {0}; 24 model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); 25 model->addOperation(ANEURALNETWORKS_SVDF, {input, weights_feature, weights_time, bias, state_in, rank_param, activation_param}, {state_out, output}); 26 // Phase 3, inputs and outputs 27 model->identifyInputsAndOutputs( 28 {input, weights_feature, weights_time, bias, state_in}, 29 {state_out, output}); 30 // Phase 4: set relaxed execution 31 model->relaxComputationFloat32toFloat16(true); 32 assert(model->isValid()); 33 } 34 35 bool is_ignored(int i) { 36 static std::set<int> ignore = {0}; 37 return ignore.find(i) != ignore.end(); 38 } 39