| // Generated from layer_norm_lstm.mod.py |
| // DO NOT EDIT |
| // clang-format off |
| #include "TestGenerated.h" |
| |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type10(Type::TENSOR_FLOAT32, {2, 16}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type10); |
| auto output_state_out = model->addOperand(&type6); |
| auto cell_state_out = model->addOperand(&type7); |
| auto output = model->addOperand(&type6); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_dynamic_output_shape(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type11); |
| auto output_state_out = model->addOperand(&type11); |
| auto cell_state_out = model->addOperand(&type11); |
| auto output = model->addOperand(&type11); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_dynamic_output_shape(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type10(Type::TENSOR_FLOAT32, {2, 16}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type10); |
| auto output_state_out = model->addOperand(&type6); |
| auto cell_state_out = model->addOperand(&type7); |
| auto output = model->addOperand(&type6); |
| auto input_tmp = model->addOperand(&type0); |
| auto dummy = model->addOperand(&type13); |
| auto param = model->addOperand(&type8); |
| auto input_to_input_weights_tmp = model->addOperand(&type1); |
| auto dummy1 = model->addOperand(&type13); |
| auto param1 = model->addOperand(&type8); |
| auto input_to_forget_weights_tmp = model->addOperand(&type1); |
| auto dummy2 = model->addOperand(&type13); |
| auto param2 = model->addOperand(&type8); |
| auto input_to_cell_weights_tmp = model->addOperand(&type1); |
| auto dummy3 = model->addOperand(&type13); |
| auto param3 = model->addOperand(&type8); |
| auto input_to_output_weights_tmp = model->addOperand(&type1); |
| auto dummy4 = model->addOperand(&type13); |
| auto param4 = model->addOperand(&type8); |
| auto recurrent_to_intput_weights_tmp = model->addOperand(&type2); |
| auto dummy5 = model->addOperand(&type13); |
| auto param5 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights_tmp = model->addOperand(&type2); |
| auto dummy6 = model->addOperand(&type13); |
| auto param6 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights_tmp = model->addOperand(&type2); |
| auto dummy7 = model->addOperand(&type13); |
| auto param7 = model->addOperand(&type8); |
| auto recurrent_to_output_weights_tmp = model->addOperand(&type2); |
| auto dummy8 = model->addOperand(&type13); |
| auto param8 = model->addOperand(&type8); |
| auto cell_to_input_weights_tmp = model->addOperand(&type3); |
| auto dummy9 = model->addOperand(&type13); |
| auto param9 = model->addOperand(&type8); |
| auto cell_to_forget_weights_tmp = model->addOperand(&type3); |
| auto dummy10 = model->addOperand(&type13); |
| auto param10 = model->addOperand(&type8); |
| auto cell_to_output_weights_tmp = model->addOperand(&type3); |
| auto dummy11 = model->addOperand(&type13); |
| auto param11 = model->addOperand(&type8); |
| auto input_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy12 = model->addOperand(&type13); |
| auto param12 = model->addOperand(&type8); |
| auto forget_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy13 = model->addOperand(&type13); |
| auto param13 = model->addOperand(&type8); |
| auto cell_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy14 = model->addOperand(&type13); |
| auto param14 = model->addOperand(&type8); |
| auto output_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy15 = model->addOperand(&type13); |
| auto param15 = model->addOperand(&type8); |
| auto projection_weights_tmp = model->addOperand(&type4); |
| auto dummy16 = model->addOperand(&type13); |
| auto param16 = model->addOperand(&type8); |
| auto output_state_in_tmp = model->addOperand(&type6); |
| auto dummy17 = model->addOperand(&type13); |
| auto param17 = model->addOperand(&type8); |
| auto cell_state_in_tmp = model->addOperand(&type7); |
| auto dummy18 = model->addOperand(&type13); |
| auto param18 = model->addOperand(&type8); |
| auto input_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy19 = model->addOperand(&type13); |
| auto param19 = model->addOperand(&type8); |
| auto forget_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy20 = model->addOperand(&type13); |
| auto param20 = model->addOperand(&type8); |
| auto cell_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy21 = model->addOperand(&type13); |
| auto param21 = model->addOperand(&type8); |
| auto output_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy22 = model->addOperand(&type13); |
| auto param22 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| static float dummy_init[] = {0.0f}; |
| model->setOperandValue(dummy, dummy_init, sizeof(float) * 1); |
| static int32_t param_init[] = {0}; |
| model->setOperandValue(param, param_init, sizeof(int32_t) * 1); |
| static float dummy1_init[] = {0.0f}; |
| model->setOperandValue(dummy1, dummy1_init, sizeof(float) * 1); |
| static int32_t param1_init[] = {0}; |
| model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1); |
| static float dummy2_init[] = {0.0f}; |
| model->setOperandValue(dummy2, dummy2_init, sizeof(float) * 1); |
| static int32_t param2_init[] = {0}; |
| model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1); |
| static float dummy3_init[] = {0.0f}; |
| model->setOperandValue(dummy3, dummy3_init, sizeof(float) * 1); |
| static int32_t param3_init[] = {0}; |
| model->setOperandValue(param3, param3_init, sizeof(int32_t) * 1); |
| static float dummy4_init[] = {0.0f}; |
| model->setOperandValue(dummy4, dummy4_init, sizeof(float) * 1); |
| static int32_t param4_init[] = {0}; |
| model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1); |
| static float dummy5_init[] = {0.0f}; |
| model->setOperandValue(dummy5, dummy5_init, sizeof(float) * 1); |
| static int32_t param5_init[] = {0}; |
| model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1); |
| static float dummy6_init[] = {0.0f}; |
| model->setOperandValue(dummy6, dummy6_init, sizeof(float) * 1); |
| static int32_t param6_init[] = {0}; |
| model->setOperandValue(param6, param6_init, sizeof(int32_t) * 1); |
| static float dummy7_init[] = {0.0f}; |
| model->setOperandValue(dummy7, dummy7_init, sizeof(float) * 1); |
| static int32_t param7_init[] = {0}; |
| model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1); |
| static float dummy8_init[] = {0.0f}; |
| model->setOperandValue(dummy8, dummy8_init, sizeof(float) * 1); |
| static int32_t param8_init[] = {0}; |
| model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1); |
| static float dummy9_init[] = {0.0f}; |
| model->setOperandValue(dummy9, dummy9_init, sizeof(float) * 1); |
| static int32_t param9_init[] = {0}; |
| model->setOperandValue(param9, param9_init, sizeof(int32_t) * 1); |
| static float dummy10_init[] = {0.0f}; |
| model->setOperandValue(dummy10, dummy10_init, sizeof(float) * 1); |
| static int32_t param10_init[] = {0}; |
| model->setOperandValue(param10, param10_init, sizeof(int32_t) * 1); |
| static float dummy11_init[] = {0.0f}; |
| model->setOperandValue(dummy11, dummy11_init, sizeof(float) * 1); |
| static int32_t param11_init[] = {0}; |
| model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1); |
| static float dummy12_init[] = {0.0f}; |
| model->setOperandValue(dummy12, dummy12_init, sizeof(float) * 1); |
| static int32_t param12_init[] = {0}; |
| model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1); |
| static float dummy13_init[] = {0.0f}; |
| model->setOperandValue(dummy13, dummy13_init, sizeof(float) * 1); |
| static int32_t param13_init[] = {0}; |
| model->setOperandValue(param13, param13_init, sizeof(int32_t) * 1); |
| static float dummy14_init[] = {0.0f}; |
| model->setOperandValue(dummy14, dummy14_init, sizeof(float) * 1); |
| static int32_t param14_init[] = {0}; |
| model->setOperandValue(param14, param14_init, sizeof(int32_t) * 1); |
| static float dummy15_init[] = {0.0f}; |
| model->setOperandValue(dummy15, dummy15_init, sizeof(float) * 1); |
| static int32_t param15_init[] = {0}; |
| model->setOperandValue(param15, param15_init, sizeof(int32_t) * 1); |
| static float dummy16_init[] = {0.0f}; |
| model->setOperandValue(dummy16, dummy16_init, sizeof(float) * 1); |
| static int32_t param16_init[] = {0}; |
| model->setOperandValue(param16, param16_init, sizeof(int32_t) * 1); |
| static float dummy17_init[] = {0.0f}; |
| model->setOperandValue(dummy17, dummy17_init, sizeof(float) * 1); |
| static int32_t param17_init[] = {0}; |
| model->setOperandValue(param17, param17_init, sizeof(int32_t) * 1); |
| static float dummy18_init[] = {0.0f}; |
| model->setOperandValue(dummy18, dummy18_init, sizeof(float) * 1); |
| static int32_t param18_init[] = {0}; |
| model->setOperandValue(param18, param18_init, sizeof(int32_t) * 1); |
| static float dummy19_init[] = {0.0f}; |
| model->setOperandValue(dummy19, dummy19_init, sizeof(float) * 1); |
| static int32_t param19_init[] = {0}; |
| model->setOperandValue(param19, param19_init, sizeof(int32_t) * 1); |
| static float dummy20_init[] = {0.0f}; |
| model->setOperandValue(dummy20, dummy20_init, sizeof(float) * 1); |
| static int32_t param20_init[] = {0}; |
| model->setOperandValue(param20, param20_init, sizeof(int32_t) * 1); |
| static float dummy21_init[] = {0.0f}; |
| model->setOperandValue(dummy21, dummy21_init, sizeof(float) * 1); |
| static int32_t param21_init[] = {0}; |
| model->setOperandValue(param21, param21_init, sizeof(int32_t) * 1); |
| static float dummy22_init[] = {0.0f}; |
| model->setOperandValue(dummy22, dummy22_init, sizeof(float) * 1); |
| static int32_t param22_init[] = {0}; |
| model->setOperandValue(param22, param22_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_tmp, dummy, param}, {input}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_input_weights_tmp, dummy1, param1}, {input_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights_tmp, dummy2, param2}, {input_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights_tmp, dummy3, param3}, {input_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights_tmp, dummy4, param4}, {input_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_intput_weights_tmp, dummy5, param5}, {recurrent_to_intput_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights_tmp, dummy6, param6}, {recurrent_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights_tmp, dummy7, param7}, {recurrent_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights_tmp, dummy8, param8}, {recurrent_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_input_weights_tmp, dummy9, param9}, {cell_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights_tmp, dummy10, param10}, {cell_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights_tmp, dummy11, param11}, {cell_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_gate_bias_tmp, dummy12, param12}, {input_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias_tmp, dummy13, param13}, {forget_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias_tmp, dummy14, param14}, {cell_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias_tmp, dummy15, param15}, {output_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights_tmp, dummy16, param16}, {projection_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in_tmp, dummy17, param17}, {output_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in_tmp, dummy18, param18}, {cell_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_layer_norm_weights_tmp, dummy19, param19}, {input_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights_tmp, dummy20, param20}, {forget_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights_tmp, dummy21, param21}, {cell_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights_tmp, dummy22, param22}, {output_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {projection_bias, input_tmp, input_to_input_weights_tmp, input_to_forget_weights_tmp, input_to_cell_weights_tmp, input_to_output_weights_tmp, recurrent_to_intput_weights_tmp, recurrent_to_forget_weights_tmp, recurrent_to_cell_weights_tmp, recurrent_to_output_weights_tmp, cell_to_input_weights_tmp, cell_to_forget_weights_tmp, cell_to_output_weights_tmp, input_gate_bias_tmp, forget_gate_bias_tmp, cell_gate_bias_tmp, output_gate_bias_tmp, projection_weights_tmp, output_state_in_tmp, cell_state_in_tmp, input_layer_norm_weights_tmp, forget_layer_norm_weights_tmp, cell_layer_norm_weights_tmp, output_layer_norm_weights_tmp}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal_dynamic_output_shape(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type11); |
| auto output_state_out = model->addOperand(&type11); |
| auto cell_state_out = model->addOperand(&type11); |
| auto output = model->addOperand(&type11); |
| auto input_tmp = model->addOperand(&type0); |
| auto dummy23 = model->addOperand(&type13); |
| auto param23 = model->addOperand(&type8); |
| auto input_to_input_weights_tmp = model->addOperand(&type1); |
| auto dummy24 = model->addOperand(&type13); |
| auto param24 = model->addOperand(&type8); |
| auto input_to_forget_weights_tmp = model->addOperand(&type1); |
| auto dummy25 = model->addOperand(&type13); |
| auto param25 = model->addOperand(&type8); |
| auto input_to_cell_weights_tmp = model->addOperand(&type1); |
| auto dummy26 = model->addOperand(&type13); |
| auto param26 = model->addOperand(&type8); |
| auto input_to_output_weights_tmp = model->addOperand(&type1); |
| auto dummy27 = model->addOperand(&type13); |
| auto param27 = model->addOperand(&type8); |
| auto recurrent_to_intput_weights_tmp = model->addOperand(&type2); |
| auto dummy28 = model->addOperand(&type13); |
| auto param28 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights_tmp = model->addOperand(&type2); |
| auto dummy29 = model->addOperand(&type13); |
| auto param29 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights_tmp = model->addOperand(&type2); |
| auto dummy30 = model->addOperand(&type13); |
| auto param30 = model->addOperand(&type8); |
| auto recurrent_to_output_weights_tmp = model->addOperand(&type2); |
| auto dummy31 = model->addOperand(&type13); |
| auto param31 = model->addOperand(&type8); |
| auto cell_to_input_weights_tmp = model->addOperand(&type3); |
| auto dummy32 = model->addOperand(&type13); |
| auto param32 = model->addOperand(&type8); |
| auto cell_to_forget_weights_tmp = model->addOperand(&type3); |
| auto dummy33 = model->addOperand(&type13); |
| auto param33 = model->addOperand(&type8); |
| auto cell_to_output_weights_tmp = model->addOperand(&type3); |
| auto dummy34 = model->addOperand(&type13); |
| auto param34 = model->addOperand(&type8); |
| auto input_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy35 = model->addOperand(&type13); |
| auto param35 = model->addOperand(&type8); |
| auto forget_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy36 = model->addOperand(&type13); |
| auto param36 = model->addOperand(&type8); |
| auto cell_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy37 = model->addOperand(&type13); |
| auto param37 = model->addOperand(&type8); |
| auto output_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy38 = model->addOperand(&type13); |
| auto param38 = model->addOperand(&type8); |
| auto projection_weights_tmp = model->addOperand(&type4); |
| auto dummy39 = model->addOperand(&type13); |
| auto param39 = model->addOperand(&type8); |
| auto output_state_in_tmp = model->addOperand(&type6); |
| auto dummy40 = model->addOperand(&type13); |
| auto param40 = model->addOperand(&type8); |
| auto cell_state_in_tmp = model->addOperand(&type7); |
| auto dummy41 = model->addOperand(&type13); |
| auto param41 = model->addOperand(&type8); |
| auto input_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy42 = model->addOperand(&type13); |
| auto param42 = model->addOperand(&type8); |
| auto forget_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy43 = model->addOperand(&type13); |
| auto param43 = model->addOperand(&type8); |
| auto cell_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy44 = model->addOperand(&type13); |
| auto param44 = model->addOperand(&type8); |
| auto output_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy45 = model->addOperand(&type13); |
| auto param45 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| static float dummy23_init[] = {0.0f}; |
| model->setOperandValue(dummy23, dummy23_init, sizeof(float) * 1); |
| static int32_t param23_init[] = {0}; |
| model->setOperandValue(param23, param23_init, sizeof(int32_t) * 1); |
| static float dummy24_init[] = {0.0f}; |
| model->setOperandValue(dummy24, dummy24_init, sizeof(float) * 1); |
| static int32_t param24_init[] = {0}; |
| model->setOperandValue(param24, param24_init, sizeof(int32_t) * 1); |
| static float dummy25_init[] = {0.0f}; |
| model->setOperandValue(dummy25, dummy25_init, sizeof(float) * 1); |
| static int32_t param25_init[] = {0}; |
| model->setOperandValue(param25, param25_init, sizeof(int32_t) * 1); |
| static float dummy26_init[] = {0.0f}; |
| model->setOperandValue(dummy26, dummy26_init, sizeof(float) * 1); |
| static int32_t param26_init[] = {0}; |
| model->setOperandValue(param26, param26_init, sizeof(int32_t) * 1); |
| static float dummy27_init[] = {0.0f}; |
| model->setOperandValue(dummy27, dummy27_init, sizeof(float) * 1); |
| static int32_t param27_init[] = {0}; |
| model->setOperandValue(param27, param27_init, sizeof(int32_t) * 1); |
| static float dummy28_init[] = {0.0f}; |
| model->setOperandValue(dummy28, dummy28_init, sizeof(float) * 1); |
| static int32_t param28_init[] = {0}; |
| model->setOperandValue(param28, param28_init, sizeof(int32_t) * 1); |
| static float dummy29_init[] = {0.0f}; |
| model->setOperandValue(dummy29, dummy29_init, sizeof(float) * 1); |
| static int32_t param29_init[] = {0}; |
| model->setOperandValue(param29, param29_init, sizeof(int32_t) * 1); |
| static float dummy30_init[] = {0.0f}; |
| model->setOperandValue(dummy30, dummy30_init, sizeof(float) * 1); |
| static int32_t param30_init[] = {0}; |
| model->setOperandValue(param30, param30_init, sizeof(int32_t) * 1); |
| static float dummy31_init[] = {0.0f}; |
| model->setOperandValue(dummy31, dummy31_init, sizeof(float) * 1); |
| static int32_t param31_init[] = {0}; |
| model->setOperandValue(param31, param31_init, sizeof(int32_t) * 1); |
| static float dummy32_init[] = {0.0f}; |
| model->setOperandValue(dummy32, dummy32_init, sizeof(float) * 1); |
| static int32_t param32_init[] = {0}; |
| model->setOperandValue(param32, param32_init, sizeof(int32_t) * 1); |
| static float dummy33_init[] = {0.0f}; |
| model->setOperandValue(dummy33, dummy33_init, sizeof(float) * 1); |
| static int32_t param33_init[] = {0}; |
| model->setOperandValue(param33, param33_init, sizeof(int32_t) * 1); |
| static float dummy34_init[] = {0.0f}; |
| model->setOperandValue(dummy34, dummy34_init, sizeof(float) * 1); |
| static int32_t param34_init[] = {0}; |
| model->setOperandValue(param34, param34_init, sizeof(int32_t) * 1); |
| static float dummy35_init[] = {0.0f}; |
| model->setOperandValue(dummy35, dummy35_init, sizeof(float) * 1); |
| static int32_t param35_init[] = {0}; |
| model->setOperandValue(param35, param35_init, sizeof(int32_t) * 1); |
| static float dummy36_init[] = {0.0f}; |
| model->setOperandValue(dummy36, dummy36_init, sizeof(float) * 1); |
| static int32_t param36_init[] = {0}; |
| model->setOperandValue(param36, param36_init, sizeof(int32_t) * 1); |
| static float dummy37_init[] = {0.0f}; |
| model->setOperandValue(dummy37, dummy37_init, sizeof(float) * 1); |
| static int32_t param37_init[] = {0}; |
| model->setOperandValue(param37, param37_init, sizeof(int32_t) * 1); |
| static float dummy38_init[] = {0.0f}; |
| model->setOperandValue(dummy38, dummy38_init, sizeof(float) * 1); |
| static int32_t param38_init[] = {0}; |
| model->setOperandValue(param38, param38_init, sizeof(int32_t) * 1); |
| static float dummy39_init[] = {0.0f}; |
| model->setOperandValue(dummy39, dummy39_init, sizeof(float) * 1); |
| static int32_t param39_init[] = {0}; |
| model->setOperandValue(param39, param39_init, sizeof(int32_t) * 1); |
| static float dummy40_init[] = {0.0f}; |
| model->setOperandValue(dummy40, dummy40_init, sizeof(float) * 1); |
| static int32_t param40_init[] = {0}; |
| model->setOperandValue(param40, param40_init, sizeof(int32_t) * 1); |
| static float dummy41_init[] = {0.0f}; |
| model->setOperandValue(dummy41, dummy41_init, sizeof(float) * 1); |
| static int32_t param41_init[] = {0}; |
| model->setOperandValue(param41, param41_init, sizeof(int32_t) * 1); |
| static float dummy42_init[] = {0.0f}; |
| model->setOperandValue(dummy42, dummy42_init, sizeof(float) * 1); |
| static int32_t param42_init[] = {0}; |
| model->setOperandValue(param42, param42_init, sizeof(int32_t) * 1); |
| static float dummy43_init[] = {0.0f}; |
| model->setOperandValue(dummy43, dummy43_init, sizeof(float) * 1); |
| static int32_t param43_init[] = {0}; |
| model->setOperandValue(param43, param43_init, sizeof(int32_t) * 1); |
| static float dummy44_init[] = {0.0f}; |
| model->setOperandValue(dummy44, dummy44_init, sizeof(float) * 1); |
| static int32_t param44_init[] = {0}; |
| model->setOperandValue(param44, param44_init, sizeof(int32_t) * 1); |
| static float dummy45_init[] = {0.0f}; |
| model->setOperandValue(dummy45, dummy45_init, sizeof(float) * 1); |
| static int32_t param45_init[] = {0}; |
| model->setOperandValue(param45, param45_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_tmp, dummy23, param23}, {input}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_input_weights_tmp, dummy24, param24}, {input_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights_tmp, dummy25, param25}, {input_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights_tmp, dummy26, param26}, {input_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights_tmp, dummy27, param27}, {input_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_intput_weights_tmp, dummy28, param28}, {recurrent_to_intput_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights_tmp, dummy29, param29}, {recurrent_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights_tmp, dummy30, param30}, {recurrent_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights_tmp, dummy31, param31}, {recurrent_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_input_weights_tmp, dummy32, param32}, {cell_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights_tmp, dummy33, param33}, {cell_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights_tmp, dummy34, param34}, {cell_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_gate_bias_tmp, dummy35, param35}, {input_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias_tmp, dummy36, param36}, {forget_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias_tmp, dummy37, param37}, {cell_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias_tmp, dummy38, param38}, {output_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights_tmp, dummy39, param39}, {projection_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in_tmp, dummy40, param40}, {output_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in_tmp, dummy41, param41}, {cell_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_layer_norm_weights_tmp, dummy42, param42}, {input_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights_tmp, dummy43, param43}, {forget_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights_tmp, dummy44, param44}, {cell_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights_tmp, dummy45, param45}, {output_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {projection_bias, input_tmp, input_to_input_weights_tmp, input_to_forget_weights_tmp, input_to_cell_weights_tmp, input_to_output_weights_tmp, recurrent_to_intput_weights_tmp, recurrent_to_forget_weights_tmp, recurrent_to_cell_weights_tmp, recurrent_to_output_weights_tmp, cell_to_input_weights_tmp, cell_to_forget_weights_tmp, cell_to_output_weights_tmp, input_gate_bias_tmp, forget_gate_bias_tmp, cell_gate_bias_tmp, output_gate_bias_tmp, projection_weights_tmp, output_state_in_tmp, cell_state_in_tmp, input_layer_norm_weights_tmp, forget_layer_norm_weights_tmp, cell_layer_norm_weights_tmp, output_layer_norm_weights_tmp}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal_dynamic_output_shape(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_2(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type10(Type::TENSOR_FLOAT32, {2, 16}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type10); |
| auto output_state_out = model->addOperand(&type6); |
| auto cell_state_out = model->addOperand(&type7); |
| auto output = model->addOperand(&type6); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_2(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_dynamic_output_shape_2(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type11); |
| auto output_state_out = model->addOperand(&type11); |
| auto cell_state_out = model->addOperand(&type11); |
| auto output = model->addOperand(&type11); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_dynamic_output_shape_2(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal_2(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type10(Type::TENSOR_FLOAT32, {2, 16}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type10); |
| auto output_state_out = model->addOperand(&type6); |
| auto cell_state_out = model->addOperand(&type7); |
| auto output = model->addOperand(&type6); |
| auto input_tmp = model->addOperand(&type0); |
| auto dummy46 = model->addOperand(&type13); |
| auto param46 = model->addOperand(&type8); |
| auto input_to_input_weights_tmp = model->addOperand(&type1); |
| auto dummy47 = model->addOperand(&type13); |
| auto param47 = model->addOperand(&type8); |
| auto input_to_forget_weights_tmp = model->addOperand(&type1); |
| auto dummy48 = model->addOperand(&type13); |
| auto param48 = model->addOperand(&type8); |
| auto input_to_cell_weights_tmp = model->addOperand(&type1); |
| auto dummy49 = model->addOperand(&type13); |
| auto param49 = model->addOperand(&type8); |
| auto input_to_output_weights_tmp = model->addOperand(&type1); |
| auto dummy50 = model->addOperand(&type13); |
| auto param50 = model->addOperand(&type8); |
| auto recurrent_to_intput_weights_tmp = model->addOperand(&type2); |
| auto dummy51 = model->addOperand(&type13); |
| auto param51 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights_tmp = model->addOperand(&type2); |
| auto dummy52 = model->addOperand(&type13); |
| auto param52 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights_tmp = model->addOperand(&type2); |
| auto dummy53 = model->addOperand(&type13); |
| auto param53 = model->addOperand(&type8); |
| auto recurrent_to_output_weights_tmp = model->addOperand(&type2); |
| auto dummy54 = model->addOperand(&type13); |
| auto param54 = model->addOperand(&type8); |
| auto cell_to_input_weights_tmp = model->addOperand(&type3); |
| auto dummy55 = model->addOperand(&type13); |
| auto param55 = model->addOperand(&type8); |
| auto cell_to_forget_weights_tmp = model->addOperand(&type3); |
| auto dummy56 = model->addOperand(&type13); |
| auto param56 = model->addOperand(&type8); |
| auto cell_to_output_weights_tmp = model->addOperand(&type3); |
| auto dummy57 = model->addOperand(&type13); |
| auto param57 = model->addOperand(&type8); |
| auto input_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy58 = model->addOperand(&type13); |
| auto param58 = model->addOperand(&type8); |
| auto forget_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy59 = model->addOperand(&type13); |
| auto param59 = model->addOperand(&type8); |
| auto cell_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy60 = model->addOperand(&type13); |
| auto param60 = model->addOperand(&type8); |
| auto output_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy61 = model->addOperand(&type13); |
| auto param61 = model->addOperand(&type8); |
| auto projection_weights_tmp = model->addOperand(&type4); |
| auto dummy62 = model->addOperand(&type13); |
| auto param62 = model->addOperand(&type8); |
| auto output_state_in_tmp = model->addOperand(&type6); |
| auto dummy63 = model->addOperand(&type13); |
| auto param63 = model->addOperand(&type8); |
| auto cell_state_in_tmp = model->addOperand(&type7); |
| auto dummy64 = model->addOperand(&type13); |
| auto param64 = model->addOperand(&type8); |
| auto input_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy65 = model->addOperand(&type13); |
| auto param65 = model->addOperand(&type8); |
| auto forget_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy66 = model->addOperand(&type13); |
| auto param66 = model->addOperand(&type8); |
| auto cell_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy67 = model->addOperand(&type13); |
| auto param67 = model->addOperand(&type8); |
| auto output_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy68 = model->addOperand(&type13); |
| auto param68 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| static float dummy46_init[] = {0.0f}; |
| model->setOperandValue(dummy46, dummy46_init, sizeof(float) * 1); |
| static int32_t param46_init[] = {0}; |
| model->setOperandValue(param46, param46_init, sizeof(int32_t) * 1); |
| static float dummy47_init[] = {0.0f}; |
| model->setOperandValue(dummy47, dummy47_init, sizeof(float) * 1); |
| static int32_t param47_init[] = {0}; |
| model->setOperandValue(param47, param47_init, sizeof(int32_t) * 1); |
| static float dummy48_init[] = {0.0f}; |
| model->setOperandValue(dummy48, dummy48_init, sizeof(float) * 1); |
| static int32_t param48_init[] = {0}; |
| model->setOperandValue(param48, param48_init, sizeof(int32_t) * 1); |
| static float dummy49_init[] = {0.0f}; |
| model->setOperandValue(dummy49, dummy49_init, sizeof(float) * 1); |
| static int32_t param49_init[] = {0}; |
| model->setOperandValue(param49, param49_init, sizeof(int32_t) * 1); |
| static float dummy50_init[] = {0.0f}; |
| model->setOperandValue(dummy50, dummy50_init, sizeof(float) * 1); |
| static int32_t param50_init[] = {0}; |
| model->setOperandValue(param50, param50_init, sizeof(int32_t) * 1); |
| static float dummy51_init[] = {0.0f}; |
| model->setOperandValue(dummy51, dummy51_init, sizeof(float) * 1); |
| static int32_t param51_init[] = {0}; |
| model->setOperandValue(param51, param51_init, sizeof(int32_t) * 1); |
| static float dummy52_init[] = {0.0f}; |
| model->setOperandValue(dummy52, dummy52_init, sizeof(float) * 1); |
| static int32_t param52_init[] = {0}; |
| model->setOperandValue(param52, param52_init, sizeof(int32_t) * 1); |
| static float dummy53_init[] = {0.0f}; |
| model->setOperandValue(dummy53, dummy53_init, sizeof(float) * 1); |
| static int32_t param53_init[] = {0}; |
| model->setOperandValue(param53, param53_init, sizeof(int32_t) * 1); |
| static float dummy54_init[] = {0.0f}; |
| model->setOperandValue(dummy54, dummy54_init, sizeof(float) * 1); |
| static int32_t param54_init[] = {0}; |
| model->setOperandValue(param54, param54_init, sizeof(int32_t) * 1); |
| static float dummy55_init[] = {0.0f}; |
| model->setOperandValue(dummy55, dummy55_init, sizeof(float) * 1); |
| static int32_t param55_init[] = {0}; |
| model->setOperandValue(param55, param55_init, sizeof(int32_t) * 1); |
| static float dummy56_init[] = {0.0f}; |
| model->setOperandValue(dummy56, dummy56_init, sizeof(float) * 1); |
| static int32_t param56_init[] = {0}; |
| model->setOperandValue(param56, param56_init, sizeof(int32_t) * 1); |
| static float dummy57_init[] = {0.0f}; |
| model->setOperandValue(dummy57, dummy57_init, sizeof(float) * 1); |
| static int32_t param57_init[] = {0}; |
| model->setOperandValue(param57, param57_init, sizeof(int32_t) * 1); |
| static float dummy58_init[] = {0.0f}; |
| model->setOperandValue(dummy58, dummy58_init, sizeof(float) * 1); |
| static int32_t param58_init[] = {0}; |
| model->setOperandValue(param58, param58_init, sizeof(int32_t) * 1); |
| static float dummy59_init[] = {0.0f}; |
| model->setOperandValue(dummy59, dummy59_init, sizeof(float) * 1); |
| static int32_t param59_init[] = {0}; |
| model->setOperandValue(param59, param59_init, sizeof(int32_t) * 1); |
| static float dummy60_init[] = {0.0f}; |
| model->setOperandValue(dummy60, dummy60_init, sizeof(float) * 1); |
| static int32_t param60_init[] = {0}; |
| model->setOperandValue(param60, param60_init, sizeof(int32_t) * 1); |
| static float dummy61_init[] = {0.0f}; |
| model->setOperandValue(dummy61, dummy61_init, sizeof(float) * 1); |
| static int32_t param61_init[] = {0}; |
| model->setOperandValue(param61, param61_init, sizeof(int32_t) * 1); |
| static float dummy62_init[] = {0.0f}; |
| model->setOperandValue(dummy62, dummy62_init, sizeof(float) * 1); |
| static int32_t param62_init[] = {0}; |
| model->setOperandValue(param62, param62_init, sizeof(int32_t) * 1); |
| static float dummy63_init[] = {0.0f}; |
| model->setOperandValue(dummy63, dummy63_init, sizeof(float) * 1); |
| static int32_t param63_init[] = {0}; |
| model->setOperandValue(param63, param63_init, sizeof(int32_t) * 1); |
| static float dummy64_init[] = {0.0f}; |
| model->setOperandValue(dummy64, dummy64_init, sizeof(float) * 1); |
| static int32_t param64_init[] = {0}; |
| model->setOperandValue(param64, param64_init, sizeof(int32_t) * 1); |
| static float dummy65_init[] = {0.0f}; |
| model->setOperandValue(dummy65, dummy65_init, sizeof(float) * 1); |
| static int32_t param65_init[] = {0}; |
| model->setOperandValue(param65, param65_init, sizeof(int32_t) * 1); |
| static float dummy66_init[] = {0.0f}; |
| model->setOperandValue(dummy66, dummy66_init, sizeof(float) * 1); |
| static int32_t param66_init[] = {0}; |
| model->setOperandValue(param66, param66_init, sizeof(int32_t) * 1); |
| static float dummy67_init[] = {0.0f}; |
| model->setOperandValue(dummy67, dummy67_init, sizeof(float) * 1); |
| static int32_t param67_init[] = {0}; |
| model->setOperandValue(param67, param67_init, sizeof(int32_t) * 1); |
| static float dummy68_init[] = {0.0f}; |
| model->setOperandValue(dummy68, dummy68_init, sizeof(float) * 1); |
| static int32_t param68_init[] = {0}; |
| model->setOperandValue(param68, param68_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_tmp, dummy46, param46}, {input}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_input_weights_tmp, dummy47, param47}, {input_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights_tmp, dummy48, param48}, {input_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights_tmp, dummy49, param49}, {input_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights_tmp, dummy50, param50}, {input_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_intput_weights_tmp, dummy51, param51}, {recurrent_to_intput_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights_tmp, dummy52, param52}, {recurrent_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights_tmp, dummy53, param53}, {recurrent_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights_tmp, dummy54, param54}, {recurrent_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_input_weights_tmp, dummy55, param55}, {cell_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights_tmp, dummy56, param56}, {cell_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights_tmp, dummy57, param57}, {cell_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_gate_bias_tmp, dummy58, param58}, {input_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias_tmp, dummy59, param59}, {forget_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias_tmp, dummy60, param60}, {cell_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias_tmp, dummy61, param61}, {output_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights_tmp, dummy62, param62}, {projection_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in_tmp, dummy63, param63}, {output_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in_tmp, dummy64, param64}, {cell_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_layer_norm_weights_tmp, dummy65, param65}, {input_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights_tmp, dummy66, param66}, {forget_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights_tmp, dummy67, param67}, {cell_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights_tmp, dummy68, param68}, {output_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {projection_bias, input_tmp, input_to_input_weights_tmp, input_to_forget_weights_tmp, input_to_cell_weights_tmp, input_to_output_weights_tmp, recurrent_to_intput_weights_tmp, recurrent_to_forget_weights_tmp, recurrent_to_cell_weights_tmp, recurrent_to_output_weights_tmp, cell_to_input_weights_tmp, cell_to_forget_weights_tmp, cell_to_output_weights_tmp, input_gate_bias_tmp, forget_gate_bias_tmp, cell_gate_bias_tmp, output_gate_bias_tmp, projection_weights_tmp, output_state_in_tmp, cell_state_in_tmp, input_layer_norm_weights_tmp, forget_layer_norm_weights_tmp, cell_layer_norm_weights_tmp, output_layer_norm_weights_tmp}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal_2(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal_dynamic_output_shape_2(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type11); |
| auto output_state_out = model->addOperand(&type11); |
| auto cell_state_out = model->addOperand(&type11); |
| auto output = model->addOperand(&type11); |
| auto input_tmp = model->addOperand(&type0); |
| auto dummy69 = model->addOperand(&type13); |
| auto param69 = model->addOperand(&type8); |
| auto input_to_input_weights_tmp = model->addOperand(&type1); |
| auto dummy70 = model->addOperand(&type13); |
| auto param70 = model->addOperand(&type8); |
| auto input_to_forget_weights_tmp = model->addOperand(&type1); |
| auto dummy71 = model->addOperand(&type13); |
| auto param71 = model->addOperand(&type8); |
| auto input_to_cell_weights_tmp = model->addOperand(&type1); |
| auto dummy72 = model->addOperand(&type13); |
| auto param72 = model->addOperand(&type8); |
| auto input_to_output_weights_tmp = model->addOperand(&type1); |
| auto dummy73 = model->addOperand(&type13); |
| auto param73 = model->addOperand(&type8); |
| auto recurrent_to_intput_weights_tmp = model->addOperand(&type2); |
| auto dummy74 = model->addOperand(&type13); |
| auto param74 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights_tmp = model->addOperand(&type2); |
| auto dummy75 = model->addOperand(&type13); |
| auto param75 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights_tmp = model->addOperand(&type2); |
| auto dummy76 = model->addOperand(&type13); |
| auto param76 = model->addOperand(&type8); |
| auto recurrent_to_output_weights_tmp = model->addOperand(&type2); |
| auto dummy77 = model->addOperand(&type13); |
| auto param77 = model->addOperand(&type8); |
| auto cell_to_input_weights_tmp = model->addOperand(&type3); |
| auto dummy78 = model->addOperand(&type13); |
| auto param78 = model->addOperand(&type8); |
| auto cell_to_forget_weights_tmp = model->addOperand(&type3); |
| auto dummy79 = model->addOperand(&type13); |
| auto param79 = model->addOperand(&type8); |
| auto cell_to_output_weights_tmp = model->addOperand(&type3); |
| auto dummy80 = model->addOperand(&type13); |
| auto param80 = model->addOperand(&type8); |
| auto input_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy81 = model->addOperand(&type13); |
| auto param81 = model->addOperand(&type8); |
| auto forget_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy82 = model->addOperand(&type13); |
| auto param82 = model->addOperand(&type8); |
| auto cell_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy83 = model->addOperand(&type13); |
| auto param83 = model->addOperand(&type8); |
| auto output_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy84 = model->addOperand(&type13); |
| auto param84 = model->addOperand(&type8); |
| auto projection_weights_tmp = model->addOperand(&type4); |
| auto dummy85 = model->addOperand(&type13); |
| auto param85 = model->addOperand(&type8); |
| auto output_state_in_tmp = model->addOperand(&type6); |
| auto dummy86 = model->addOperand(&type13); |
| auto param86 = model->addOperand(&type8); |
| auto cell_state_in_tmp = model->addOperand(&type7); |
| auto dummy87 = model->addOperand(&type13); |
| auto param87 = model->addOperand(&type8); |
| auto input_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy88 = model->addOperand(&type13); |
| auto param88 = model->addOperand(&type8); |
| auto forget_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy89 = model->addOperand(&type13); |
| auto param89 = model->addOperand(&type8); |
| auto cell_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy90 = model->addOperand(&type13); |
| auto param90 = model->addOperand(&type8); |
| auto output_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy91 = model->addOperand(&type13); |
| auto param91 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| static float dummy69_init[] = {0.0f}; |
| model->setOperandValue(dummy69, dummy69_init, sizeof(float) * 1); |
| static int32_t param69_init[] = {0}; |
| model->setOperandValue(param69, param69_init, sizeof(int32_t) * 1); |
| static float dummy70_init[] = {0.0f}; |
| model->setOperandValue(dummy70, dummy70_init, sizeof(float) * 1); |
| static int32_t param70_init[] = {0}; |
| model->setOperandValue(param70, param70_init, sizeof(int32_t) * 1); |
| static float dummy71_init[] = {0.0f}; |
| model->setOperandValue(dummy71, dummy71_init, sizeof(float) * 1); |
| static int32_t param71_init[] = {0}; |
| model->setOperandValue(param71, param71_init, sizeof(int32_t) * 1); |
| static float dummy72_init[] = {0.0f}; |
| model->setOperandValue(dummy72, dummy72_init, sizeof(float) * 1); |
| static int32_t param72_init[] = {0}; |
| model->setOperandValue(param72, param72_init, sizeof(int32_t) * 1); |
| static float dummy73_init[] = {0.0f}; |
| model->setOperandValue(dummy73, dummy73_init, sizeof(float) * 1); |
| static int32_t param73_init[] = {0}; |
| model->setOperandValue(param73, param73_init, sizeof(int32_t) * 1); |
| static float dummy74_init[] = {0.0f}; |
| model->setOperandValue(dummy74, dummy74_init, sizeof(float) * 1); |
| static int32_t param74_init[] = {0}; |
| model->setOperandValue(param74, param74_init, sizeof(int32_t) * 1); |
| static float dummy75_init[] = {0.0f}; |
| model->setOperandValue(dummy75, dummy75_init, sizeof(float) * 1); |
| static int32_t param75_init[] = {0}; |
| model->setOperandValue(param75, param75_init, sizeof(int32_t) * 1); |
| static float dummy76_init[] = {0.0f}; |
| model->setOperandValue(dummy76, dummy76_init, sizeof(float) * 1); |
| static int32_t param76_init[] = {0}; |
| model->setOperandValue(param76, param76_init, sizeof(int32_t) * 1); |
| static float dummy77_init[] = {0.0f}; |
| model->setOperandValue(dummy77, dummy77_init, sizeof(float) * 1); |
| static int32_t param77_init[] = {0}; |
| model->setOperandValue(param77, param77_init, sizeof(int32_t) * 1); |
| static float dummy78_init[] = {0.0f}; |
| model->setOperandValue(dummy78, dummy78_init, sizeof(float) * 1); |
| static int32_t param78_init[] = {0}; |
| model->setOperandValue(param78, param78_init, sizeof(int32_t) * 1); |
| static float dummy79_init[] = {0.0f}; |
| model->setOperandValue(dummy79, dummy79_init, sizeof(float) * 1); |
| static int32_t param79_init[] = {0}; |
| model->setOperandValue(param79, param79_init, sizeof(int32_t) * 1); |
| static float dummy80_init[] = {0.0f}; |
| model->setOperandValue(dummy80, dummy80_init, sizeof(float) * 1); |
| static int32_t param80_init[] = {0}; |
| model->setOperandValue(param80, param80_init, sizeof(int32_t) * 1); |
| static float dummy81_init[] = {0.0f}; |
| model->setOperandValue(dummy81, dummy81_init, sizeof(float) * 1); |
| static int32_t param81_init[] = {0}; |
| model->setOperandValue(param81, param81_init, sizeof(int32_t) * 1); |
| static float dummy82_init[] = {0.0f}; |
| model->setOperandValue(dummy82, dummy82_init, sizeof(float) * 1); |
| static int32_t param82_init[] = {0}; |
| model->setOperandValue(param82, param82_init, sizeof(int32_t) * 1); |
| static float dummy83_init[] = {0.0f}; |
| model->setOperandValue(dummy83, dummy83_init, sizeof(float) * 1); |
| static int32_t param83_init[] = {0}; |
| model->setOperandValue(param83, param83_init, sizeof(int32_t) * 1); |
| static float dummy84_init[] = {0.0f}; |
| model->setOperandValue(dummy84, dummy84_init, sizeof(float) * 1); |
| static int32_t param84_init[] = {0}; |
| model->setOperandValue(param84, param84_init, sizeof(int32_t) * 1); |
| static float dummy85_init[] = {0.0f}; |
| model->setOperandValue(dummy85, dummy85_init, sizeof(float) * 1); |
| static int32_t param85_init[] = {0}; |
| model->setOperandValue(param85, param85_init, sizeof(int32_t) * 1); |
| static float dummy86_init[] = {0.0f}; |
| model->setOperandValue(dummy86, dummy86_init, sizeof(float) * 1); |
| static int32_t param86_init[] = {0}; |
| model->setOperandValue(param86, param86_init, sizeof(int32_t) * 1); |
| static float dummy87_init[] = {0.0f}; |
| model->setOperandValue(dummy87, dummy87_init, sizeof(float) * 1); |
| static int32_t param87_init[] = {0}; |
| model->setOperandValue(param87, param87_init, sizeof(int32_t) * 1); |
| static float dummy88_init[] = {0.0f}; |
| model->setOperandValue(dummy88, dummy88_init, sizeof(float) * 1); |
| static int32_t param88_init[] = {0}; |
| model->setOperandValue(param88, param88_init, sizeof(int32_t) * 1); |
| static float dummy89_init[] = {0.0f}; |
| model->setOperandValue(dummy89, dummy89_init, sizeof(float) * 1); |
| static int32_t param89_init[] = {0}; |
| model->setOperandValue(param89, param89_init, sizeof(int32_t) * 1); |
| static float dummy90_init[] = {0.0f}; |
| model->setOperandValue(dummy90, dummy90_init, sizeof(float) * 1); |
| static int32_t param90_init[] = {0}; |
| model->setOperandValue(param90, param90_init, sizeof(int32_t) * 1); |
| static float dummy91_init[] = {0.0f}; |
| model->setOperandValue(dummy91, dummy91_init, sizeof(float) * 1); |
| static int32_t param91_init[] = {0}; |
| model->setOperandValue(param91, param91_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_tmp, dummy69, param69}, {input}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_input_weights_tmp, dummy70, param70}, {input_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights_tmp, dummy71, param71}, {input_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights_tmp, dummy72, param72}, {input_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights_tmp, dummy73, param73}, {input_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_intput_weights_tmp, dummy74, param74}, {recurrent_to_intput_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights_tmp, dummy75, param75}, {recurrent_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights_tmp, dummy76, param76}, {recurrent_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights_tmp, dummy77, param77}, {recurrent_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_input_weights_tmp, dummy78, param78}, {cell_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights_tmp, dummy79, param79}, {cell_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights_tmp, dummy80, param80}, {cell_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_gate_bias_tmp, dummy81, param81}, {input_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias_tmp, dummy82, param82}, {forget_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias_tmp, dummy83, param83}, {cell_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias_tmp, dummy84, param84}, {output_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights_tmp, dummy85, param85}, {projection_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in_tmp, dummy86, param86}, {output_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in_tmp, dummy87, param87}, {cell_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_layer_norm_weights_tmp, dummy88, param88}, {input_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights_tmp, dummy89, param89}, {forget_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights_tmp, dummy90, param90}, {cell_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights_tmp, dummy91, param91}, {output_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {projection_bias, input_tmp, input_to_input_weights_tmp, input_to_forget_weights_tmp, input_to_cell_weights_tmp, input_to_output_weights_tmp, recurrent_to_intput_weights_tmp, recurrent_to_forget_weights_tmp, recurrent_to_cell_weights_tmp, recurrent_to_output_weights_tmp, cell_to_input_weights_tmp, cell_to_forget_weights_tmp, cell_to_output_weights_tmp, input_gate_bias_tmp, forget_gate_bias_tmp, cell_gate_bias_tmp, output_gate_bias_tmp, projection_weights_tmp, output_state_in_tmp, cell_state_in_tmp, input_layer_norm_weights_tmp, forget_layer_norm_weights_tmp, cell_layer_norm_weights_tmp, output_layer_norm_weights_tmp}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal_dynamic_output_shape_2(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_3(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type10(Type::TENSOR_FLOAT32, {2, 16}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type10); |
| auto output_state_out = model->addOperand(&type6); |
| auto cell_state_out = model->addOperand(&type7); |
| auto output = model->addOperand(&type6); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_3(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_dynamic_output_shape_3(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type11); |
| auto output_state_out = model->addOperand(&type11); |
| auto cell_state_out = model->addOperand(&type11); |
| auto output = model->addOperand(&type11); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal_3(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type10(Type::TENSOR_FLOAT32, {2, 16}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type10); |
| auto output_state_out = model->addOperand(&type6); |
| auto cell_state_out = model->addOperand(&type7); |
| auto output = model->addOperand(&type6); |
| auto input_tmp = model->addOperand(&type0); |
| auto dummy92 = model->addOperand(&type13); |
| auto param92 = model->addOperand(&type8); |
| auto input_to_input_weights_tmp = model->addOperand(&type1); |
| auto dummy93 = model->addOperand(&type13); |
| auto param93 = model->addOperand(&type8); |
| auto input_to_forget_weights_tmp = model->addOperand(&type1); |
| auto dummy94 = model->addOperand(&type13); |
| auto param94 = model->addOperand(&type8); |
| auto input_to_cell_weights_tmp = model->addOperand(&type1); |
| auto dummy95 = model->addOperand(&type13); |
| auto param95 = model->addOperand(&type8); |
| auto input_to_output_weights_tmp = model->addOperand(&type1); |
| auto dummy96 = model->addOperand(&type13); |
| auto param96 = model->addOperand(&type8); |
| auto recurrent_to_intput_weights_tmp = model->addOperand(&type2); |
| auto dummy97 = model->addOperand(&type13); |
| auto param97 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights_tmp = model->addOperand(&type2); |
| auto dummy98 = model->addOperand(&type13); |
| auto param98 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights_tmp = model->addOperand(&type2); |
| auto dummy99 = model->addOperand(&type13); |
| auto param99 = model->addOperand(&type8); |
| auto recurrent_to_output_weights_tmp = model->addOperand(&type2); |
| auto dummy100 = model->addOperand(&type13); |
| auto param100 = model->addOperand(&type8); |
| auto cell_to_input_weights_tmp = model->addOperand(&type3); |
| auto dummy101 = model->addOperand(&type13); |
| auto param101 = model->addOperand(&type8); |
| auto cell_to_forget_weights_tmp = model->addOperand(&type3); |
| auto dummy102 = model->addOperand(&type13); |
| auto param102 = model->addOperand(&type8); |
| auto cell_to_output_weights_tmp = model->addOperand(&type3); |
| auto dummy103 = model->addOperand(&type13); |
| auto param103 = model->addOperand(&type8); |
| auto input_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy104 = model->addOperand(&type13); |
| auto param104 = model->addOperand(&type8); |
| auto forget_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy105 = model->addOperand(&type13); |
| auto param105 = model->addOperand(&type8); |
| auto cell_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy106 = model->addOperand(&type13); |
| auto param106 = model->addOperand(&type8); |
| auto output_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy107 = model->addOperand(&type13); |
| auto param107 = model->addOperand(&type8); |
| auto projection_weights_tmp = model->addOperand(&type4); |
| auto dummy108 = model->addOperand(&type13); |
| auto param108 = model->addOperand(&type8); |
| auto output_state_in_tmp = model->addOperand(&type6); |
| auto dummy109 = model->addOperand(&type13); |
| auto param109 = model->addOperand(&type8); |
| auto cell_state_in_tmp = model->addOperand(&type7); |
| auto dummy110 = model->addOperand(&type13); |
| auto param110 = model->addOperand(&type8); |
| auto input_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy111 = model->addOperand(&type13); |
| auto param111 = model->addOperand(&type8); |
| auto forget_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy112 = model->addOperand(&type13); |
| auto param112 = model->addOperand(&type8); |
| auto cell_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy113 = model->addOperand(&type13); |
| auto param113 = model->addOperand(&type8); |
| auto output_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy114 = model->addOperand(&type13); |
| auto param114 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| static float dummy92_init[] = {0.0f}; |
| model->setOperandValue(dummy92, dummy92_init, sizeof(float) * 1); |
| static int32_t param92_init[] = {0}; |
| model->setOperandValue(param92, param92_init, sizeof(int32_t) * 1); |
| static float dummy93_init[] = {0.0f}; |
| model->setOperandValue(dummy93, dummy93_init, sizeof(float) * 1); |
| static int32_t param93_init[] = {0}; |
| model->setOperandValue(param93, param93_init, sizeof(int32_t) * 1); |
| static float dummy94_init[] = {0.0f}; |
| model->setOperandValue(dummy94, dummy94_init, sizeof(float) * 1); |
| static int32_t param94_init[] = {0}; |
| model->setOperandValue(param94, param94_init, sizeof(int32_t) * 1); |
| static float dummy95_init[] = {0.0f}; |
| model->setOperandValue(dummy95, dummy95_init, sizeof(float) * 1); |
| static int32_t param95_init[] = {0}; |
| model->setOperandValue(param95, param95_init, sizeof(int32_t) * 1); |
| static float dummy96_init[] = {0.0f}; |
| model->setOperandValue(dummy96, dummy96_init, sizeof(float) * 1); |
| static int32_t param96_init[] = {0}; |
| model->setOperandValue(param96, param96_init, sizeof(int32_t) * 1); |
| static float dummy97_init[] = {0.0f}; |
| model->setOperandValue(dummy97, dummy97_init, sizeof(float) * 1); |
| static int32_t param97_init[] = {0}; |
| model->setOperandValue(param97, param97_init, sizeof(int32_t) * 1); |
| static float dummy98_init[] = {0.0f}; |
| model->setOperandValue(dummy98, dummy98_init, sizeof(float) * 1); |
| static int32_t param98_init[] = {0}; |
| model->setOperandValue(param98, param98_init, sizeof(int32_t) * 1); |
| static float dummy99_init[] = {0.0f}; |
| model->setOperandValue(dummy99, dummy99_init, sizeof(float) * 1); |
| static int32_t param99_init[] = {0}; |
| model->setOperandValue(param99, param99_init, sizeof(int32_t) * 1); |
| static float dummy100_init[] = {0.0f}; |
| model->setOperandValue(dummy100, dummy100_init, sizeof(float) * 1); |
| static int32_t param100_init[] = {0}; |
| model->setOperandValue(param100, param100_init, sizeof(int32_t) * 1); |
| static float dummy101_init[] = {0.0f}; |
| model->setOperandValue(dummy101, dummy101_init, sizeof(float) * 1); |
| static int32_t param101_init[] = {0}; |
| model->setOperandValue(param101, param101_init, sizeof(int32_t) * 1); |
| static float dummy102_init[] = {0.0f}; |
| model->setOperandValue(dummy102, dummy102_init, sizeof(float) * 1); |
| static int32_t param102_init[] = {0}; |
| model->setOperandValue(param102, param102_init, sizeof(int32_t) * 1); |
| static float dummy103_init[] = {0.0f}; |
| model->setOperandValue(dummy103, dummy103_init, sizeof(float) * 1); |
| static int32_t param103_init[] = {0}; |
| model->setOperandValue(param103, param103_init, sizeof(int32_t) * 1); |
| static float dummy104_init[] = {0.0f}; |
| model->setOperandValue(dummy104, dummy104_init, sizeof(float) * 1); |
| static int32_t param104_init[] = {0}; |
| model->setOperandValue(param104, param104_init, sizeof(int32_t) * 1); |
| static float dummy105_init[] = {0.0f}; |
| model->setOperandValue(dummy105, dummy105_init, sizeof(float) * 1); |
| static int32_t param105_init[] = {0}; |
| model->setOperandValue(param105, param105_init, sizeof(int32_t) * 1); |
| static float dummy106_init[] = {0.0f}; |
| model->setOperandValue(dummy106, dummy106_init, sizeof(float) * 1); |
| static int32_t param106_init[] = {0}; |
| model->setOperandValue(param106, param106_init, sizeof(int32_t) * 1); |
| static float dummy107_init[] = {0.0f}; |
| model->setOperandValue(dummy107, dummy107_init, sizeof(float) * 1); |
| static int32_t param107_init[] = {0}; |
| model->setOperandValue(param107, param107_init, sizeof(int32_t) * 1); |
| static float dummy108_init[] = {0.0f}; |
| model->setOperandValue(dummy108, dummy108_init, sizeof(float) * 1); |
| static int32_t param108_init[] = {0}; |
| model->setOperandValue(param108, param108_init, sizeof(int32_t) * 1); |
| static float dummy109_init[] = {0.0f}; |
| model->setOperandValue(dummy109, dummy109_init, sizeof(float) * 1); |
| static int32_t param109_init[] = {0}; |
| model->setOperandValue(param109, param109_init, sizeof(int32_t) * 1); |
| static float dummy110_init[] = {0.0f}; |
| model->setOperandValue(dummy110, dummy110_init, sizeof(float) * 1); |
| static int32_t param110_init[] = {0}; |
| model->setOperandValue(param110, param110_init, sizeof(int32_t) * 1); |
| static float dummy111_init[] = {0.0f}; |
| model->setOperandValue(dummy111, dummy111_init, sizeof(float) * 1); |
| static int32_t param111_init[] = {0}; |
| model->setOperandValue(param111, param111_init, sizeof(int32_t) * 1); |
| static float dummy112_init[] = {0.0f}; |
| model->setOperandValue(dummy112, dummy112_init, sizeof(float) * 1); |
| static int32_t param112_init[] = {0}; |
| model->setOperandValue(param112, param112_init, sizeof(int32_t) * 1); |
| static float dummy113_init[] = {0.0f}; |
| model->setOperandValue(dummy113, dummy113_init, sizeof(float) * 1); |
| static int32_t param113_init[] = {0}; |
| model->setOperandValue(param113, param113_init, sizeof(int32_t) * 1); |
| static float dummy114_init[] = {0.0f}; |
| model->setOperandValue(dummy114, dummy114_init, sizeof(float) * 1); |
| static int32_t param114_init[] = {0}; |
| model->setOperandValue(param114, param114_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_tmp, dummy92, param92}, {input}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_input_weights_tmp, dummy93, param93}, {input_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights_tmp, dummy94, param94}, {input_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights_tmp, dummy95, param95}, {input_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights_tmp, dummy96, param96}, {input_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_intput_weights_tmp, dummy97, param97}, {recurrent_to_intput_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights_tmp, dummy98, param98}, {recurrent_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights_tmp, dummy99, param99}, {recurrent_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights_tmp, dummy100, param100}, {recurrent_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_input_weights_tmp, dummy101, param101}, {cell_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights_tmp, dummy102, param102}, {cell_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights_tmp, dummy103, param103}, {cell_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_gate_bias_tmp, dummy104, param104}, {input_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias_tmp, dummy105, param105}, {forget_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias_tmp, dummy106, param106}, {cell_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias_tmp, dummy107, param107}, {output_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights_tmp, dummy108, param108}, {projection_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in_tmp, dummy109, param109}, {output_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in_tmp, dummy110, param110}, {cell_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_layer_norm_weights_tmp, dummy111, param111}, {input_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights_tmp, dummy112, param112}, {forget_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights_tmp, dummy113, param113}, {cell_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights_tmp, dummy114, param114}, {output_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {projection_bias, input_tmp, input_to_input_weights_tmp, input_to_forget_weights_tmp, input_to_cell_weights_tmp, input_to_output_weights_tmp, recurrent_to_intput_weights_tmp, recurrent_to_forget_weights_tmp, recurrent_to_cell_weights_tmp, recurrent_to_output_weights_tmp, cell_to_input_weights_tmp, cell_to_forget_weights_tmp, cell_to_output_weights_tmp, input_gate_bias_tmp, forget_gate_bias_tmp, cell_gate_bias_tmp, output_gate_bias_tmp, projection_weights_tmp, output_state_in_tmp, cell_state_in_tmp, input_layer_norm_weights_tmp, forget_layer_norm_weights_tmp, cell_layer_norm_weights_tmp, output_layer_norm_weights_tmp}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal_3(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal_dynamic_output_shape_3(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input = model->addOperand(&type0); |
| auto input_to_input_weights = model->addOperand(&type1); |
| auto input_to_forget_weights = model->addOperand(&type1); |
| auto input_to_cell_weights = model->addOperand(&type1); |
| auto input_to_output_weights = model->addOperand(&type1); |
| auto recurrent_to_intput_weights = model->addOperand(&type2); |
| auto recurrent_to_forget_weights = model->addOperand(&type2); |
| auto recurrent_to_cell_weights = model->addOperand(&type2); |
| auto recurrent_to_output_weights = model->addOperand(&type2); |
| auto cell_to_input_weights = model->addOperand(&type3); |
| auto cell_to_forget_weights = model->addOperand(&type3); |
| auto cell_to_output_weights = model->addOperand(&type3); |
| auto input_gate_bias = model->addOperand(&type3); |
| auto forget_gate_bias = model->addOperand(&type3); |
| auto cell_gate_bias = model->addOperand(&type3); |
| auto output_gate_bias = model->addOperand(&type3); |
| auto projection_weights = model->addOperand(&type4); |
| auto projection_bias = model->addOperand(&type5); |
| auto output_state_in = model->addOperand(&type6); |
| auto cell_state_in = model->addOperand(&type7); |
| auto activation_param = model->addOperand(&type8); |
| auto cell_clip_param = model->addOperand(&type9); |
| auto proj_clip_param = model->addOperand(&type9); |
| auto input_layer_norm_weights = model->addOperand(&type3); |
| auto forget_layer_norm_weights = model->addOperand(&type3); |
| auto cell_layer_norm_weights = model->addOperand(&type3); |
| auto output_layer_norm_weights = model->addOperand(&type3); |
| auto scratch_buffer = model->addOperand(&type11); |
| auto output_state_out = model->addOperand(&type11); |
| auto cell_state_out = model->addOperand(&type11); |
| auto output = model->addOperand(&type11); |
| auto input_tmp = model->addOperand(&type0); |
| auto dummy115 = model->addOperand(&type13); |
| auto param115 = model->addOperand(&type8); |
| auto input_to_input_weights_tmp = model->addOperand(&type1); |
| auto dummy116 = model->addOperand(&type13); |
| auto param116 = model->addOperand(&type8); |
| auto input_to_forget_weights_tmp = model->addOperand(&type1); |
| auto dummy117 = model->addOperand(&type13); |
| auto param117 = model->addOperand(&type8); |
| auto input_to_cell_weights_tmp = model->addOperand(&type1); |
| auto dummy118 = model->addOperand(&type13); |
| auto param118 = model->addOperand(&type8); |
| auto input_to_output_weights_tmp = model->addOperand(&type1); |
| auto dummy119 = model->addOperand(&type13); |
| auto param119 = model->addOperand(&type8); |
| auto recurrent_to_intput_weights_tmp = model->addOperand(&type2); |
| auto dummy120 = model->addOperand(&type13); |
| auto param120 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights_tmp = model->addOperand(&type2); |
| auto dummy121 = model->addOperand(&type13); |
| auto param121 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights_tmp = model->addOperand(&type2); |
| auto dummy122 = model->addOperand(&type13); |
| auto param122 = model->addOperand(&type8); |
| auto recurrent_to_output_weights_tmp = model->addOperand(&type2); |
| auto dummy123 = model->addOperand(&type13); |
| auto param123 = model->addOperand(&type8); |
| auto cell_to_input_weights_tmp = model->addOperand(&type3); |
| auto dummy124 = model->addOperand(&type13); |
| auto param124 = model->addOperand(&type8); |
| auto cell_to_forget_weights_tmp = model->addOperand(&type3); |
| auto dummy125 = model->addOperand(&type13); |
| auto param125 = model->addOperand(&type8); |
| auto cell_to_output_weights_tmp = model->addOperand(&type3); |
| auto dummy126 = model->addOperand(&type13); |
| auto param126 = model->addOperand(&type8); |
| auto input_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy127 = model->addOperand(&type13); |
| auto param127 = model->addOperand(&type8); |
| auto forget_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy128 = model->addOperand(&type13); |
| auto param128 = model->addOperand(&type8); |
| auto cell_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy129 = model->addOperand(&type13); |
| auto param129 = model->addOperand(&type8); |
| auto output_gate_bias_tmp = model->addOperand(&type3); |
| auto dummy130 = model->addOperand(&type13); |
| auto param130 = model->addOperand(&type8); |
| auto projection_weights_tmp = model->addOperand(&type4); |
| auto dummy131 = model->addOperand(&type13); |
| auto param131 = model->addOperand(&type8); |
| auto output_state_in_tmp = model->addOperand(&type6); |
| auto dummy132 = model->addOperand(&type13); |
| auto param132 = model->addOperand(&type8); |
| auto cell_state_in_tmp = model->addOperand(&type7); |
| auto dummy133 = model->addOperand(&type13); |
| auto param133 = model->addOperand(&type8); |
| auto input_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy134 = model->addOperand(&type13); |
| auto param134 = model->addOperand(&type8); |
| auto forget_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy135 = model->addOperand(&type13); |
| auto param135 = model->addOperand(&type8); |
| auto cell_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy136 = model->addOperand(&type13); |
| auto param136 = model->addOperand(&type8); |
| auto output_layer_norm_weights_tmp = model->addOperand(&type3); |
| auto dummy137 = model->addOperand(&type13); |
| auto param137 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param_init[] = {4}; |
| model->setOperandValue(activation_param, activation_param_init, sizeof(int32_t) * 1); |
| static float cell_clip_param_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param, cell_clip_param_init, sizeof(float) * 1); |
| static float proj_clip_param_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param, proj_clip_param_init, sizeof(float) * 1); |
| static float dummy115_init[] = {0.0f}; |
| model->setOperandValue(dummy115, dummy115_init, sizeof(float) * 1); |
| static int32_t param115_init[] = {0}; |
| model->setOperandValue(param115, param115_init, sizeof(int32_t) * 1); |
| static float dummy116_init[] = {0.0f}; |
| model->setOperandValue(dummy116, dummy116_init, sizeof(float) * 1); |
| static int32_t param116_init[] = {0}; |
| model->setOperandValue(param116, param116_init, sizeof(int32_t) * 1); |
| static float dummy117_init[] = {0.0f}; |
| model->setOperandValue(dummy117, dummy117_init, sizeof(float) * 1); |
| static int32_t param117_init[] = {0}; |
| model->setOperandValue(param117, param117_init, sizeof(int32_t) * 1); |
| static float dummy118_init[] = {0.0f}; |
| model->setOperandValue(dummy118, dummy118_init, sizeof(float) * 1); |
| static int32_t param118_init[] = {0}; |
| model->setOperandValue(param118, param118_init, sizeof(int32_t) * 1); |
| static float dummy119_init[] = {0.0f}; |
| model->setOperandValue(dummy119, dummy119_init, sizeof(float) * 1); |
| static int32_t param119_init[] = {0}; |
| model->setOperandValue(param119, param119_init, sizeof(int32_t) * 1); |
| static float dummy120_init[] = {0.0f}; |
| model->setOperandValue(dummy120, dummy120_init, sizeof(float) * 1); |
| static int32_t param120_init[] = {0}; |
| model->setOperandValue(param120, param120_init, sizeof(int32_t) * 1); |
| static float dummy121_init[] = {0.0f}; |
| model->setOperandValue(dummy121, dummy121_init, sizeof(float) * 1); |
| static int32_t param121_init[] = {0}; |
| model->setOperandValue(param121, param121_init, sizeof(int32_t) * 1); |
| static float dummy122_init[] = {0.0f}; |
| model->setOperandValue(dummy122, dummy122_init, sizeof(float) * 1); |
| static int32_t param122_init[] = {0}; |
| model->setOperandValue(param122, param122_init, sizeof(int32_t) * 1); |
| static float dummy123_init[] = {0.0f}; |
| model->setOperandValue(dummy123, dummy123_init, sizeof(float) * 1); |
| static int32_t param123_init[] = {0}; |
| model->setOperandValue(param123, param123_init, sizeof(int32_t) * 1); |
| static float dummy124_init[] = {0.0f}; |
| model->setOperandValue(dummy124, dummy124_init, sizeof(float) * 1); |
| static int32_t param124_init[] = {0}; |
| model->setOperandValue(param124, param124_init, sizeof(int32_t) * 1); |
| static float dummy125_init[] = {0.0f}; |
| model->setOperandValue(dummy125, dummy125_init, sizeof(float) * 1); |
| static int32_t param125_init[] = {0}; |
| model->setOperandValue(param125, param125_init, sizeof(int32_t) * 1); |
| static float dummy126_init[] = {0.0f}; |
| model->setOperandValue(dummy126, dummy126_init, sizeof(float) * 1); |
| static int32_t param126_init[] = {0}; |
| model->setOperandValue(param126, param126_init, sizeof(int32_t) * 1); |
| static float dummy127_init[] = {0.0f}; |
| model->setOperandValue(dummy127, dummy127_init, sizeof(float) * 1); |
| static int32_t param127_init[] = {0}; |
| model->setOperandValue(param127, param127_init, sizeof(int32_t) * 1); |
| static float dummy128_init[] = {0.0f}; |
| model->setOperandValue(dummy128, dummy128_init, sizeof(float) * 1); |
| static int32_t param128_init[] = {0}; |
| model->setOperandValue(param128, param128_init, sizeof(int32_t) * 1); |
| static float dummy129_init[] = {0.0f}; |
| model->setOperandValue(dummy129, dummy129_init, sizeof(float) * 1); |
| static int32_t param129_init[] = {0}; |
| model->setOperandValue(param129, param129_init, sizeof(int32_t) * 1); |
| static float dummy130_init[] = {0.0f}; |
| model->setOperandValue(dummy130, dummy130_init, sizeof(float) * 1); |
| static int32_t param130_init[] = {0}; |
| model->setOperandValue(param130, param130_init, sizeof(int32_t) * 1); |
| static float dummy131_init[] = {0.0f}; |
| model->setOperandValue(dummy131, dummy131_init, sizeof(float) * 1); |
| static int32_t param131_init[] = {0}; |
| model->setOperandValue(param131, param131_init, sizeof(int32_t) * 1); |
| static float dummy132_init[] = {0.0f}; |
| model->setOperandValue(dummy132, dummy132_init, sizeof(float) * 1); |
| static int32_t param132_init[] = {0}; |
| model->setOperandValue(param132, param132_init, sizeof(int32_t) * 1); |
| static float dummy133_init[] = {0.0f}; |
| model->setOperandValue(dummy133, dummy133_init, sizeof(float) * 1); |
| static int32_t param133_init[] = {0}; |
| model->setOperandValue(param133, param133_init, sizeof(int32_t) * 1); |
| static float dummy134_init[] = {0.0f}; |
| model->setOperandValue(dummy134, dummy134_init, sizeof(float) * 1); |
| static int32_t param134_init[] = {0}; |
| model->setOperandValue(param134, param134_init, sizeof(int32_t) * 1); |
| static float dummy135_init[] = {0.0f}; |
| model->setOperandValue(dummy135, dummy135_init, sizeof(float) * 1); |
| static int32_t param135_init[] = {0}; |
| model->setOperandValue(param135, param135_init, sizeof(int32_t) * 1); |
| static float dummy136_init[] = {0.0f}; |
| model->setOperandValue(dummy136, dummy136_init, sizeof(float) * 1); |
| static int32_t param136_init[] = {0}; |
| model->setOperandValue(param136, param136_init, sizeof(int32_t) * 1); |
| static float dummy137_init[] = {0.0f}; |
| model->setOperandValue(dummy137, dummy137_init, sizeof(float) * 1); |
| static int32_t param137_init[] = {0}; |
| model->setOperandValue(param137, param137_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_tmp, dummy115, param115}, {input}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_input_weights_tmp, dummy116, param116}, {input_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights_tmp, dummy117, param117}, {input_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights_tmp, dummy118, param118}, {input_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights_tmp, dummy119, param119}, {input_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_intput_weights_tmp, dummy120, param120}, {recurrent_to_intput_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights_tmp, dummy121, param121}, {recurrent_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights_tmp, dummy122, param122}, {recurrent_to_cell_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights_tmp, dummy123, param123}, {recurrent_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_input_weights_tmp, dummy124, param124}, {cell_to_input_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights_tmp, dummy125, param125}, {cell_to_forget_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights_tmp, dummy126, param126}, {cell_to_output_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_gate_bias_tmp, dummy127, param127}, {input_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias_tmp, dummy128, param128}, {forget_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias_tmp, dummy129, param129}, {cell_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias_tmp, dummy130, param130}, {output_gate_bias}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights_tmp, dummy131, param131}, {projection_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in_tmp, dummy132, param132}, {output_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in_tmp, dummy133, param133}, {cell_state_in}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_layer_norm_weights_tmp, dummy134, param134}, {input_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights_tmp, dummy135, param135}, {forget_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights_tmp, dummy136, param136}, {cell_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights_tmp, dummy137, param137}, {output_layer_norm_weights}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param, input_layer_norm_weights, forget_layer_norm_weights, cell_layer_norm_weights, output_layer_norm_weights}, {scratch_buffer, output_state_out, cell_state_out, output}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {projection_bias, input_tmp, input_to_input_weights_tmp, input_to_forget_weights_tmp, input_to_cell_weights_tmp, input_to_output_weights_tmp, recurrent_to_intput_weights_tmp, recurrent_to_forget_weights_tmp, recurrent_to_cell_weights_tmp, recurrent_to_output_weights_tmp, cell_to_input_weights_tmp, cell_to_forget_weights_tmp, cell_to_output_weights_tmp, input_gate_bias_tmp, forget_gate_bias_tmp, cell_gate_bias_tmp, output_gate_bias_tmp, projection_weights_tmp, output_state_in_tmp, cell_state_in_tmp, input_layer_norm_weights_tmp, forget_layer_norm_weights_tmp, cell_layer_norm_weights_tmp, output_layer_norm_weights_tmp}, |
| {scratch_buffer, output_state_out, cell_state_out, output}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {0}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_4(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type12(Type::TENSOR_FLOAT32, {2, 12}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type12); |
| auto output_state_out1 = model->addOperand(&type6); |
| auto cell_state_out1 = model->addOperand(&type7); |
| auto output1 = model->addOperand(&type6); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_4(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_dynamic_output_shape_4(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type11); |
| auto output_state_out1 = model->addOperand(&type11); |
| auto cell_state_out1 = model->addOperand(&type11); |
| auto output1 = model->addOperand(&type11); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_dynamic_output_shape_4(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal_4(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type12(Type::TENSOR_FLOAT32, {2, 12}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type12); |
| auto output_state_out1 = model->addOperand(&type6); |
| auto cell_state_out1 = model->addOperand(&type7); |
| auto output1 = model->addOperand(&type6); |
| auto input1_tmp = model->addOperand(&type0); |
| auto dummy138 = model->addOperand(&type13); |
| auto param138 = model->addOperand(&type8); |
| auto input_to_forget_weights1_tmp = model->addOperand(&type1); |
| auto dummy139 = model->addOperand(&type13); |
| auto param139 = model->addOperand(&type8); |
| auto input_to_cell_weights1_tmp = model->addOperand(&type1); |
| auto dummy140 = model->addOperand(&type13); |
| auto param140 = model->addOperand(&type8); |
| auto input_to_output_weights1_tmp = model->addOperand(&type1); |
| auto dummy141 = model->addOperand(&type13); |
| auto param141 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights1_tmp = model->addOperand(&type2); |
| auto dummy142 = model->addOperand(&type13); |
| auto param142 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights1_tmp = model->addOperand(&type2); |
| auto dummy143 = model->addOperand(&type13); |
| auto param143 = model->addOperand(&type8); |
| auto recurrent_to_output_weights1_tmp = model->addOperand(&type2); |
| auto dummy144 = model->addOperand(&type13); |
| auto param144 = model->addOperand(&type8); |
| auto cell_to_forget_weights1_tmp = model->addOperand(&type3); |
| auto dummy145 = model->addOperand(&type13); |
| auto param145 = model->addOperand(&type8); |
| auto cell_to_output_weights1_tmp = model->addOperand(&type3); |
| auto dummy146 = model->addOperand(&type13); |
| auto param146 = model->addOperand(&type8); |
| auto forget_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy147 = model->addOperand(&type13); |
| auto param147 = model->addOperand(&type8); |
| auto cell_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy148 = model->addOperand(&type13); |
| auto param148 = model->addOperand(&type8); |
| auto output_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy149 = model->addOperand(&type13); |
| auto param149 = model->addOperand(&type8); |
| auto projection_weights1_tmp = model->addOperand(&type4); |
| auto dummy150 = model->addOperand(&type13); |
| auto param150 = model->addOperand(&type8); |
| auto output_state_in1_tmp = model->addOperand(&type6); |
| auto dummy151 = model->addOperand(&type13); |
| auto param151 = model->addOperand(&type8); |
| auto cell_state_in1_tmp = model->addOperand(&type7); |
| auto dummy152 = model->addOperand(&type13); |
| auto param152 = model->addOperand(&type8); |
| auto forget_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy153 = model->addOperand(&type13); |
| auto param153 = model->addOperand(&type8); |
| auto cell_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy154 = model->addOperand(&type13); |
| auto param154 = model->addOperand(&type8); |
| auto output_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy155 = model->addOperand(&type13); |
| auto param155 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| static float dummy138_init[] = {0.0f}; |
| model->setOperandValue(dummy138, dummy138_init, sizeof(float) * 1); |
| static int32_t param138_init[] = {0}; |
| model->setOperandValue(param138, param138_init, sizeof(int32_t) * 1); |
| static float dummy139_init[] = {0.0f}; |
| model->setOperandValue(dummy139, dummy139_init, sizeof(float) * 1); |
| static int32_t param139_init[] = {0}; |
| model->setOperandValue(param139, param139_init, sizeof(int32_t) * 1); |
| static float dummy140_init[] = {0.0f}; |
| model->setOperandValue(dummy140, dummy140_init, sizeof(float) * 1); |
| static int32_t param140_init[] = {0}; |
| model->setOperandValue(param140, param140_init, sizeof(int32_t) * 1); |
| static float dummy141_init[] = {0.0f}; |
| model->setOperandValue(dummy141, dummy141_init, sizeof(float) * 1); |
| static int32_t param141_init[] = {0}; |
| model->setOperandValue(param141, param141_init, sizeof(int32_t) * 1); |
| static float dummy142_init[] = {0.0f}; |
| model->setOperandValue(dummy142, dummy142_init, sizeof(float) * 1); |
| static int32_t param142_init[] = {0}; |
| model->setOperandValue(param142, param142_init, sizeof(int32_t) * 1); |
| static float dummy143_init[] = {0.0f}; |
| model->setOperandValue(dummy143, dummy143_init, sizeof(float) * 1); |
| static int32_t param143_init[] = {0}; |
| model->setOperandValue(param143, param143_init, sizeof(int32_t) * 1); |
| static float dummy144_init[] = {0.0f}; |
| model->setOperandValue(dummy144, dummy144_init, sizeof(float) * 1); |
| static int32_t param144_init[] = {0}; |
| model->setOperandValue(param144, param144_init, sizeof(int32_t) * 1); |
| static float dummy145_init[] = {0.0f}; |
| model->setOperandValue(dummy145, dummy145_init, sizeof(float) * 1); |
| static int32_t param145_init[] = {0}; |
| model->setOperandValue(param145, param145_init, sizeof(int32_t) * 1); |
| static float dummy146_init[] = {0.0f}; |
| model->setOperandValue(dummy146, dummy146_init, sizeof(float) * 1); |
| static int32_t param146_init[] = {0}; |
| model->setOperandValue(param146, param146_init, sizeof(int32_t) * 1); |
| static float dummy147_init[] = {0.0f}; |
| model->setOperandValue(dummy147, dummy147_init, sizeof(float) * 1); |
| static int32_t param147_init[] = {0}; |
| model->setOperandValue(param147, param147_init, sizeof(int32_t) * 1); |
| static float dummy148_init[] = {0.0f}; |
| model->setOperandValue(dummy148, dummy148_init, sizeof(float) * 1); |
| static int32_t param148_init[] = {0}; |
| model->setOperandValue(param148, param148_init, sizeof(int32_t) * 1); |
| static float dummy149_init[] = {0.0f}; |
| model->setOperandValue(dummy149, dummy149_init, sizeof(float) * 1); |
| static int32_t param149_init[] = {0}; |
| model->setOperandValue(param149, param149_init, sizeof(int32_t) * 1); |
| static float dummy150_init[] = {0.0f}; |
| model->setOperandValue(dummy150, dummy150_init, sizeof(float) * 1); |
| static int32_t param150_init[] = {0}; |
| model->setOperandValue(param150, param150_init, sizeof(int32_t) * 1); |
| static float dummy151_init[] = {0.0f}; |
| model->setOperandValue(dummy151, dummy151_init, sizeof(float) * 1); |
| static int32_t param151_init[] = {0}; |
| model->setOperandValue(param151, param151_init, sizeof(int32_t) * 1); |
| static float dummy152_init[] = {0.0f}; |
| model->setOperandValue(dummy152, dummy152_init, sizeof(float) * 1); |
| static int32_t param152_init[] = {0}; |
| model->setOperandValue(param152, param152_init, sizeof(int32_t) * 1); |
| static float dummy153_init[] = {0.0f}; |
| model->setOperandValue(dummy153, dummy153_init, sizeof(float) * 1); |
| static int32_t param153_init[] = {0}; |
| model->setOperandValue(param153, param153_init, sizeof(int32_t) * 1); |
| static float dummy154_init[] = {0.0f}; |
| model->setOperandValue(dummy154, dummy154_init, sizeof(float) * 1); |
| static int32_t param154_init[] = {0}; |
| model->setOperandValue(param154, param154_init, sizeof(int32_t) * 1); |
| static float dummy155_init[] = {0.0f}; |
| model->setOperandValue(dummy155, dummy155_init, sizeof(float) * 1); |
| static int32_t param155_init[] = {0}; |
| model->setOperandValue(param155, param155_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input1_tmp, dummy138, param138}, {input1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights1_tmp, dummy139, param139}, {input_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights1_tmp, dummy140, param140}, {input_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights1_tmp, dummy141, param141}, {input_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights1_tmp, dummy142, param142}, {recurrent_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights1_tmp, dummy143, param143}, {recurrent_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights1_tmp, dummy144, param144}, {recurrent_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights1_tmp, dummy145, param145}, {cell_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights1_tmp, dummy146, param146}, {cell_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias1_tmp, dummy147, param147}, {forget_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias1_tmp, dummy148, param148}, {cell_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias1_tmp, dummy149, param149}, {output_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights1_tmp, dummy150, param150}, {projection_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in1_tmp, dummy151, param151}, {output_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in1_tmp, dummy152, param152}, {cell_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights1_tmp, dummy153, param153}, {forget_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights1_tmp, dummy154, param154}, {cell_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights1_tmp, dummy155, param155}, {output_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input_to_input_weights1, recurrent_to_intput_weights1, cell_to_input_weights1, input_gate_bias1, projection_bias1, input_layer_norm_weights1, input1_tmp, input_to_forget_weights1_tmp, input_to_cell_weights1_tmp, input_to_output_weights1_tmp, recurrent_to_forget_weights1_tmp, recurrent_to_cell_weights1_tmp, recurrent_to_output_weights1_tmp, cell_to_forget_weights1_tmp, cell_to_output_weights1_tmp, forget_gate_bias1_tmp, cell_gate_bias1_tmp, output_gate_bias1_tmp, projection_weights1_tmp, output_state_in1_tmp, cell_state_in1_tmp, forget_layer_norm_weights1_tmp, cell_layer_norm_weights1_tmp, output_layer_norm_weights1_tmp}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal_4(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal_dynamic_output_shape_4(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type11); |
| auto output_state_out1 = model->addOperand(&type11); |
| auto cell_state_out1 = model->addOperand(&type11); |
| auto output1 = model->addOperand(&type11); |
| auto input1_tmp = model->addOperand(&type0); |
| auto dummy156 = model->addOperand(&type13); |
| auto param156 = model->addOperand(&type8); |
| auto input_to_forget_weights1_tmp = model->addOperand(&type1); |
| auto dummy157 = model->addOperand(&type13); |
| auto param157 = model->addOperand(&type8); |
| auto input_to_cell_weights1_tmp = model->addOperand(&type1); |
| auto dummy158 = model->addOperand(&type13); |
| auto param158 = model->addOperand(&type8); |
| auto input_to_output_weights1_tmp = model->addOperand(&type1); |
| auto dummy159 = model->addOperand(&type13); |
| auto param159 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights1_tmp = model->addOperand(&type2); |
| auto dummy160 = model->addOperand(&type13); |
| auto param160 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights1_tmp = model->addOperand(&type2); |
| auto dummy161 = model->addOperand(&type13); |
| auto param161 = model->addOperand(&type8); |
| auto recurrent_to_output_weights1_tmp = model->addOperand(&type2); |
| auto dummy162 = model->addOperand(&type13); |
| auto param162 = model->addOperand(&type8); |
| auto cell_to_forget_weights1_tmp = model->addOperand(&type3); |
| auto dummy163 = model->addOperand(&type13); |
| auto param163 = model->addOperand(&type8); |
| auto cell_to_output_weights1_tmp = model->addOperand(&type3); |
| auto dummy164 = model->addOperand(&type13); |
| auto param164 = model->addOperand(&type8); |
| auto forget_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy165 = model->addOperand(&type13); |
| auto param165 = model->addOperand(&type8); |
| auto cell_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy166 = model->addOperand(&type13); |
| auto param166 = model->addOperand(&type8); |
| auto output_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy167 = model->addOperand(&type13); |
| auto param167 = model->addOperand(&type8); |
| auto projection_weights1_tmp = model->addOperand(&type4); |
| auto dummy168 = model->addOperand(&type13); |
| auto param168 = model->addOperand(&type8); |
| auto output_state_in1_tmp = model->addOperand(&type6); |
| auto dummy169 = model->addOperand(&type13); |
| auto param169 = model->addOperand(&type8); |
| auto cell_state_in1_tmp = model->addOperand(&type7); |
| auto dummy170 = model->addOperand(&type13); |
| auto param170 = model->addOperand(&type8); |
| auto forget_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy171 = model->addOperand(&type13); |
| auto param171 = model->addOperand(&type8); |
| auto cell_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy172 = model->addOperand(&type13); |
| auto param172 = model->addOperand(&type8); |
| auto output_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy173 = model->addOperand(&type13); |
| auto param173 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| static float dummy156_init[] = {0.0f}; |
| model->setOperandValue(dummy156, dummy156_init, sizeof(float) * 1); |
| static int32_t param156_init[] = {0}; |
| model->setOperandValue(param156, param156_init, sizeof(int32_t) * 1); |
| static float dummy157_init[] = {0.0f}; |
| model->setOperandValue(dummy157, dummy157_init, sizeof(float) * 1); |
| static int32_t param157_init[] = {0}; |
| model->setOperandValue(param157, param157_init, sizeof(int32_t) * 1); |
| static float dummy158_init[] = {0.0f}; |
| model->setOperandValue(dummy158, dummy158_init, sizeof(float) * 1); |
| static int32_t param158_init[] = {0}; |
| model->setOperandValue(param158, param158_init, sizeof(int32_t) * 1); |
| static float dummy159_init[] = {0.0f}; |
| model->setOperandValue(dummy159, dummy159_init, sizeof(float) * 1); |
| static int32_t param159_init[] = {0}; |
| model->setOperandValue(param159, param159_init, sizeof(int32_t) * 1); |
| static float dummy160_init[] = {0.0f}; |
| model->setOperandValue(dummy160, dummy160_init, sizeof(float) * 1); |
| static int32_t param160_init[] = {0}; |
| model->setOperandValue(param160, param160_init, sizeof(int32_t) * 1); |
| static float dummy161_init[] = {0.0f}; |
| model->setOperandValue(dummy161, dummy161_init, sizeof(float) * 1); |
| static int32_t param161_init[] = {0}; |
| model->setOperandValue(param161, param161_init, sizeof(int32_t) * 1); |
| static float dummy162_init[] = {0.0f}; |
| model->setOperandValue(dummy162, dummy162_init, sizeof(float) * 1); |
| static int32_t param162_init[] = {0}; |
| model->setOperandValue(param162, param162_init, sizeof(int32_t) * 1); |
| static float dummy163_init[] = {0.0f}; |
| model->setOperandValue(dummy163, dummy163_init, sizeof(float) * 1); |
| static int32_t param163_init[] = {0}; |
| model->setOperandValue(param163, param163_init, sizeof(int32_t) * 1); |
| static float dummy164_init[] = {0.0f}; |
| model->setOperandValue(dummy164, dummy164_init, sizeof(float) * 1); |
| static int32_t param164_init[] = {0}; |
| model->setOperandValue(param164, param164_init, sizeof(int32_t) * 1); |
| static float dummy165_init[] = {0.0f}; |
| model->setOperandValue(dummy165, dummy165_init, sizeof(float) * 1); |
| static int32_t param165_init[] = {0}; |
| model->setOperandValue(param165, param165_init, sizeof(int32_t) * 1); |
| static float dummy166_init[] = {0.0f}; |
| model->setOperandValue(dummy166, dummy166_init, sizeof(float) * 1); |
| static int32_t param166_init[] = {0}; |
| model->setOperandValue(param166, param166_init, sizeof(int32_t) * 1); |
| static float dummy167_init[] = {0.0f}; |
| model->setOperandValue(dummy167, dummy167_init, sizeof(float) * 1); |
| static int32_t param167_init[] = {0}; |
| model->setOperandValue(param167, param167_init, sizeof(int32_t) * 1); |
| static float dummy168_init[] = {0.0f}; |
| model->setOperandValue(dummy168, dummy168_init, sizeof(float) * 1); |
| static int32_t param168_init[] = {0}; |
| model->setOperandValue(param168, param168_init, sizeof(int32_t) * 1); |
| static float dummy169_init[] = {0.0f}; |
| model->setOperandValue(dummy169, dummy169_init, sizeof(float) * 1); |
| static int32_t param169_init[] = {0}; |
| model->setOperandValue(param169, param169_init, sizeof(int32_t) * 1); |
| static float dummy170_init[] = {0.0f}; |
| model->setOperandValue(dummy170, dummy170_init, sizeof(float) * 1); |
| static int32_t param170_init[] = {0}; |
| model->setOperandValue(param170, param170_init, sizeof(int32_t) * 1); |
| static float dummy171_init[] = {0.0f}; |
| model->setOperandValue(dummy171, dummy171_init, sizeof(float) * 1); |
| static int32_t param171_init[] = {0}; |
| model->setOperandValue(param171, param171_init, sizeof(int32_t) * 1); |
| static float dummy172_init[] = {0.0f}; |
| model->setOperandValue(dummy172, dummy172_init, sizeof(float) * 1); |
| static int32_t param172_init[] = {0}; |
| model->setOperandValue(param172, param172_init, sizeof(int32_t) * 1); |
| static float dummy173_init[] = {0.0f}; |
| model->setOperandValue(dummy173, dummy173_init, sizeof(float) * 1); |
| static int32_t param173_init[] = {0}; |
| model->setOperandValue(param173, param173_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input1_tmp, dummy156, param156}, {input1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights1_tmp, dummy157, param157}, {input_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights1_tmp, dummy158, param158}, {input_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights1_tmp, dummy159, param159}, {input_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights1_tmp, dummy160, param160}, {recurrent_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights1_tmp, dummy161, param161}, {recurrent_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights1_tmp, dummy162, param162}, {recurrent_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights1_tmp, dummy163, param163}, {cell_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights1_tmp, dummy164, param164}, {cell_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias1_tmp, dummy165, param165}, {forget_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias1_tmp, dummy166, param166}, {cell_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias1_tmp, dummy167, param167}, {output_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights1_tmp, dummy168, param168}, {projection_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in1_tmp, dummy169, param169}, {output_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in1_tmp, dummy170, param170}, {cell_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights1_tmp, dummy171, param171}, {forget_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights1_tmp, dummy172, param172}, {cell_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights1_tmp, dummy173, param173}, {output_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input_to_input_weights1, recurrent_to_intput_weights1, cell_to_input_weights1, input_gate_bias1, projection_bias1, input_layer_norm_weights1, input1_tmp, input_to_forget_weights1_tmp, input_to_cell_weights1_tmp, input_to_output_weights1_tmp, recurrent_to_forget_weights1_tmp, recurrent_to_cell_weights1_tmp, recurrent_to_output_weights1_tmp, cell_to_forget_weights1_tmp, cell_to_output_weights1_tmp, forget_gate_bias1_tmp, cell_gate_bias1_tmp, output_gate_bias1_tmp, projection_weights1_tmp, output_state_in1_tmp, cell_state_in1_tmp, forget_layer_norm_weights1_tmp, cell_layer_norm_weights1_tmp, output_layer_norm_weights1_tmp}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal_dynamic_output_shape_4(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_5(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type12(Type::TENSOR_FLOAT32, {2, 12}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type12); |
| auto output_state_out1 = model->addOperand(&type6); |
| auto cell_state_out1 = model->addOperand(&type7); |
| auto output1 = model->addOperand(&type6); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_5(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_dynamic_output_shape_5(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type11); |
| auto output_state_out1 = model->addOperand(&type11); |
| auto cell_state_out1 = model->addOperand(&type11); |
| auto output1 = model->addOperand(&type11); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_dynamic_output_shape_5(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal_5(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type12(Type::TENSOR_FLOAT32, {2, 12}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type12); |
| auto output_state_out1 = model->addOperand(&type6); |
| auto cell_state_out1 = model->addOperand(&type7); |
| auto output1 = model->addOperand(&type6); |
| auto input1_tmp = model->addOperand(&type0); |
| auto dummy174 = model->addOperand(&type13); |
| auto param174 = model->addOperand(&type8); |
| auto input_to_forget_weights1_tmp = model->addOperand(&type1); |
| auto dummy175 = model->addOperand(&type13); |
| auto param175 = model->addOperand(&type8); |
| auto input_to_cell_weights1_tmp = model->addOperand(&type1); |
| auto dummy176 = model->addOperand(&type13); |
| auto param176 = model->addOperand(&type8); |
| auto input_to_output_weights1_tmp = model->addOperand(&type1); |
| auto dummy177 = model->addOperand(&type13); |
| auto param177 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights1_tmp = model->addOperand(&type2); |
| auto dummy178 = model->addOperand(&type13); |
| auto param178 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights1_tmp = model->addOperand(&type2); |
| auto dummy179 = model->addOperand(&type13); |
| auto param179 = model->addOperand(&type8); |
| auto recurrent_to_output_weights1_tmp = model->addOperand(&type2); |
| auto dummy180 = model->addOperand(&type13); |
| auto param180 = model->addOperand(&type8); |
| auto cell_to_forget_weights1_tmp = model->addOperand(&type3); |
| auto dummy181 = model->addOperand(&type13); |
| auto param181 = model->addOperand(&type8); |
| auto cell_to_output_weights1_tmp = model->addOperand(&type3); |
| auto dummy182 = model->addOperand(&type13); |
| auto param182 = model->addOperand(&type8); |
| auto forget_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy183 = model->addOperand(&type13); |
| auto param183 = model->addOperand(&type8); |
| auto cell_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy184 = model->addOperand(&type13); |
| auto param184 = model->addOperand(&type8); |
| auto output_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy185 = model->addOperand(&type13); |
| auto param185 = model->addOperand(&type8); |
| auto projection_weights1_tmp = model->addOperand(&type4); |
| auto dummy186 = model->addOperand(&type13); |
| auto param186 = model->addOperand(&type8); |
| auto output_state_in1_tmp = model->addOperand(&type6); |
| auto dummy187 = model->addOperand(&type13); |
| auto param187 = model->addOperand(&type8); |
| auto cell_state_in1_tmp = model->addOperand(&type7); |
| auto dummy188 = model->addOperand(&type13); |
| auto param188 = model->addOperand(&type8); |
| auto forget_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy189 = model->addOperand(&type13); |
| auto param189 = model->addOperand(&type8); |
| auto cell_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy190 = model->addOperand(&type13); |
| auto param190 = model->addOperand(&type8); |
| auto output_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy191 = model->addOperand(&type13); |
| auto param191 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| static float dummy174_init[] = {0.0f}; |
| model->setOperandValue(dummy174, dummy174_init, sizeof(float) * 1); |
| static int32_t param174_init[] = {0}; |
| model->setOperandValue(param174, param174_init, sizeof(int32_t) * 1); |
| static float dummy175_init[] = {0.0f}; |
| model->setOperandValue(dummy175, dummy175_init, sizeof(float) * 1); |
| static int32_t param175_init[] = {0}; |
| model->setOperandValue(param175, param175_init, sizeof(int32_t) * 1); |
| static float dummy176_init[] = {0.0f}; |
| model->setOperandValue(dummy176, dummy176_init, sizeof(float) * 1); |
| static int32_t param176_init[] = {0}; |
| model->setOperandValue(param176, param176_init, sizeof(int32_t) * 1); |
| static float dummy177_init[] = {0.0f}; |
| model->setOperandValue(dummy177, dummy177_init, sizeof(float) * 1); |
| static int32_t param177_init[] = {0}; |
| model->setOperandValue(param177, param177_init, sizeof(int32_t) * 1); |
| static float dummy178_init[] = {0.0f}; |
| model->setOperandValue(dummy178, dummy178_init, sizeof(float) * 1); |
| static int32_t param178_init[] = {0}; |
| model->setOperandValue(param178, param178_init, sizeof(int32_t) * 1); |
| static float dummy179_init[] = {0.0f}; |
| model->setOperandValue(dummy179, dummy179_init, sizeof(float) * 1); |
| static int32_t param179_init[] = {0}; |
| model->setOperandValue(param179, param179_init, sizeof(int32_t) * 1); |
| static float dummy180_init[] = {0.0f}; |
| model->setOperandValue(dummy180, dummy180_init, sizeof(float) * 1); |
| static int32_t param180_init[] = {0}; |
| model->setOperandValue(param180, param180_init, sizeof(int32_t) * 1); |
| static float dummy181_init[] = {0.0f}; |
| model->setOperandValue(dummy181, dummy181_init, sizeof(float) * 1); |
| static int32_t param181_init[] = {0}; |
| model->setOperandValue(param181, param181_init, sizeof(int32_t) * 1); |
| static float dummy182_init[] = {0.0f}; |
| model->setOperandValue(dummy182, dummy182_init, sizeof(float) * 1); |
| static int32_t param182_init[] = {0}; |
| model->setOperandValue(param182, param182_init, sizeof(int32_t) * 1); |
| static float dummy183_init[] = {0.0f}; |
| model->setOperandValue(dummy183, dummy183_init, sizeof(float) * 1); |
| static int32_t param183_init[] = {0}; |
| model->setOperandValue(param183, param183_init, sizeof(int32_t) * 1); |
| static float dummy184_init[] = {0.0f}; |
| model->setOperandValue(dummy184, dummy184_init, sizeof(float) * 1); |
| static int32_t param184_init[] = {0}; |
| model->setOperandValue(param184, param184_init, sizeof(int32_t) * 1); |
| static float dummy185_init[] = {0.0f}; |
| model->setOperandValue(dummy185, dummy185_init, sizeof(float) * 1); |
| static int32_t param185_init[] = {0}; |
| model->setOperandValue(param185, param185_init, sizeof(int32_t) * 1); |
| static float dummy186_init[] = {0.0f}; |
| model->setOperandValue(dummy186, dummy186_init, sizeof(float) * 1); |
| static int32_t param186_init[] = {0}; |
| model->setOperandValue(param186, param186_init, sizeof(int32_t) * 1); |
| static float dummy187_init[] = {0.0f}; |
| model->setOperandValue(dummy187, dummy187_init, sizeof(float) * 1); |
| static int32_t param187_init[] = {0}; |
| model->setOperandValue(param187, param187_init, sizeof(int32_t) * 1); |
| static float dummy188_init[] = {0.0f}; |
| model->setOperandValue(dummy188, dummy188_init, sizeof(float) * 1); |
| static int32_t param188_init[] = {0}; |
| model->setOperandValue(param188, param188_init, sizeof(int32_t) * 1); |
| static float dummy189_init[] = {0.0f}; |
| model->setOperandValue(dummy189, dummy189_init, sizeof(float) * 1); |
| static int32_t param189_init[] = {0}; |
| model->setOperandValue(param189, param189_init, sizeof(int32_t) * 1); |
| static float dummy190_init[] = {0.0f}; |
| model->setOperandValue(dummy190, dummy190_init, sizeof(float) * 1); |
| static int32_t param190_init[] = {0}; |
| model->setOperandValue(param190, param190_init, sizeof(int32_t) * 1); |
| static float dummy191_init[] = {0.0f}; |
| model->setOperandValue(dummy191, dummy191_init, sizeof(float) * 1); |
| static int32_t param191_init[] = {0}; |
| model->setOperandValue(param191, param191_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input1_tmp, dummy174, param174}, {input1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights1_tmp, dummy175, param175}, {input_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights1_tmp, dummy176, param176}, {input_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights1_tmp, dummy177, param177}, {input_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights1_tmp, dummy178, param178}, {recurrent_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights1_tmp, dummy179, param179}, {recurrent_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights1_tmp, dummy180, param180}, {recurrent_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights1_tmp, dummy181, param181}, {cell_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights1_tmp, dummy182, param182}, {cell_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias1_tmp, dummy183, param183}, {forget_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias1_tmp, dummy184, param184}, {cell_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias1_tmp, dummy185, param185}, {output_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights1_tmp, dummy186, param186}, {projection_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in1_tmp, dummy187, param187}, {output_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in1_tmp, dummy188, param188}, {cell_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights1_tmp, dummy189, param189}, {forget_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights1_tmp, dummy190, param190}, {cell_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights1_tmp, dummy191, param191}, {output_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input_to_input_weights1, recurrent_to_intput_weights1, cell_to_input_weights1, input_gate_bias1, projection_bias1, input_layer_norm_weights1, input1_tmp, input_to_forget_weights1_tmp, input_to_cell_weights1_tmp, input_to_output_weights1_tmp, recurrent_to_forget_weights1_tmp, recurrent_to_cell_weights1_tmp, recurrent_to_output_weights1_tmp, cell_to_forget_weights1_tmp, cell_to_output_weights1_tmp, forget_gate_bias1_tmp, cell_gate_bias1_tmp, output_gate_bias1_tmp, projection_weights1_tmp, output_state_in1_tmp, cell_state_in1_tmp, forget_layer_norm_weights1_tmp, cell_layer_norm_weights1_tmp, output_layer_norm_weights1_tmp}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal_5(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal_dynamic_output_shape_5(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type11); |
| auto output_state_out1 = model->addOperand(&type11); |
| auto cell_state_out1 = model->addOperand(&type11); |
| auto output1 = model->addOperand(&type11); |
| auto input1_tmp = model->addOperand(&type0); |
| auto dummy192 = model->addOperand(&type13); |
| auto param192 = model->addOperand(&type8); |
| auto input_to_forget_weights1_tmp = model->addOperand(&type1); |
| auto dummy193 = model->addOperand(&type13); |
| auto param193 = model->addOperand(&type8); |
| auto input_to_cell_weights1_tmp = model->addOperand(&type1); |
| auto dummy194 = model->addOperand(&type13); |
| auto param194 = model->addOperand(&type8); |
| auto input_to_output_weights1_tmp = model->addOperand(&type1); |
| auto dummy195 = model->addOperand(&type13); |
| auto param195 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights1_tmp = model->addOperand(&type2); |
| auto dummy196 = model->addOperand(&type13); |
| auto param196 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights1_tmp = model->addOperand(&type2); |
| auto dummy197 = model->addOperand(&type13); |
| auto param197 = model->addOperand(&type8); |
| auto recurrent_to_output_weights1_tmp = model->addOperand(&type2); |
| auto dummy198 = model->addOperand(&type13); |
| auto param198 = model->addOperand(&type8); |
| auto cell_to_forget_weights1_tmp = model->addOperand(&type3); |
| auto dummy199 = model->addOperand(&type13); |
| auto param199 = model->addOperand(&type8); |
| auto cell_to_output_weights1_tmp = model->addOperand(&type3); |
| auto dummy200 = model->addOperand(&type13); |
| auto param200 = model->addOperand(&type8); |
| auto forget_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy201 = model->addOperand(&type13); |
| auto param201 = model->addOperand(&type8); |
| auto cell_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy202 = model->addOperand(&type13); |
| auto param202 = model->addOperand(&type8); |
| auto output_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy203 = model->addOperand(&type13); |
| auto param203 = model->addOperand(&type8); |
| auto projection_weights1_tmp = model->addOperand(&type4); |
| auto dummy204 = model->addOperand(&type13); |
| auto param204 = model->addOperand(&type8); |
| auto output_state_in1_tmp = model->addOperand(&type6); |
| auto dummy205 = model->addOperand(&type13); |
| auto param205 = model->addOperand(&type8); |
| auto cell_state_in1_tmp = model->addOperand(&type7); |
| auto dummy206 = model->addOperand(&type13); |
| auto param206 = model->addOperand(&type8); |
| auto forget_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy207 = model->addOperand(&type13); |
| auto param207 = model->addOperand(&type8); |
| auto cell_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy208 = model->addOperand(&type13); |
| auto param208 = model->addOperand(&type8); |
| auto output_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy209 = model->addOperand(&type13); |
| auto param209 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| static float dummy192_init[] = {0.0f}; |
| model->setOperandValue(dummy192, dummy192_init, sizeof(float) * 1); |
| static int32_t param192_init[] = {0}; |
| model->setOperandValue(param192, param192_init, sizeof(int32_t) * 1); |
| static float dummy193_init[] = {0.0f}; |
| model->setOperandValue(dummy193, dummy193_init, sizeof(float) * 1); |
| static int32_t param193_init[] = {0}; |
| model->setOperandValue(param193, param193_init, sizeof(int32_t) * 1); |
| static float dummy194_init[] = {0.0f}; |
| model->setOperandValue(dummy194, dummy194_init, sizeof(float) * 1); |
| static int32_t param194_init[] = {0}; |
| model->setOperandValue(param194, param194_init, sizeof(int32_t) * 1); |
| static float dummy195_init[] = {0.0f}; |
| model->setOperandValue(dummy195, dummy195_init, sizeof(float) * 1); |
| static int32_t param195_init[] = {0}; |
| model->setOperandValue(param195, param195_init, sizeof(int32_t) * 1); |
| static float dummy196_init[] = {0.0f}; |
| model->setOperandValue(dummy196, dummy196_init, sizeof(float) * 1); |
| static int32_t param196_init[] = {0}; |
| model->setOperandValue(param196, param196_init, sizeof(int32_t) * 1); |
| static float dummy197_init[] = {0.0f}; |
| model->setOperandValue(dummy197, dummy197_init, sizeof(float) * 1); |
| static int32_t param197_init[] = {0}; |
| model->setOperandValue(param197, param197_init, sizeof(int32_t) * 1); |
| static float dummy198_init[] = {0.0f}; |
| model->setOperandValue(dummy198, dummy198_init, sizeof(float) * 1); |
| static int32_t param198_init[] = {0}; |
| model->setOperandValue(param198, param198_init, sizeof(int32_t) * 1); |
| static float dummy199_init[] = {0.0f}; |
| model->setOperandValue(dummy199, dummy199_init, sizeof(float) * 1); |
| static int32_t param199_init[] = {0}; |
| model->setOperandValue(param199, param199_init, sizeof(int32_t) * 1); |
| static float dummy200_init[] = {0.0f}; |
| model->setOperandValue(dummy200, dummy200_init, sizeof(float) * 1); |
| static int32_t param200_init[] = {0}; |
| model->setOperandValue(param200, param200_init, sizeof(int32_t) * 1); |
| static float dummy201_init[] = {0.0f}; |
| model->setOperandValue(dummy201, dummy201_init, sizeof(float) * 1); |
| static int32_t param201_init[] = {0}; |
| model->setOperandValue(param201, param201_init, sizeof(int32_t) * 1); |
| static float dummy202_init[] = {0.0f}; |
| model->setOperandValue(dummy202, dummy202_init, sizeof(float) * 1); |
| static int32_t param202_init[] = {0}; |
| model->setOperandValue(param202, param202_init, sizeof(int32_t) * 1); |
| static float dummy203_init[] = {0.0f}; |
| model->setOperandValue(dummy203, dummy203_init, sizeof(float) * 1); |
| static int32_t param203_init[] = {0}; |
| model->setOperandValue(param203, param203_init, sizeof(int32_t) * 1); |
| static float dummy204_init[] = {0.0f}; |
| model->setOperandValue(dummy204, dummy204_init, sizeof(float) * 1); |
| static int32_t param204_init[] = {0}; |
| model->setOperandValue(param204, param204_init, sizeof(int32_t) * 1); |
| static float dummy205_init[] = {0.0f}; |
| model->setOperandValue(dummy205, dummy205_init, sizeof(float) * 1); |
| static int32_t param205_init[] = {0}; |
| model->setOperandValue(param205, param205_init, sizeof(int32_t) * 1); |
| static float dummy206_init[] = {0.0f}; |
| model->setOperandValue(dummy206, dummy206_init, sizeof(float) * 1); |
| static int32_t param206_init[] = {0}; |
| model->setOperandValue(param206, param206_init, sizeof(int32_t) * 1); |
| static float dummy207_init[] = {0.0f}; |
| model->setOperandValue(dummy207, dummy207_init, sizeof(float) * 1); |
| static int32_t param207_init[] = {0}; |
| model->setOperandValue(param207, param207_init, sizeof(int32_t) * 1); |
| static float dummy208_init[] = {0.0f}; |
| model->setOperandValue(dummy208, dummy208_init, sizeof(float) * 1); |
| static int32_t param208_init[] = {0}; |
| model->setOperandValue(param208, param208_init, sizeof(int32_t) * 1); |
| static float dummy209_init[] = {0.0f}; |
| model->setOperandValue(dummy209, dummy209_init, sizeof(float) * 1); |
| static int32_t param209_init[] = {0}; |
| model->setOperandValue(param209, param209_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input1_tmp, dummy192, param192}, {input1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights1_tmp, dummy193, param193}, {input_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights1_tmp, dummy194, param194}, {input_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights1_tmp, dummy195, param195}, {input_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights1_tmp, dummy196, param196}, {recurrent_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights1_tmp, dummy197, param197}, {recurrent_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights1_tmp, dummy198, param198}, {recurrent_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights1_tmp, dummy199, param199}, {cell_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights1_tmp, dummy200, param200}, {cell_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias1_tmp, dummy201, param201}, {forget_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias1_tmp, dummy202, param202}, {cell_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias1_tmp, dummy203, param203}, {output_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights1_tmp, dummy204, param204}, {projection_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in1_tmp, dummy205, param205}, {output_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in1_tmp, dummy206, param206}, {cell_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights1_tmp, dummy207, param207}, {forget_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights1_tmp, dummy208, param208}, {cell_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights1_tmp, dummy209, param209}, {output_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input_to_input_weights1, recurrent_to_intput_weights1, cell_to_input_weights1, input_gate_bias1, projection_bias1, input_layer_norm_weights1, input1_tmp, input_to_forget_weights1_tmp, input_to_cell_weights1_tmp, input_to_output_weights1_tmp, recurrent_to_forget_weights1_tmp, recurrent_to_cell_weights1_tmp, recurrent_to_output_weights1_tmp, cell_to_forget_weights1_tmp, cell_to_output_weights1_tmp, forget_gate_bias1_tmp, cell_gate_bias1_tmp, output_gate_bias1_tmp, projection_weights1_tmp, output_state_in1_tmp, cell_state_in1_tmp, forget_layer_norm_weights1_tmp, cell_layer_norm_weights1_tmp, output_layer_norm_weights1_tmp}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal_dynamic_output_shape_5(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_6(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type12(Type::TENSOR_FLOAT32, {2, 12}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type12); |
| auto output_state_out1 = model->addOperand(&type6); |
| auto cell_state_out1 = model->addOperand(&type7); |
| auto output1 = model->addOperand(&type6); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_6(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_dynamic_output_shape_6(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type11); |
| auto output_state_out1 = model->addOperand(&type11); |
| auto cell_state_out1 = model->addOperand(&type11); |
| auto output1 = model->addOperand(&type11); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_dynamic_output_shape_6(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal_6(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type12(Type::TENSOR_FLOAT32, {2, 12}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type12); |
| auto output_state_out1 = model->addOperand(&type6); |
| auto cell_state_out1 = model->addOperand(&type7); |
| auto output1 = model->addOperand(&type6); |
| auto input1_tmp = model->addOperand(&type0); |
| auto dummy210 = model->addOperand(&type13); |
| auto param210 = model->addOperand(&type8); |
| auto input_to_forget_weights1_tmp = model->addOperand(&type1); |
| auto dummy211 = model->addOperand(&type13); |
| auto param211 = model->addOperand(&type8); |
| auto input_to_cell_weights1_tmp = model->addOperand(&type1); |
| auto dummy212 = model->addOperand(&type13); |
| auto param212 = model->addOperand(&type8); |
| auto input_to_output_weights1_tmp = model->addOperand(&type1); |
| auto dummy213 = model->addOperand(&type13); |
| auto param213 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights1_tmp = model->addOperand(&type2); |
| auto dummy214 = model->addOperand(&type13); |
| auto param214 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights1_tmp = model->addOperand(&type2); |
| auto dummy215 = model->addOperand(&type13); |
| auto param215 = model->addOperand(&type8); |
| auto recurrent_to_output_weights1_tmp = model->addOperand(&type2); |
| auto dummy216 = model->addOperand(&type13); |
| auto param216 = model->addOperand(&type8); |
| auto cell_to_forget_weights1_tmp = model->addOperand(&type3); |
| auto dummy217 = model->addOperand(&type13); |
| auto param217 = model->addOperand(&type8); |
| auto cell_to_output_weights1_tmp = model->addOperand(&type3); |
| auto dummy218 = model->addOperand(&type13); |
| auto param218 = model->addOperand(&type8); |
| auto forget_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy219 = model->addOperand(&type13); |
| auto param219 = model->addOperand(&type8); |
| auto cell_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy220 = model->addOperand(&type13); |
| auto param220 = model->addOperand(&type8); |
| auto output_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy221 = model->addOperand(&type13); |
| auto param221 = model->addOperand(&type8); |
| auto projection_weights1_tmp = model->addOperand(&type4); |
| auto dummy222 = model->addOperand(&type13); |
| auto param222 = model->addOperand(&type8); |
| auto output_state_in1_tmp = model->addOperand(&type6); |
| auto dummy223 = model->addOperand(&type13); |
| auto param223 = model->addOperand(&type8); |
| auto cell_state_in1_tmp = model->addOperand(&type7); |
| auto dummy224 = model->addOperand(&type13); |
| auto param224 = model->addOperand(&type8); |
| auto forget_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy225 = model->addOperand(&type13); |
| auto param225 = model->addOperand(&type8); |
| auto cell_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy226 = model->addOperand(&type13); |
| auto param226 = model->addOperand(&type8); |
| auto output_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy227 = model->addOperand(&type13); |
| auto param227 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| static float dummy210_init[] = {0.0f}; |
| model->setOperandValue(dummy210, dummy210_init, sizeof(float) * 1); |
| static int32_t param210_init[] = {0}; |
| model->setOperandValue(param210, param210_init, sizeof(int32_t) * 1); |
| static float dummy211_init[] = {0.0f}; |
| model->setOperandValue(dummy211, dummy211_init, sizeof(float) * 1); |
| static int32_t param211_init[] = {0}; |
| model->setOperandValue(param211, param211_init, sizeof(int32_t) * 1); |
| static float dummy212_init[] = {0.0f}; |
| model->setOperandValue(dummy212, dummy212_init, sizeof(float) * 1); |
| static int32_t param212_init[] = {0}; |
| model->setOperandValue(param212, param212_init, sizeof(int32_t) * 1); |
| static float dummy213_init[] = {0.0f}; |
| model->setOperandValue(dummy213, dummy213_init, sizeof(float) * 1); |
| static int32_t param213_init[] = {0}; |
| model->setOperandValue(param213, param213_init, sizeof(int32_t) * 1); |
| static float dummy214_init[] = {0.0f}; |
| model->setOperandValue(dummy214, dummy214_init, sizeof(float) * 1); |
| static int32_t param214_init[] = {0}; |
| model->setOperandValue(param214, param214_init, sizeof(int32_t) * 1); |
| static float dummy215_init[] = {0.0f}; |
| model->setOperandValue(dummy215, dummy215_init, sizeof(float) * 1); |
| static int32_t param215_init[] = {0}; |
| model->setOperandValue(param215, param215_init, sizeof(int32_t) * 1); |
| static float dummy216_init[] = {0.0f}; |
| model->setOperandValue(dummy216, dummy216_init, sizeof(float) * 1); |
| static int32_t param216_init[] = {0}; |
| model->setOperandValue(param216, param216_init, sizeof(int32_t) * 1); |
| static float dummy217_init[] = {0.0f}; |
| model->setOperandValue(dummy217, dummy217_init, sizeof(float) * 1); |
| static int32_t param217_init[] = {0}; |
| model->setOperandValue(param217, param217_init, sizeof(int32_t) * 1); |
| static float dummy218_init[] = {0.0f}; |
| model->setOperandValue(dummy218, dummy218_init, sizeof(float) * 1); |
| static int32_t param218_init[] = {0}; |
| model->setOperandValue(param218, param218_init, sizeof(int32_t) * 1); |
| static float dummy219_init[] = {0.0f}; |
| model->setOperandValue(dummy219, dummy219_init, sizeof(float) * 1); |
| static int32_t param219_init[] = {0}; |
| model->setOperandValue(param219, param219_init, sizeof(int32_t) * 1); |
| static float dummy220_init[] = {0.0f}; |
| model->setOperandValue(dummy220, dummy220_init, sizeof(float) * 1); |
| static int32_t param220_init[] = {0}; |
| model->setOperandValue(param220, param220_init, sizeof(int32_t) * 1); |
| static float dummy221_init[] = {0.0f}; |
| model->setOperandValue(dummy221, dummy221_init, sizeof(float) * 1); |
| static int32_t param221_init[] = {0}; |
| model->setOperandValue(param221, param221_init, sizeof(int32_t) * 1); |
| static float dummy222_init[] = {0.0f}; |
| model->setOperandValue(dummy222, dummy222_init, sizeof(float) * 1); |
| static int32_t param222_init[] = {0}; |
| model->setOperandValue(param222, param222_init, sizeof(int32_t) * 1); |
| static float dummy223_init[] = {0.0f}; |
| model->setOperandValue(dummy223, dummy223_init, sizeof(float) * 1); |
| static int32_t param223_init[] = {0}; |
| model->setOperandValue(param223, param223_init, sizeof(int32_t) * 1); |
| static float dummy224_init[] = {0.0f}; |
| model->setOperandValue(dummy224, dummy224_init, sizeof(float) * 1); |
| static int32_t param224_init[] = {0}; |
| model->setOperandValue(param224, param224_init, sizeof(int32_t) * 1); |
| static float dummy225_init[] = {0.0f}; |
| model->setOperandValue(dummy225, dummy225_init, sizeof(float) * 1); |
| static int32_t param225_init[] = {0}; |
| model->setOperandValue(param225, param225_init, sizeof(int32_t) * 1); |
| static float dummy226_init[] = {0.0f}; |
| model->setOperandValue(dummy226, dummy226_init, sizeof(float) * 1); |
| static int32_t param226_init[] = {0}; |
| model->setOperandValue(param226, param226_init, sizeof(int32_t) * 1); |
| static float dummy227_init[] = {0.0f}; |
| model->setOperandValue(dummy227, dummy227_init, sizeof(float) * 1); |
| static int32_t param227_init[] = {0}; |
| model->setOperandValue(param227, param227_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input1_tmp, dummy210, param210}, {input1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights1_tmp, dummy211, param211}, {input_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights1_tmp, dummy212, param212}, {input_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights1_tmp, dummy213, param213}, {input_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights1_tmp, dummy214, param214}, {recurrent_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights1_tmp, dummy215, param215}, {recurrent_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights1_tmp, dummy216, param216}, {recurrent_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights1_tmp, dummy217, param217}, {cell_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights1_tmp, dummy218, param218}, {cell_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias1_tmp, dummy219, param219}, {forget_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias1_tmp, dummy220, param220}, {cell_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias1_tmp, dummy221, param221}, {output_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights1_tmp, dummy222, param222}, {projection_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in1_tmp, dummy223, param223}, {output_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in1_tmp, dummy224, param224}, {cell_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights1_tmp, dummy225, param225}, {forget_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights1_tmp, dummy226, param226}, {cell_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights1_tmp, dummy227, param227}, {output_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input_to_input_weights1, recurrent_to_intput_weights1, cell_to_input_weights1, input_gate_bias1, projection_bias1, input_layer_norm_weights1, input1_tmp, input_to_forget_weights1_tmp, input_to_cell_weights1_tmp, input_to_output_weights1_tmp, recurrent_to_forget_weights1_tmp, recurrent_to_cell_weights1_tmp, recurrent_to_output_weights1_tmp, cell_to_forget_weights1_tmp, cell_to_output_weights1_tmp, forget_gate_bias1_tmp, cell_gate_bias1_tmp, output_gate_bias1_tmp, projection_weights1_tmp, output_state_in1_tmp, cell_state_in1_tmp, forget_layer_norm_weights1_tmp, cell_layer_norm_weights1_tmp, output_layer_norm_weights1_tmp}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal_6(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |
| namespace generated_tests::layer_norm_lstm { |
| |
| void CreateModel_all_inputs_as_internal_dynamic_output_shape_6(Model *model) { |
| OperandType type0(Type::TENSOR_FLOAT32, {2, 5}); |
| OperandType type1(Type::TENSOR_FLOAT32, {4, 5}); |
| OperandType type11(Type::TENSOR_FLOAT32, {0, 0}); |
| OperandType type13(Type::TENSOR_FLOAT32, {1}); |
| OperandType type2(Type::TENSOR_FLOAT32, {4, 3}); |
| OperandType type3(Type::TENSOR_FLOAT32, {4}); |
| OperandType type4(Type::TENSOR_FLOAT32, {3, 4}); |
| OperandType type5(Type::TENSOR_FLOAT32, {0}); |
| OperandType type6(Type::TENSOR_FLOAT32, {2, 3}); |
| OperandType type7(Type::TENSOR_FLOAT32, {2, 4}); |
| OperandType type8(Type::INT32, {}); |
| OperandType type9(Type::FLOAT32, {}); |
| // Phase 1, operands |
| auto input1 = model->addOperand(&type0); |
| auto input_to_input_weights1 = model->addOperand(&type11); |
| auto input_to_forget_weights1 = model->addOperand(&type1); |
| auto input_to_cell_weights1 = model->addOperand(&type1); |
| auto input_to_output_weights1 = model->addOperand(&type1); |
| auto recurrent_to_intput_weights1 = model->addOperand(&type11); |
| auto recurrent_to_forget_weights1 = model->addOperand(&type2); |
| auto recurrent_to_cell_weights1 = model->addOperand(&type2); |
| auto recurrent_to_output_weights1 = model->addOperand(&type2); |
| auto cell_to_input_weights1 = model->addOperand(&type5); |
| auto cell_to_forget_weights1 = model->addOperand(&type3); |
| auto cell_to_output_weights1 = model->addOperand(&type3); |
| auto input_gate_bias1 = model->addOperand(&type5); |
| auto forget_gate_bias1 = model->addOperand(&type3); |
| auto cell_gate_bias1 = model->addOperand(&type3); |
| auto output_gate_bias1 = model->addOperand(&type3); |
| auto projection_weights1 = model->addOperand(&type4); |
| auto projection_bias1 = model->addOperand(&type5); |
| auto output_state_in1 = model->addOperand(&type6); |
| auto cell_state_in1 = model->addOperand(&type7); |
| auto activation_param1 = model->addOperand(&type8); |
| auto cell_clip_param1 = model->addOperand(&type9); |
| auto proj_clip_param1 = model->addOperand(&type9); |
| auto input_layer_norm_weights1 = model->addOperand(&type5); |
| auto forget_layer_norm_weights1 = model->addOperand(&type3); |
| auto cell_layer_norm_weights1 = model->addOperand(&type3); |
| auto output_layer_norm_weights1 = model->addOperand(&type3); |
| auto scratch_buffer1 = model->addOperand(&type11); |
| auto output_state_out1 = model->addOperand(&type11); |
| auto cell_state_out1 = model->addOperand(&type11); |
| auto output1 = model->addOperand(&type11); |
| auto input1_tmp = model->addOperand(&type0); |
| auto dummy228 = model->addOperand(&type13); |
| auto param228 = model->addOperand(&type8); |
| auto input_to_forget_weights1_tmp = model->addOperand(&type1); |
| auto dummy229 = model->addOperand(&type13); |
| auto param229 = model->addOperand(&type8); |
| auto input_to_cell_weights1_tmp = model->addOperand(&type1); |
| auto dummy230 = model->addOperand(&type13); |
| auto param230 = model->addOperand(&type8); |
| auto input_to_output_weights1_tmp = model->addOperand(&type1); |
| auto dummy231 = model->addOperand(&type13); |
| auto param231 = model->addOperand(&type8); |
| auto recurrent_to_forget_weights1_tmp = model->addOperand(&type2); |
| auto dummy232 = model->addOperand(&type13); |
| auto param232 = model->addOperand(&type8); |
| auto recurrent_to_cell_weights1_tmp = model->addOperand(&type2); |
| auto dummy233 = model->addOperand(&type13); |
| auto param233 = model->addOperand(&type8); |
| auto recurrent_to_output_weights1_tmp = model->addOperand(&type2); |
| auto dummy234 = model->addOperand(&type13); |
| auto param234 = model->addOperand(&type8); |
| auto cell_to_forget_weights1_tmp = model->addOperand(&type3); |
| auto dummy235 = model->addOperand(&type13); |
| auto param235 = model->addOperand(&type8); |
| auto cell_to_output_weights1_tmp = model->addOperand(&type3); |
| auto dummy236 = model->addOperand(&type13); |
| auto param236 = model->addOperand(&type8); |
| auto forget_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy237 = model->addOperand(&type13); |
| auto param237 = model->addOperand(&type8); |
| auto cell_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy238 = model->addOperand(&type13); |
| auto param238 = model->addOperand(&type8); |
| auto output_gate_bias1_tmp = model->addOperand(&type3); |
| auto dummy239 = model->addOperand(&type13); |
| auto param239 = model->addOperand(&type8); |
| auto projection_weights1_tmp = model->addOperand(&type4); |
| auto dummy240 = model->addOperand(&type13); |
| auto param240 = model->addOperand(&type8); |
| auto output_state_in1_tmp = model->addOperand(&type6); |
| auto dummy241 = model->addOperand(&type13); |
| auto param241 = model->addOperand(&type8); |
| auto cell_state_in1_tmp = model->addOperand(&type7); |
| auto dummy242 = model->addOperand(&type13); |
| auto param242 = model->addOperand(&type8); |
| auto forget_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy243 = model->addOperand(&type13); |
| auto param243 = model->addOperand(&type8); |
| auto cell_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy244 = model->addOperand(&type13); |
| auto param244 = model->addOperand(&type8); |
| auto output_layer_norm_weights1_tmp = model->addOperand(&type3); |
| auto dummy245 = model->addOperand(&type13); |
| auto param245 = model->addOperand(&type8); |
| // Phase 2, operations |
| static int32_t activation_param1_init[] = {4}; |
| model->setOperandValue(activation_param1, activation_param1_init, sizeof(int32_t) * 1); |
| static float cell_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(cell_clip_param1, cell_clip_param1_init, sizeof(float) * 1); |
| static float proj_clip_param1_init[] = {0.0f}; |
| model->setOperandValue(proj_clip_param1, proj_clip_param1_init, sizeof(float) * 1); |
| static float dummy228_init[] = {0.0f}; |
| model->setOperandValue(dummy228, dummy228_init, sizeof(float) * 1); |
| static int32_t param228_init[] = {0}; |
| model->setOperandValue(param228, param228_init, sizeof(int32_t) * 1); |
| static float dummy229_init[] = {0.0f}; |
| model->setOperandValue(dummy229, dummy229_init, sizeof(float) * 1); |
| static int32_t param229_init[] = {0}; |
| model->setOperandValue(param229, param229_init, sizeof(int32_t) * 1); |
| static float dummy230_init[] = {0.0f}; |
| model->setOperandValue(dummy230, dummy230_init, sizeof(float) * 1); |
| static int32_t param230_init[] = {0}; |
| model->setOperandValue(param230, param230_init, sizeof(int32_t) * 1); |
| static float dummy231_init[] = {0.0f}; |
| model->setOperandValue(dummy231, dummy231_init, sizeof(float) * 1); |
| static int32_t param231_init[] = {0}; |
| model->setOperandValue(param231, param231_init, sizeof(int32_t) * 1); |
| static float dummy232_init[] = {0.0f}; |
| model->setOperandValue(dummy232, dummy232_init, sizeof(float) * 1); |
| static int32_t param232_init[] = {0}; |
| model->setOperandValue(param232, param232_init, sizeof(int32_t) * 1); |
| static float dummy233_init[] = {0.0f}; |
| model->setOperandValue(dummy233, dummy233_init, sizeof(float) * 1); |
| static int32_t param233_init[] = {0}; |
| model->setOperandValue(param233, param233_init, sizeof(int32_t) * 1); |
| static float dummy234_init[] = {0.0f}; |
| model->setOperandValue(dummy234, dummy234_init, sizeof(float) * 1); |
| static int32_t param234_init[] = {0}; |
| model->setOperandValue(param234, param234_init, sizeof(int32_t) * 1); |
| static float dummy235_init[] = {0.0f}; |
| model->setOperandValue(dummy235, dummy235_init, sizeof(float) * 1); |
| static int32_t param235_init[] = {0}; |
| model->setOperandValue(param235, param235_init, sizeof(int32_t) * 1); |
| static float dummy236_init[] = {0.0f}; |
| model->setOperandValue(dummy236, dummy236_init, sizeof(float) * 1); |
| static int32_t param236_init[] = {0}; |
| model->setOperandValue(param236, param236_init, sizeof(int32_t) * 1); |
| static float dummy237_init[] = {0.0f}; |
| model->setOperandValue(dummy237, dummy237_init, sizeof(float) * 1); |
| static int32_t param237_init[] = {0}; |
| model->setOperandValue(param237, param237_init, sizeof(int32_t) * 1); |
| static float dummy238_init[] = {0.0f}; |
| model->setOperandValue(dummy238, dummy238_init, sizeof(float) * 1); |
| static int32_t param238_init[] = {0}; |
| model->setOperandValue(param238, param238_init, sizeof(int32_t) * 1); |
| static float dummy239_init[] = {0.0f}; |
| model->setOperandValue(dummy239, dummy239_init, sizeof(float) * 1); |
| static int32_t param239_init[] = {0}; |
| model->setOperandValue(param239, param239_init, sizeof(int32_t) * 1); |
| static float dummy240_init[] = {0.0f}; |
| model->setOperandValue(dummy240, dummy240_init, sizeof(float) * 1); |
| static int32_t param240_init[] = {0}; |
| model->setOperandValue(param240, param240_init, sizeof(int32_t) * 1); |
| static float dummy241_init[] = {0.0f}; |
| model->setOperandValue(dummy241, dummy241_init, sizeof(float) * 1); |
| static int32_t param241_init[] = {0}; |
| model->setOperandValue(param241, param241_init, sizeof(int32_t) * 1); |
| static float dummy242_init[] = {0.0f}; |
| model->setOperandValue(dummy242, dummy242_init, sizeof(float) * 1); |
| static int32_t param242_init[] = {0}; |
| model->setOperandValue(param242, param242_init, sizeof(int32_t) * 1); |
| static float dummy243_init[] = {0.0f}; |
| model->setOperandValue(dummy243, dummy243_init, sizeof(float) * 1); |
| static int32_t param243_init[] = {0}; |
| model->setOperandValue(param243, param243_init, sizeof(int32_t) * 1); |
| static float dummy244_init[] = {0.0f}; |
| model->setOperandValue(dummy244, dummy244_init, sizeof(float) * 1); |
| static int32_t param244_init[] = {0}; |
| model->setOperandValue(param244, param244_init, sizeof(int32_t) * 1); |
| static float dummy245_init[] = {0.0f}; |
| model->setOperandValue(dummy245, dummy245_init, sizeof(float) * 1); |
| static int32_t param245_init[] = {0}; |
| model->setOperandValue(param245, param245_init, sizeof(int32_t) * 1); |
| model->addOperation(ANEURALNETWORKS_ADD, {input1_tmp, dummy228, param228}, {input1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_forget_weights1_tmp, dummy229, param229}, {input_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_cell_weights1_tmp, dummy230, param230}, {input_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {input_to_output_weights1_tmp, dummy231, param231}, {input_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_forget_weights1_tmp, dummy232, param232}, {recurrent_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_cell_weights1_tmp, dummy233, param233}, {recurrent_to_cell_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {recurrent_to_output_weights1_tmp, dummy234, param234}, {recurrent_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_forget_weights1_tmp, dummy235, param235}, {cell_to_forget_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_to_output_weights1_tmp, dummy236, param236}, {cell_to_output_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_gate_bias1_tmp, dummy237, param237}, {forget_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_gate_bias1_tmp, dummy238, param238}, {cell_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_gate_bias1_tmp, dummy239, param239}, {output_gate_bias1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {projection_weights1_tmp, dummy240, param240}, {projection_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_state_in1_tmp, dummy241, param241}, {output_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_state_in1_tmp, dummy242, param242}, {cell_state_in1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {forget_layer_norm_weights1_tmp, dummy243, param243}, {forget_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {cell_layer_norm_weights1_tmp, dummy244, param244}, {cell_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_ADD, {output_layer_norm_weights1_tmp, dummy245, param245}, {output_layer_norm_weights1}); |
| model->addOperation(ANEURALNETWORKS_LSTM, {input1, input_to_input_weights1, input_to_forget_weights1, input_to_cell_weights1, input_to_output_weights1, recurrent_to_intput_weights1, recurrent_to_forget_weights1, recurrent_to_cell_weights1, recurrent_to_output_weights1, cell_to_input_weights1, cell_to_forget_weights1, cell_to_output_weights1, input_gate_bias1, forget_gate_bias1, cell_gate_bias1, output_gate_bias1, projection_weights1, projection_bias1, output_state_in1, cell_state_in1, activation_param1, cell_clip_param1, proj_clip_param1, input_layer_norm_weights1, forget_layer_norm_weights1, cell_layer_norm_weights1, output_layer_norm_weights1}, {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| // Phase 3, inputs and outputs |
| model->identifyInputsAndOutputs( |
| {input_to_input_weights1, recurrent_to_intput_weights1, cell_to_input_weights1, input_gate_bias1, projection_bias1, input_layer_norm_weights1, input1_tmp, input_to_forget_weights1_tmp, input_to_cell_weights1_tmp, input_to_output_weights1_tmp, recurrent_to_forget_weights1_tmp, recurrent_to_cell_weights1_tmp, recurrent_to_output_weights1_tmp, cell_to_forget_weights1_tmp, cell_to_output_weights1_tmp, forget_gate_bias1_tmp, cell_gate_bias1_tmp, output_gate_bias1_tmp, projection_weights1_tmp, output_state_in1_tmp, cell_state_in1_tmp, forget_layer_norm_weights1_tmp, cell_layer_norm_weights1_tmp, output_layer_norm_weights1_tmp}, |
| {scratch_buffer1, output_state_out1, cell_state_out1, output1}); |
| assert(model->isValid()); |
| } |
| |
| bool is_ignored_all_inputs_as_internal_dynamic_output_shape_6(int i) { |
| static std::set<int> ignore = {0, 1}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace generated_tests::layer_norm_lstm |