blob: 442a13bee6302c2a87cd0c086fda8e8d2fb5573c [file] [log] [blame]
// clang-format off
// Generated file (from: resize_bilinear_v1_2.mod.py). Do not edit
void CreateModel_shape_nhwc(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type1(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
OperandType type2(Type::TENSOR_FLOAT32, {1, 3, 3, 1});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type1);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type2);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_nhwc(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nhwc_relaxed(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type1(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
OperandType type2(Type::TENSOR_FLOAT32, {1, 3, 3, 1});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type1);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type2);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_shape_nhwc_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nhwc_float16(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type3(Type::INT32, {});
OperandType type7(Type::TENSOR_FLOAT16, {1, 2, 2, 1});
OperandType type8(Type::TENSOR_FLOAT16, {1, 3, 3, 1});
// Phase 1, operands
auto op1 = model->addOperand(&type7);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type8);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_nhwc_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nhwc_quant8(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type10(Type::TENSOR_QUANT8_ASYMM, {1, 3, 3, 1}, 0.01f, 0);
OperandType type3(Type::INT32, {});
OperandType type9(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 1}, 0.01f, 0);
// Phase 1, operands
auto op1 = model->addOperand(&type9);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type10);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_nhwc_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nchw(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type11(Type::TENSOR_FLOAT32, {1, 1, 2, 2});
OperandType type12(Type::TENSOR_FLOAT32, {1, 1, 3, 3});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type11);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type12);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_nchw(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nchw_relaxed(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type11(Type::TENSOR_FLOAT32, {1, 1, 2, 2});
OperandType type12(Type::TENSOR_FLOAT32, {1, 1, 3, 3});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type11);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type12);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_shape_nchw_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nchw_float16(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type13(Type::TENSOR_FLOAT16, {1, 1, 2, 2});
OperandType type14(Type::TENSOR_FLOAT16, {1, 1, 3, 3});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type13);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type14);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_nchw_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nchw_quant8(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type15(Type::TENSOR_QUANT8_ASYMM, {1, 1, 2, 2}, 0.01f, 0);
OperandType type16(Type::TENSOR_QUANT8_ASYMM, {1, 1, 3, 3}, 0.01f, 0);
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type15);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type16);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_nchw_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nhwc(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type1(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type1);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type17);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nhwc_relaxed(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type1(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type1);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type17);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nhwc_float16(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
OperandType type3(Type::INT32, {});
OperandType type7(Type::TENSOR_FLOAT16, {1, 2, 2, 1});
// Phase 1, operands
auto op1 = model->addOperand(&type7);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type18);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nhwc_quant8(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type19(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.01f, 0);
OperandType type3(Type::INT32, {});
OperandType type9(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 1}, 0.01f, 0);
// Phase 1, operands
auto op1 = model->addOperand(&type9);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type19);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nchw(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type11(Type::TENSOR_FLOAT32, {1, 1, 2, 2});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type11);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type17);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nchw(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nchw_relaxed(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type11(Type::TENSOR_FLOAT32, {1, 1, 2, 2});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type11);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type17);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nchw_float16(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type13(Type::TENSOR_FLOAT16, {1, 1, 2, 2});
OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type13);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type18);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nchw_quant8(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type15(Type::TENSOR_QUANT8_ASYMM, {1, 1, 2, 2}, 0.01f, 0);
OperandType type19(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.01f, 0);
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type15);
auto param = model->addOperand(&type3);
auto param1 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type19);
// Phase 2, operations
static int32_t param_init[] = {3};
model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
static int32_t param1_init[] = {3};
model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param, param1, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nhwc(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type1(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
OperandType type2(Type::TENSOR_FLOAT32, {1, 3, 3, 1});
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type1);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type2);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_nhwc(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nhwc_relaxed(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type1(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
OperandType type2(Type::TENSOR_FLOAT32, {1, 3, 3, 1});
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type1);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type2);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_scale_nhwc_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nhwc_float16(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type20(Type::FLOAT16, {});
OperandType type7(Type::TENSOR_FLOAT16, {1, 2, 2, 1});
OperandType type8(Type::TENSOR_FLOAT16, {1, 3, 3, 1});
// Phase 1, operands
auto op1 = model->addOperand(&type7);
auto param2 = model->addOperand(&type20);
auto param3 = model->addOperand(&type20);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type8);
// Phase 2, operations
static _Float16 param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
static _Float16 param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_nhwc_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nhwc_quant8(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type10(Type::TENSOR_QUANT8_ASYMM, {1, 3, 3, 1}, 0.01f, 0);
OperandType type4(Type::FLOAT32, {});
OperandType type9(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 1}, 0.01f, 0);
// Phase 1, operands
auto op1 = model->addOperand(&type9);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type10);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_nhwc_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nchw(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type11(Type::TENSOR_FLOAT32, {1, 1, 2, 2});
OperandType type12(Type::TENSOR_FLOAT32, {1, 1, 3, 3});
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type11);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type12);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_nchw(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nchw_relaxed(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type11(Type::TENSOR_FLOAT32, {1, 1, 2, 2});
OperandType type12(Type::TENSOR_FLOAT32, {1, 1, 3, 3});
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type11);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type12);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_scale_nchw_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nchw_float16(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type13(Type::TENSOR_FLOAT16, {1, 1, 2, 2});
OperandType type14(Type::TENSOR_FLOAT16, {1, 1, 3, 3});
OperandType type20(Type::FLOAT16, {});
// Phase 1, operands
auto op1 = model->addOperand(&type13);
auto param2 = model->addOperand(&type20);
auto param3 = model->addOperand(&type20);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type14);
// Phase 2, operations
static _Float16 param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
static _Float16 param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_nchw_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nchw_quant8(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type15(Type::TENSOR_QUANT8_ASYMM, {1, 1, 2, 2}, 0.01f, 0);
OperandType type16(Type::TENSOR_QUANT8_ASYMM, {1, 1, 3, 3}, 0.01f, 0);
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type15);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type16);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_nchw_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nhwc(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type1(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type1);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type17);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nhwc_relaxed(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type1(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type1);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type17);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nhwc_float16(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
OperandType type20(Type::FLOAT16, {});
OperandType type7(Type::TENSOR_FLOAT16, {1, 2, 2, 1});
// Phase 1, operands
auto op1 = model->addOperand(&type7);
auto param2 = model->addOperand(&type20);
auto param3 = model->addOperand(&type20);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type18);
// Phase 2, operations
static _Float16 param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
static _Float16 param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nhwc_quant8(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type19(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.01f, 0);
OperandType type4(Type::FLOAT32, {});
OperandType type9(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 1}, 0.01f, 0);
// Phase 1, operands
auto op1 = model->addOperand(&type9);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type19);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nchw(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type11(Type::TENSOR_FLOAT32, {1, 1, 2, 2});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type11);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type17);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nchw(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nchw_relaxed(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type11(Type::TENSOR_FLOAT32, {1, 1, 2, 2});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type11);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type17);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nchw_float16(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type13(Type::TENSOR_FLOAT16, {1, 1, 2, 2});
OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
OperandType type20(Type::FLOAT16, {});
// Phase 1, operands
auto op1 = model->addOperand(&type13);
auto param2 = model->addOperand(&type20);
auto param3 = model->addOperand(&type20);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type18);
// Phase 2, operations
static _Float16 param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
static _Float16 param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nchw_quant8(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type15(Type::TENSOR_QUANT8_ASYMM, {1, 1, 2, 2}, 0.01f, 0);
OperandType type19(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.01f, 0);
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op1 = model->addOperand(&type15);
auto param2 = model->addOperand(&type4);
auto param3 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op4 = model->addOperand(&type19);
// Phase 2, operations
static float param2_init[] = {1.5f};
model->setOperandValue(param2, param2_init, sizeof(float) * 1);
static float param3_init[] = {1.5f};
model->setOperandValue(param3, param3_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op1, param2, param3, layout}, {op4});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1},
{op4});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nhwc_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type3(Type::INT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
OperandType type6(Type::TENSOR_FLOAT32, {1, 3, 3, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type6);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_nhwc_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nhwc_relaxed_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type3(Type::INT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
OperandType type6(Type::TENSOR_FLOAT32, {1, 3, 3, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type6);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_shape_nhwc_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nhwc_float16_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type21(Type::TENSOR_FLOAT16, {1, 2, 2, 2});
OperandType type22(Type::TENSOR_FLOAT16, {1, 3, 3, 2});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type21);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type22);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_nhwc_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nhwc_quant8_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type23(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 2}, 0.25f, 0);
OperandType type24(Type::TENSOR_QUANT8_ASYMM, {1, 3, 3, 2}, 0.25f, 0);
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type23);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type24);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_nhwc_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nchw_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type25(Type::TENSOR_FLOAT32, {1, 2, 3, 3});
OperandType type3(Type::INT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type25);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_nchw_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nchw_relaxed_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type25(Type::TENSOR_FLOAT32, {1, 2, 3, 3});
OperandType type3(Type::INT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type25);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_shape_nchw_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nchw_float16_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type21(Type::TENSOR_FLOAT16, {1, 2, 2, 2});
OperandType type26(Type::TENSOR_FLOAT16, {1, 2, 3, 3});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type21);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type26);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_nchw_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_nchw_quant8_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type23(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 2}, 0.25f, 0);
OperandType type27(Type::TENSOR_QUANT8_ASYMM, {1, 2, 3, 3}, 0.25f, 0);
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type23);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type27);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_nchw_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nhwc_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type3(Type::INT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type17);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nhwc_relaxed_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type3(Type::INT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type17);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nhwc_float16_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
OperandType type21(Type::TENSOR_FLOAT16, {1, 2, 2, 2});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type21);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type18);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nhwc_quant8_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type23(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 2}, 0.25f, 0);
OperandType type28(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.25f, 0);
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type23);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type28);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nchw_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type3(Type::INT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type17);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nchw_relaxed_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type3(Type::INT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type17);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nchw_float16_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
OperandType type21(Type::TENSOR_FLOAT16, {1, 2, 2, 2});
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type21);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type18);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_nchw_quant8_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type23(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 2}, 0.25f, 0);
OperandType type28(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.25f, 0);
OperandType type3(Type::INT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type23);
auto param4 = model->addOperand(&type3);
auto param5 = model->addOperand(&type3);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type28);
// Phase 2, operations
static int32_t param4_init[] = {3};
model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
static int32_t param5_init[] = {3};
model->setOperandValue(param5, param5_init, sizeof(int32_t) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param4, param5, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nhwc_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type4(Type::FLOAT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
OperandType type6(Type::TENSOR_FLOAT32, {1, 3, 3, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type6);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_nhwc_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nhwc_relaxed_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type4(Type::FLOAT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
OperandType type6(Type::TENSOR_FLOAT32, {1, 3, 3, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type6);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_scale_nhwc_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nhwc_float16_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type20(Type::FLOAT16, {});
OperandType type21(Type::TENSOR_FLOAT16, {1, 2, 2, 2});
OperandType type22(Type::TENSOR_FLOAT16, {1, 3, 3, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type21);
auto param6 = model->addOperand(&type20);
auto param7 = model->addOperand(&type20);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type22);
// Phase 2, operations
static _Float16 param6_init[] = {1.600000023841858f};
model->setOperandValue(param6, param6_init, sizeof(_Float16) * 1);
static _Float16 param7_init[] = {1.600000023841858f};
model->setOperandValue(param7, param7_init, sizeof(_Float16) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_nhwc_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nhwc_quant8_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type23(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 2}, 0.25f, 0);
OperandType type24(Type::TENSOR_QUANT8_ASYMM, {1, 3, 3, 2}, 0.25f, 0);
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type23);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type24);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_nhwc_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nchw_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type25(Type::TENSOR_FLOAT32, {1, 2, 3, 3});
OperandType type4(Type::FLOAT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type25);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_nchw_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nchw_relaxed_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type25(Type::TENSOR_FLOAT32, {1, 2, 3, 3});
OperandType type4(Type::FLOAT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type25);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_scale_nchw_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nchw_float16_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type20(Type::FLOAT16, {});
OperandType type21(Type::TENSOR_FLOAT16, {1, 2, 2, 2});
OperandType type26(Type::TENSOR_FLOAT16, {1, 2, 3, 3});
// Phase 1, operands
auto op11 = model->addOperand(&type21);
auto param6 = model->addOperand(&type20);
auto param7 = model->addOperand(&type20);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type26);
// Phase 2, operations
static _Float16 param6_init[] = {1.600000023841858f};
model->setOperandValue(param6, param6_init, sizeof(_Float16) * 1);
static _Float16 param7_init[] = {1.600000023841858f};
model->setOperandValue(param7, param7_init, sizeof(_Float16) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_nchw_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_nchw_quant8_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type23(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 2}, 0.25f, 0);
OperandType type27(Type::TENSOR_QUANT8_ASYMM, {1, 2, 3, 3}, 0.25f, 0);
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type23);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type27);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_nchw_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nhwc_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type4(Type::FLOAT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type17);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nhwc_relaxed_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type4(Type::FLOAT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type17);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nhwc_float16_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
OperandType type20(Type::FLOAT16, {});
OperandType type21(Type::TENSOR_FLOAT16, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type21);
auto param6 = model->addOperand(&type20);
auto param7 = model->addOperand(&type20);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type18);
// Phase 2, operations
static _Float16 param6_init[] = {1.600000023841858f};
model->setOperandValue(param6, param6_init, sizeof(_Float16) * 1);
static _Float16 param7_init[] = {1.600000023841858f};
model->setOperandValue(param7, param7_init, sizeof(_Float16) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nhwc_quant8_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type23(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 2}, 0.25f, 0);
OperandType type28(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.25f, 0);
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type23);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type28);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {false};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nchw_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type4(Type::FLOAT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type17);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nchw_relaxed_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
OperandType type4(Type::FLOAT32, {});
OperandType type5(Type::TENSOR_FLOAT32, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type5);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type17);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
// Phase 4: set relaxed execution
model->relaxComputationFloat32toFloat16(true);
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nchw_float16_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
OperandType type20(Type::FLOAT16, {});
OperandType type21(Type::TENSOR_FLOAT16, {1, 2, 2, 2});
// Phase 1, operands
auto op11 = model->addOperand(&type21);
auto param6 = model->addOperand(&type20);
auto param7 = model->addOperand(&type20);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type18);
// Phase 2, operations
static _Float16 param6_init[] = {1.600000023841858f};
model->setOperandValue(param6, param6_init, sizeof(_Float16) * 1);
static _Float16 param7_init[] = {1.600000023841858f};
model->setOperandValue(param7, param7_init, sizeof(_Float16) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_nchw_quant8_2(Model *model) {
OperandType type0(Type::BOOL, {});
OperandType type23(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 2}, 0.25f, 0);
OperandType type28(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.25f, 0);
OperandType type4(Type::FLOAT32, {});
// Phase 1, operands
auto op11 = model->addOperand(&type23);
auto param6 = model->addOperand(&type4);
auto param7 = model->addOperand(&type4);
auto layout = model->addOperand(&type0);
auto op41 = model->addOperand(&type28);
// Phase 2, operations
static float param6_init[] = {1.6f};
model->setOperandValue(param6, param6_init, sizeof(float) * 1);
static float param7_init[] = {1.6f};
model->setOperandValue(param7, param7_init, sizeof(float) * 1);
static bool8 layout_init[] = {true};
model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op11, param6, param7, layout}, {op41});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op11},
{op41});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_float16(Model *model) {
OperandType type3(Type::INT32, {});
OperandType type7(Type::TENSOR_FLOAT16, {1, 2, 2, 1});
OperandType type8(Type::TENSOR_FLOAT16, {1, 3, 3, 1});
// Phase 1, operands
auto op12 = model->addOperand(&type7);
auto param8 = model->addOperand(&type3);
auto param9 = model->addOperand(&type3);
auto op42 = model->addOperand(&type8);
// Phase 2, operations
static int32_t param8_init[] = {3};
model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
static int32_t param9_init[] = {3};
model->setOperandValue(param9, param9_init, sizeof(int32_t) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op12, param8, param9}, {op42});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op12},
{op42});
assert(model->isValid());
}
inline bool is_ignored_shape_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_quant8(Model *model) {
OperandType type10(Type::TENSOR_QUANT8_ASYMM, {1, 3, 3, 1}, 0.01f, 0);
OperandType type3(Type::INT32, {});
OperandType type9(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 1}, 0.01f, 0);
// Phase 1, operands
auto op12 = model->addOperand(&type9);
auto param8 = model->addOperand(&type3);
auto param9 = model->addOperand(&type3);
auto op42 = model->addOperand(&type10);
// Phase 2, operations
static int32_t param8_init[] = {3};
model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
static int32_t param9_init[] = {3};
model->setOperandValue(param9, param9_init, sizeof(int32_t) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op12, param8, param9}, {op42});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op12},
{op42});
assert(model->isValid());
}
inline bool is_ignored_shape_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_float16(Model *model) {
OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
OperandType type3(Type::INT32, {});
OperandType type7(Type::TENSOR_FLOAT16, {1, 2, 2, 1});
// Phase 1, operands
auto op12 = model->addOperand(&type7);
auto param8 = model->addOperand(&type3);
auto param9 = model->addOperand(&type3);
auto op42 = model->addOperand(&type18);
// Phase 2, operations
static int32_t param8_init[] = {3};
model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
static int32_t param9_init[] = {3};
model->setOperandValue(param9, param9_init, sizeof(int32_t) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op12, param8, param9}, {op42});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op12},
{op42});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_shape_dynamic_output_shape_quant8(Model *model) {
OperandType type19(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.01f, 0);
OperandType type3(Type::INT32, {});
OperandType type9(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 1}, 0.01f, 0);
// Phase 1, operands
auto op12 = model->addOperand(&type9);
auto param8 = model->addOperand(&type3);
auto param9 = model->addOperand(&type3);
auto op42 = model->addOperand(&type19);
// Phase 2, operations
static int32_t param8_init[] = {3};
model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
static int32_t param9_init[] = {3};
model->setOperandValue(param9, param9_init, sizeof(int32_t) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op12, param8, param9}, {op42});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op12},
{op42});
assert(model->isValid());
}
inline bool is_ignored_shape_dynamic_output_shape_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_float16(Model *model) {
OperandType type20(Type::FLOAT16, {});
OperandType type7(Type::TENSOR_FLOAT16, {1, 2, 2, 1});
OperandType type8(Type::TENSOR_FLOAT16, {1, 3, 3, 1});
// Phase 1, operands
auto op12 = model->addOperand(&type7);
auto param10 = model->addOperand(&type20);
auto param11 = model->addOperand(&type20);
auto op42 = model->addOperand(&type8);
// Phase 2, operations
static _Float16 param10_init[] = {1.7999999523162842f};
model->setOperandValue(param10, param10_init, sizeof(_Float16) * 1);
static _Float16 param11_init[] = {1.7999999523162842f};
model->setOperandValue(param11, param11_init, sizeof(_Float16) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op12, param10, param11}, {op42});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op12},
{op42});
assert(model->isValid());
}
inline bool is_ignored_scale_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_quant8(Model *model) {
OperandType type10(Type::TENSOR_QUANT8_ASYMM, {1, 3, 3, 1}, 0.01f, 0);
OperandType type4(Type::FLOAT32, {});
OperandType type9(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 1}, 0.01f, 0);
// Phase 1, operands
auto op12 = model->addOperand(&type9);
auto param10 = model->addOperand(&type4);
auto param11 = model->addOperand(&type4);
auto op42 = model->addOperand(&type10);
// Phase 2, operations
static float param10_init[] = {1.8f};
model->setOperandValue(param10, param10_init, sizeof(float) * 1);
static float param11_init[] = {1.8f};
model->setOperandValue(param11, param11_init, sizeof(float) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op12, param10, param11}, {op42});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op12},
{op42});
assert(model->isValid());
}
inline bool is_ignored_scale_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_float16(Model *model) {
OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
OperandType type20(Type::FLOAT16, {});
OperandType type7(Type::TENSOR_FLOAT16, {1, 2, 2, 1});
// Phase 1, operands
auto op12 = model->addOperand(&type7);
auto param10 = model->addOperand(&type20);
auto param11 = model->addOperand(&type20);
auto op42 = model->addOperand(&type18);
// Phase 2, operations
static _Float16 param10_init[] = {1.7999999523162842f};
model->setOperandValue(param10, param10_init, sizeof(_Float16) * 1);
static _Float16 param11_init[] = {1.7999999523162842f};
model->setOperandValue(param11, param11_init, sizeof(_Float16) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op12, param10, param11}, {op42});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op12},
{op42});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
void CreateModel_scale_dynamic_output_shape_quant8(Model *model) {
OperandType type19(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.01f, 0);
OperandType type4(Type::FLOAT32, {});
OperandType type9(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 1}, 0.01f, 0);
// Phase 1, operands
auto op12 = model->addOperand(&type9);
auto param10 = model->addOperand(&type4);
auto param11 = model->addOperand(&type4);
auto op42 = model->addOperand(&type19);
// Phase 2, operations
static float param10_init[] = {1.8f};
model->setOperandValue(param10, param10_init, sizeof(float) * 1);
static float param11_init[] = {1.8f};
model->setOperandValue(param11, param11_init, sizeof(float) * 1);
model->addOperation(ANEURALNETWORKS_RESIZE_BILINEAR, {op12, param10, param11}, {op42});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op12},
{op42});
assert(model->isValid());
}
inline bool is_ignored_scale_dynamic_output_shape_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}