// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints
- _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()),
- _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()),
- _ctx.at(ifm_index).type()));
+ _builder.addShapeConstr(
+ ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()), _ctx.at(ofm_index).type(),
+ _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _builder.addShapeConstr(
+ ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(),
+ _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
struct Param
{
assert(_ctx.at(startData_index).shape().rank() == 1);
assert(_ctx.at(endData_index).shape().rank() == 1);
assert(_ctx.at(stridesData_index).shape().rank() == 1);
- _builder.addShapeConstr(startData_index,
- asTensorInfo(asTensorShape(_ctx.at(startData_index).shape()),
- _ctx.at(startData_index).type()));
+ _builder.addShapeConstr(
+ startData_index,
+ asTensorInfo(asTensorShape(_ctx.at(startData_index).shape()), _ctx.at(startData_index).type(),
+ _ctx.at(startData_index).scale(), _ctx.at(startData_index).zeroPoint()));
_builder.addShapeConstr(endData_index, asTensorInfo(asTensorShape(_ctx.at(endData_index).shape()),
- _ctx.at(endData_index).type()));
- _builder.addShapeConstr(stridesData_index,
- asTensorInfo(asTensorShape(_ctx.at(endData_index).shape()),
- _ctx.at(stridesData_index).type()));
+ _ctx.at(endData_index).type(),
+ _ctx.at(endData_index).scale(),
+ _ctx.at(endData_index).zeroPoint()));
+ _builder.addShapeConstr(
+ stridesData_index,
+ asTensorInfo(asTensorShape(_ctx.at(endData_index).shape()), _ctx.at(stridesData_index).type(),
+ _ctx.at(stridesData_index).scale(), _ctx.at(stridesData_index).zeroPoint()));
// Set initializers for indices data such as order of inputData
{
}
}
- _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()),
- _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()),
- _ctx.at(ifm_index).type()));
+ _builder.addShapeConstr(
+ ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()), _ctx.at(ofm_index).type(),
+ _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _builder.addShapeConstr(
+ ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(),
+ _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
std::vector<uint32_t> axis;
{
const ::internal::tflite::operand::Index ifm_index{node.param().ifm_index};
// Set shape constraints
- _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()),
- _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()),
- _ctx.at(ifm_index).type()));
+ _builder.addShapeConstr(
+ ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()), _ctx.at(ofm_index).type(),
+ _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _builder.addShapeConstr(
+ ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(),
+ _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
struct Param
{
_builder.addShapeConstr(
ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(),
_ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
- _builder.addShapeConstr(axis_index, asTensorInfo(asTensorShape(_ctx.at(axis_index).shape()),
- _ctx.at(axis_index).type()));
+ _builder.addShapeConstr(axis_index,
+ asTensorInfo(asTensorShape(_ctx.at(axis_index).shape()),
+ _ctx.at(axis_index).type(), _ctx.at(axis_index).scale(),
+ _ctx.at(axis_index).zeroPoint()));
// TODO keep_dims==0
assert(keep_dims != 0);
num_units == _ctx.at(hidden_state_out_index).shape().dim(1));
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(output_index, asTensorInfo(asTensorShape(_ctx.at(output_index).shape()),
- _ctx.at(output_index).type()));
+ _builder.addShapeConstr(output_index,
+ asTensorInfo(asTensorShape(_ctx.at(output_index).shape()),
+ _ctx.at(output_index).type(), _ctx.at(output_index).scale(),
+ _ctx.at(output_index).zeroPoint()));
_builder.addShapeConstr(hidden_state_out_index,
asTensorInfo(asTensorShape(_ctx.at(hidden_state_out_index).shape()),
- _ctx.at(hidden_state_out_index).type()));
- _builder.addShapeConstr(input_index, asTensorInfo(asTensorShape(_ctx.at(input_index).shape()),
- _ctx.at(input_index).type()));
+ _ctx.at(hidden_state_out_index).type(),
+ _ctx.at(hidden_state_out_index).scale(),
+ _ctx.at(hidden_state_out_index).zeroPoint()));
+ _builder.addShapeConstr(input_index,
+ asTensorInfo(asTensorShape(_ctx.at(input_index).shape()),
+ _ctx.at(input_index).type(), _ctx.at(input_index).scale(),
+ _ctx.at(input_index).zeroPoint()));
_builder.addShapeConstr(weights_index, asTensorInfo(asTensorShape(_ctx.at(weights_index).shape()),
- _ctx.at(weights_index).type()));
+ _ctx.at(weights_index).type(),
+ _ctx.at(weights_index).scale(),
+ _ctx.at(weights_index).zeroPoint()));
_builder.addShapeConstr(recurrent_weights_index,
asTensorInfo(asTensorShape(_ctx.at(recurrent_weights_index).shape()),
- _ctx.at(recurrent_weights_index).type()));
- _builder.addShapeConstr(bias_index, asTensorInfo(asTensorShape(_ctx.at(bias_index).shape()),
- _ctx.at(bias_index).type()));
+ _ctx.at(recurrent_weights_index).type(),
+ _ctx.at(recurrent_weights_index).scale(),
+ _ctx.at(recurrent_weights_index).zeroPoint()));
+ _builder.addShapeConstr(bias_index,
+ asTensorInfo(asTensorShape(_ctx.at(bias_index).shape()),
+ _ctx.at(bias_index).type(), _ctx.at(bias_index).scale(),
+ _ctx.at(bias_index).zeroPoint()));
_builder.addShapeConstr(hidden_state_in_index,
asTensorInfo(asTensorShape(_ctx.at(hidden_state_in_index).shape()),
- _ctx.at(hidden_state_in_index).type()));
+ _ctx.at(hidden_state_in_index).type(),
+ _ctx.at(hidden_state_in_index).scale(),
+ _ctx.at(hidden_state_in_index).zeroPoint()));
// Construct operation parameters
struct Param
const ::internal::tflite::operand::Index ifm_index{node.param().input_index};
// Set shape constraints
- _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()),
- _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()),
- _ctx.at(ifm_index).type()));
+ _builder.addShapeConstr(
+ ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()), _ctx.at(ofm_index).type(),
+ _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _builder.addShapeConstr(
+ ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(),
+ _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
struct Param
{
const ::internal::tflite::operand::Index input_index{node.param().input_index};
// Set shape constraints
- _builder.addShapeConstr(output_index, asTensorInfo(asTensorShape(_ctx.at(output_index).shape()),
- _ctx.at(output_index).type()));
- _builder.addShapeConstr(input_index, asTensorInfo(asTensorShape(_ctx.at(input_index).shape()),
- _ctx.at(input_index).type()));
+ _builder.addShapeConstr(output_index,
+ asTensorInfo(asTensorShape(_ctx.at(output_index).shape()),
+ _ctx.at(output_index).type(), _ctx.at(output_index).scale(),
+ _ctx.at(output_index).zeroPoint()));
+ _builder.addShapeConstr(input_index,
+ asTensorInfo(asTensorShape(_ctx.at(input_index).shape()),
+ _ctx.at(input_index).type(), _ctx.at(input_index).scale(),
+ _ctx.at(input_index).zeroPoint()));
struct Param
{
assert((ANEURALNETWORKS_PADDING_SAME == padding_type) ||
(ANEURALNETWORKS_PADDING_VALID == padding_type));
- _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()),
- _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()),
- _ctx.at(ifm_index).type()));
+ _builder.addShapeConstr(
+ ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()), _ctx.at(ofm_index).type(),
+ _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _builder.addShapeConstr(
+ ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(),
+ _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
struct Param
{
const int32_t padding_top = _ctx.at(padding_top_index).asScalar<int32_t>();
const int32_t padding_bottom = _ctx.at(padding_bottom_index).asScalar<int32_t>();
- _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()),
- _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()),
- _ctx.at(ifm_index).type()));
+ _builder.addShapeConstr(
+ ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()), _ctx.at(ofm_index).type(),
+ _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _builder.addShapeConstr(
+ ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(),
+ _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
// Construct operation parameters
struct Param
const ::internal::tflite::operand::Index ifm_index{node.param().ifm_index};
// Set shape constraints
- _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()),
- _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()),
- _ctx.at(ifm_index).type()));
+ _builder.addShapeConstr(
+ ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()), _ctx.at(ofm_index).type(),
+ _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _builder.addShapeConstr(
+ ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(),
+ _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
struct Param
{
}
// Set shape constraints
- _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()),
- _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()),
- _ctx.at(ifm_index).type()));
+ _builder.addShapeConstr(
+ ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()), _ctx.at(ofm_index).type(),
+ _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _builder.addShapeConstr(
+ ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(),
+ _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
uint32_t input_rank = ifm_shape.rank();
std::vector<uint32_t> axis;