summaryrefslogtreecommitdiff
path: root/nn/runtime/test/generated/models/local_response_norm_float_1_relaxed.model.cpp
blob: 6f2f9b41323a35450a076446f5b579d54d6df2e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Generated file (from: local_response_norm_float_1_relaxed.mod.py). Do not edit
void CreateModel(Model *model) {
  OperandType type2(Type::FLOAT32, {});
  OperandType type1(Type::INT32, {});
  OperandType type0(Type::TENSOR_FLOAT32, {1, 1, 1, 6});
  // Phase 1, operands
  auto input = model->addOperand(&type0);
  auto radius = model->addOperand(&type1);
  auto bias = model->addOperand(&type2);
  auto alpha = model->addOperand(&type2);
  auto beta = model->addOperand(&type2);
  auto output = model->addOperand(&type0);
  // Phase 2, operations
  static int32_t radius_init[] = {20};
  model->setOperandValue(radius, radius_init, sizeof(int32_t) * 1);
  static float bias_init[] = {9.0f};
  model->setOperandValue(bias, bias_init, sizeof(float) * 1);
  static float alpha_init[] = {4.0f};
  model->setOperandValue(alpha, alpha_init, sizeof(float) * 1);
  static float beta_init[] = {0.5f};
  model->setOperandValue(beta, beta_init, sizeof(float) * 1);
  model->addOperation(ANEURALNETWORKS_LOCAL_RESPONSE_NORMALIZATION, {input, radius, bias, alpha, beta}, {output});
  // Phase 3, inputs and outputs
  model->identifyInputsAndOutputs(
    {input},
    {output});
  // Phase 4: set relaxed execution
  model->relaxComputationFloat32toFloat16(true);
  assert(model->isValid());
}

bool is_ignored(int i) {
  static std::set<int> ignore = {};
  return ignore.find(i) != ignore.end();
}