// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type(),
- _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _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()));
if (!(_ctx.at(lhs_index).shape() == _ctx.at(rhs_index).shape()))
{
const_cast<::internal::tflite::operand::Shape &>(_ctx.at(rhs_index).shape())
.extendRank(broadcast_rank);
}
- _builder.addShapeConstr(lhs_index,
- asTensorInfo(_ctx.at(lhs_index).shape(), _ctx.at(lhs_index).type(),
- _ctx.at(lhs_index).scale(), _ctx.at(lhs_index).zeroPoint()));
- _builder.addShapeConstr(rhs_index,
- asTensorInfo(_ctx.at(rhs_index).shape(), _ctx.at(rhs_index).type(),
- _ctx.at(rhs_index).scale(), _ctx.at(rhs_index).zeroPoint()));
+ _builder.addShapeConstr(
+ lhs_index, asTensorInfo(asTensorShape(_ctx.at(lhs_index).shape()), _ctx.at(lhs_index).type(),
+ _ctx.at(lhs_index).scale(), _ctx.at(lhs_index).zeroPoint()));
+ _builder.addShapeConstr(
+ rhs_index, asTensorInfo(asTensorShape(_ctx.at(rhs_index).shape()), _ctx.at(rhs_index).type(),
+ _ctx.at(rhs_index).scale(), _ctx.at(rhs_index).zeroPoint()));
// Construct operation parameters
struct Param
const ::internal::tflite::operand::Index activation_index{node.param().activation_index};
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type(),
- _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _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()));
if (!(_ctx.at(lhs_index).shape() == _ctx.at(rhs_index).shape()))
{
const_cast<::internal::tflite::operand::Shape &>(_ctx.at(rhs_index).shape())
.extendRank(broadcast_rank);
}
- _builder.addShapeConstr(lhs_index,
- asTensorInfo(_ctx.at(lhs_index).shape(), _ctx.at(lhs_index).type(),
- _ctx.at(lhs_index).scale(), _ctx.at(lhs_index).zeroPoint()));
- _builder.addShapeConstr(rhs_index,
- asTensorInfo(_ctx.at(rhs_index).shape(), _ctx.at(rhs_index).type(),
- _ctx.at(rhs_index).scale(), _ctx.at(rhs_index).zeroPoint()));
+ _builder.addShapeConstr(
+ lhs_index, asTensorInfo(asTensorShape(_ctx.at(lhs_index).shape()), _ctx.at(lhs_index).type(),
+ _ctx.at(lhs_index).scale(), _ctx.at(lhs_index).zeroPoint()));
+ _builder.addShapeConstr(
+ rhs_index, asTensorInfo(asTensorShape(_ctx.at(rhs_index).shape()), _ctx.at(rhs_index).type(),
+ _ctx.at(rhs_index).scale(), _ctx.at(rhs_index).zeroPoint()));
// Construct operation parameters
struct Param
assert(_ctx.at(ofm_index).scale() > _ctx.at(lhs_index).scale() * _ctx.at(rhs_index).scale());
}
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type(),
- _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _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()));
if (!(_ctx.at(lhs_index).shape() == _ctx.at(rhs_index).shape()))
{
const_cast<::internal::tflite::operand::Shape &>(_ctx.at(rhs_index).shape())
.extendRank(broadcast_rank);
}
- _builder.addShapeConstr(lhs_index,
- asTensorInfo(_ctx.at(lhs_index).shape(), _ctx.at(lhs_index).type(),
- _ctx.at(lhs_index).scale(), _ctx.at(lhs_index).zeroPoint()));
- _builder.addShapeConstr(rhs_index,
- asTensorInfo(_ctx.at(rhs_index).shape(), _ctx.at(rhs_index).type(),
- _ctx.at(rhs_index).scale(), _ctx.at(rhs_index).zeroPoint()));
+ _builder.addShapeConstr(
+ lhs_index, asTensorInfo(asTensorShape(_ctx.at(lhs_index).shape()), _ctx.at(lhs_index).type(),
+ _ctx.at(lhs_index).scale(), _ctx.at(lhs_index).zeroPoint()));
+ _builder.addShapeConstr(
+ rhs_index, asTensorInfo(asTensorShape(_ctx.at(rhs_index).shape()), _ctx.at(rhs_index).type(),
+ _ctx.at(rhs_index).scale(), _ctx.at(rhs_index).zeroPoint()));
struct Param
{
const ::internal::tflite::operand::Index activation_index{node.param().activation_index};
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type(),
- _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
+ _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()));
if (!(_ctx.at(lhs_index).shape() == _ctx.at(rhs_index).shape()))
{
.extendRank(broadcast_rank);
}
- _builder.addShapeConstr(lhs_index,
- asTensorInfo(_ctx.at(lhs_index).shape(), _ctx.at(lhs_index).type(),
- _ctx.at(lhs_index).scale(), _ctx.at(lhs_index).zeroPoint()));
- _builder.addShapeConstr(rhs_index,
- asTensorInfo(_ctx.at(rhs_index).shape(), _ctx.at(rhs_index).type(),
- _ctx.at(rhs_index).scale(), _ctx.at(rhs_index).zeroPoint()));
+ _builder.addShapeConstr(
+ lhs_index, asTensorInfo(asTensorShape(_ctx.at(lhs_index).shape()), _ctx.at(lhs_index).type(),
+ _ctx.at(lhs_index).scale(), _ctx.at(lhs_index).zeroPoint()));
+ _builder.addShapeConstr(
+ rhs_index, asTensorInfo(asTensorShape(_ctx.at(rhs_index).shape()), _ctx.at(rhs_index).type(),
+ _ctx.at(rhs_index).scale(), _ctx.at(rhs_index).zeroPoint()));
// Construct operation parameters
struct Param
// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(ofm_shape, _ctx.at(ofm_index).type(),
- _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
- _builder.addShapeConstr(ifm_index,
- asTensorInfo(ifm_shape, _ctx.at(ifm_index).type(),
- _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
- _builder.addShapeConstr(ker_index,
- asTensorInfo(ker_shape, _ctx.at(ker_index).type(),
- _ctx.at(ker_index).scale(), _ctx.at(ker_index).zeroPoint()));
- _builder.addShapeConstr(bias_index, asTensorInfo(bias_size, _ctx.at(bias_index).type(),
- _ctx.at(bias_index).scale(),
- _ctx.at(bias_index).zeroPoint()));
+ _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()));
+ _builder.addShapeConstr(
+ ker_index, asTensorInfo(asTensorShape(_ctx.at(ker_index).shape()), _ctx.at(ker_index).type(),
+ _ctx.at(ker_index).scale(), _ctx.at(ker_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()));
// Set initializer for kernel
{
const ::internal::tflite::operand::Index activation_index{node.param().activation_index};
- const auto ofm_shape = _ctx.at(ofm_index).shape().asFeature();
- const auto ifm_shape = _ctx.at(ifm_index).shape().asFeature();
- const auto ker_shape = _ctx.at(ker_index).shape().asKernel();
- const auto bias_size = _ctx.at(bias_index).shape().asVector();
-
const int32_t padding_left = _ctx.at(padding_left_index).asScalar<int32_t>();
const int32_t padding_right = _ctx.at(padding_right_index).asScalar<int32_t>();
const int32_t padding_top = _ctx.at(padding_top_index).asScalar<int32_t>();
// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(ofm_shape, _ctx.at(ofm_index).type(),
- _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
- _builder.addShapeConstr(ifm_index,
- asTensorInfo(ifm_shape, _ctx.at(ifm_index).type(),
- _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
- _builder.addShapeConstr(ker_index,
- asTensorInfo(ker_shape, _ctx.at(ker_index).type(),
- _ctx.at(ker_index).scale(), _ctx.at(ker_index).zeroPoint()));
- _builder.addShapeConstr(bias_index, asTensorInfo(bias_size, _ctx.at(bias_index).type(),
- _ctx.at(bias_index).scale(),
- _ctx.at(bias_index).zeroPoint()));
+ _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()));
+ _builder.addShapeConstr(
+ ker_index, asTensorInfo(asTensorShape(_ctx.at(ker_index).shape()), _ctx.at(ker_index).type(),
+ _ctx.at(ker_index).scale(), _ctx.at(ker_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()));
// Set initializer for kernel
// Workaround for https://github.sec.samsung.net/STAR/nnfw/issues/2319
if (_ctx.at(ker_index).hasData())
{
+ const auto ker_shape = _ctx.at(ker_index).shape().asKernel();
auto ker_base = _ctx.at(ker_index).data().base();
auto ker_size = _ctx.at(ker_index).data().size();
auto ker_type = _ctx.at(ker_index).type();
// See above comment.
if (_ctx.at(bias_index).hasData())
{
+ const auto bias_size = _ctx.at(bias_index).shape().asVector();
auto bias_base = _ctx.at(bias_index).data().base();
auto bias_type = _ctx.at(bias_index).type();
// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(ofm_shape, _ctx.at(ofm_index).type(),
- _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
- _builder.addShapeConstr(ifm_index,
- asTensorInfo(ifm_shape, _ctx.at(ifm_index).type(),
- _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
+ _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()));
// NOTE DepthwiseConv2D kernel is of shape [1, KER_W, KER_H, IFM_C * MULTIPLIER]
- _builder.addShapeConstr(ker_index,
- asTensorInfo(ker_shape, _ctx.at(ker_index).type(),
- _ctx.at(ker_index).scale(), _ctx.at(ker_index).zeroPoint()));
- _builder.addShapeConstr(bias_index, asTensorInfo(bias_size, _ctx.at(bias_index).type(),
- _ctx.at(bias_index).scale(),
- _ctx.at(bias_index).zeroPoint()));
+ _builder.addShapeConstr(
+ ker_index, asTensorInfo(asTensorShape(_ctx.at(ker_index).shape()), _ctx.at(ker_index).type(),
+ _ctx.at(ker_index).scale(), _ctx.at(ker_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()));
// Construct operation parameters
struct Param
// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(ofm_shape, _ctx.at(ofm_index).type(),
- _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint()));
- _builder.addShapeConstr(ifm_index,
- asTensorInfo(ifm_shape, _ctx.at(ifm_index).type(),
- _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
+ _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()));
// NOTE DepthwiseConv2D kernel is of shape [1, KER_W, KER_H, IFM_C * MULTIPLIER]
- _builder.addShapeConstr(ker_index,
- asTensorInfo(ker_shape, _ctx.at(ker_index).type(),
- _ctx.at(ker_index).scale(), _ctx.at(ker_index).zeroPoint()));
- _builder.addShapeConstr(bias_index, asTensorInfo(bias_size, _ctx.at(bias_index).type(),
- _ctx.at(bias_index).scale(),
- _ctx.at(bias_index).zeroPoint()));
+ _builder.addShapeConstr(
+ ker_index, asTensorInfo(asTensorShape(_ctx.at(ker_index).shape()), _ctx.at(ker_index).type(),
+ _ctx.at(ker_index).scale(), _ctx.at(ker_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()));
// Construct operation parameters
struct Param
assert(_ctx.at(input_index).type() == ANEURALNETWORKS_TENSOR_QUANT8_ASYMM);
assert(_ctx.at(output_index).type() == ANEURALNETWORKS_TENSOR_FLOAT32);
- const auto output_shape = _ctx.at(output_index).shape();
- const auto input_shape = _ctx.at(input_index).shape();
-
// Set Shape Constraints
- _builder.addShapeConstr(output_index, asTensorInfo(output_shape, _ctx.at(output_index).type(),
- _ctx.at(output_index).scale(),
- _ctx.at(output_index).zeroPoint()));
- _builder.addShapeConstr(input_index, asTensorInfo(input_shape, _ctx.at(input_index).type(),
- _ctx.at(input_index).scale(),
- _ctx.at(input_index).zeroPoint()));
+ _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()));
// Construct operation parameters
struct Param
// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index, asTensorInfo(ofm_shape, _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(ifm_shape, _ctx.at(ifm_index).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()));
// Construct operation parameters
struct Param
// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index, asTensorInfo(ofm_shape, _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(ifm_shape, _ctx.at(ifm_index).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()));
// Construct operation parameters
struct Param
// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index, asTensorInfo(ofm_shape, _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(ifm_shape, _ctx.at(ifm_index).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()));
// Construct operation parameters
struct Param
// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(ofm_index, asTensorInfo(ofm_shape, _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(ifm_shape, _ctx.at(ifm_index).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()));
// Construct operation parameters
struct Param
}
// Set Shape Constraints and TensorInfo (for output)
- _builder.addShapeConstr(ofm_index, asTensorInfo(ofm_shape, _ctx.at(ofm_index).type()));
+ _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()),
+ _ctx.at(ofm_index).type()));
// Set Shape Constraints and TensorInfo (for input)
const uint32_t coord_index = ToARMComputeAxis(input_rank, axis).value();
coordinates[coord_index] = depth;
- _builder.addSubsumptionConstr(ifm_index, ofm_index, coordinates, asTensorShape(ifm_shape),
- true);
+ _builder.addSubsumptionConstr(ifm_index, ofm_index, coordinates,
+ asTensorShape(_ctx.at(ifm_index).shape()), true);
depth += ifm_shape.dim(axis);
}
// Check for reshaping input's shape into rank-2
bool needs_reshape = false;
- nnfw::util::matrix::Shape reshape;
+ internal::tflite::operand::Shape reshape(2);
if (input_rank == 4)
{
nnfw::util::feature::Shape ifm_shape_feature = _ctx.at(input_index).shape().asFeature();
ifm_shape_feature.N * ifm_shape_feature.C * ifm_shape_feature.H * ifm_shape_feature.W;
assert(feature_size == batch_size * input_size);
- _builder.addShapeConstr(
- input_index, asTensorInfo(ifm_shape_feature, _ctx.at(input_index).type(),
- _ctx.at(input_index).scale(), _ctx.at(input_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()));
// for reshaping
needs_reshape = true;
- reshape.H = batch_size;
- reshape.W = input_size;
+ reshape.dim(0) = batch_size; /* H */
+ reshape.dim(1) = input_size; /* W */
}
else if (input_rank == 2)
{
assert(ifm_shape.dim(0) == batch_size);
assert(ifm_shape.dim(1) == input_size);
- _builder.addShapeConstr(input_index, asTensorInfo(ifm_shape_matrix, _ctx.at(input_index).type(),
- _ctx.at(input_index).scale(),
- _ctx.at(input_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()));
}
// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints
- _builder.addShapeConstr(
- output_index, asTensorInfo(_ctx.at(output_index).shape(), _ctx.at(output_index).type(),
- _ctx.at(output_index).scale(), _ctx.at(output_index).zeroPoint()));
- _builder.addShapeConstr(
- weight_index, asTensorInfo(_ctx.at(weight_index).shape(), _ctx.at(weight_index).type(),
- _ctx.at(weight_index).scale(), _ctx.at(weight_index).zeroPoint()));
- _builder.addShapeConstr(
- bias_index, asTensorInfo(_ctx.at(bias_index).shape(), _ctx.at(bias_index).type(),
- _ctx.at(bias_index).scale(), _ctx.at(bias_index).zeroPoint()));
+ _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(weight_index,
+ asTensorInfo(asTensorShape(_ctx.at(weight_index).shape()),
+ _ctx.at(weight_index).type(), _ctx.at(weight_index).scale(),
+ _ctx.at(weight_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()));
// Construct operation parameters
struct Param
const ::internal::tflite::operand::Index height_index{node.param().height_index};
const ::internal::tflite::operand::Index width_index{node.param().width_index};
- const auto ofm_shape = _ctx.at(ofm_index).shape().asFeature();
- const auto ifm_shape = _ctx.at(ifm_index).shape().asFeature();
-
// TODO Should move to the place where the operand is handled, if it is possible.
// Set Shape Constraints
- _builder.addShapeConstr(ofm_index, asTensorInfo(ofm_shape, _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index, asTensorInfo(ifm_shape, _ctx.at(ifm_index).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()));
struct Param
{
// assert((ifm_shape.C * ifm_shape.H * ifm_shape.W) == out_size);
// TODO Should move to the place where the operand is handled, if it is possible.
- _builder.addShapeConstr(
- output_index, asTensorInfo(_ctx.at(output_index).shape(), _ctx.at(output_index).type()));
- _builder.addShapeConstr(input_index,
- asTensorInfo(_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()));
+ _builder.addShapeConstr(input_index, asTensorInfo(asTensorShape(_ctx.at(input_index).shape()),
+ _ctx.at(input_index).type()));
struct Param
{
// - 4D input fails (squeeze.mod.py) -> we need general tensor support
// TODO Support generic tensor shape
- const auto output_shape = _ctx.at(output_index).shape();
- const auto input_shape = _ctx.at(input_index).shape();
// Set Shape Constraints
- _builder.addShapeConstr(output_index, asTensorInfo(output_shape, _ctx.at(output_index).type()));
- _builder.addShapeConstr(input_index, asTensorInfo(input_shape, _ctx.at(input_index).type()));
+ _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()));
// Construct operation parameters
struct Param
assert(_ctx.at(scale_index).shape().rank() == 0);
// TODO Should move to the place where the operand is handled, if it is possible.
- _builder.addShapeConstr(
- output_index, asTensorInfo(_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(_ctx.at(input_index).shape(), _ctx.at(input_index).type(),
- _ctx.at(input_index).scale(), _ctx.at(input_index).zeroPoint()));
+ _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
{
const ::internal::tflite::operand::Index shrinkAxisMask_index{node.param().shrinkAxisMask_index};
// Set Shape Constraints
- _builder.addShapeConstr(outputData_index, asTensorInfo(_ctx.at(outputData_index).shape(),
- _ctx.at(outputData_index).type(),
- _ctx.at(outputData_index).scale(),
- _ctx.at(outputData_index).zeroPoint()));
- _builder.addShapeConstr(inputData_index, asTensorInfo(_ctx.at(inputData_index).shape(),
- _ctx.at(inputData_index).type(),
- _ctx.at(inputData_index).scale(),
- _ctx.at(inputData_index).zeroPoint()));
-
- const auto startData_size = _ctx.at(startData_index).shape().asVector();
- const auto endData_size = _ctx.at(endData_index).shape().asVector();
- const auto stridesData_size = _ctx.at(stridesData_index).shape().asVector();
+ _builder.addShapeConstr(outputData_index,
+ asTensorInfo(asTensorShape(_ctx.at(outputData_index).shape()),
+ _ctx.at(outputData_index).type(),
+ _ctx.at(outputData_index).scale(),
+ _ctx.at(outputData_index).zeroPoint()));
+ _builder.addShapeConstr(
+ inputData_index,
+ asTensorInfo(asTensorShape(_ctx.at(inputData_index).shape()), _ctx.at(inputData_index).type(),
+ _ctx.at(inputData_index).scale(), _ctx.at(inputData_index).zeroPoint()));
+
+ 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(startData_size, _ctx.at(startData_index).type()));
- _builder.addShapeConstr(endData_index, asTensorInfo(endData_size, _ctx.at(endData_index).type()));
+ asTensorInfo(asTensorShape(_ctx.at(startData_index).shape()),
+ _ctx.at(startData_index).type()));
+ _builder.addShapeConstr(endData_index, asTensorInfo(asTensorShape(_ctx.at(endData_index).shape()),
+ _ctx.at(endData_index).type()));
_builder.addShapeConstr(stridesData_index,
- asTensorInfo(stridesData_size, _ctx.at(stridesData_index).type()));
+ asTensorInfo(asTensorShape(_ctx.at(endData_index).shape()),
+ _ctx.at(stridesData_index).type()));
// Set initializers for indices data such as order of inputData
{
auto startData_base = _ctx.at(startData_index).data().base();
auto endData_base = _ctx.at(endData_index).data().base();
auto stridesData_base = _ctx.at(stridesData_index).data().base();
+ const auto startData_size = _ctx.at(startData_index).shape().asVector();
+ const auto endData_size = _ctx.at(endData_index).shape().asVector();
+ const auto stridesData_size = _ctx.at(stridesData_index).shape().asVector();
assert(_ctx.at(startData_index).type() == ANEURALNETWORKS_TENSOR_INT32);
auto startData_initializer =
assert(_ctx.at(axis_index).hasData());
assert(axis_shape.rank() == 0 || ((axis_shape.rank() == 1) && (axis_shape.dim(0) == 1)));
- _builder.addShapeConstr(ofm_index, asTensorInfo(ofm_shape.dim(0), _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(
- ifm_index, asTensorInfo(ifm_shape.dim(0), ifm_shape.dim(1), _ctx.at(ifm_index).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()));
// Note: Assume only one element in axis. It is checked by assertion above
// TODO: handle general case
const ::internal::tflite::operand::Index output_index{node.param().output_index};
const ::internal::tflite::operand::Index input_index{node.param().input_index};
- const auto output_shape = _ctx.at(output_index).shape().asTensor();
- const auto input_shape = _ctx.at(input_index).shape().asTensor();
+ assert(_ctx.at(output_index).shape() == _ctx.at(input_index).shape());
- assert(output_shape == input_shape);
-
- _builder.addShapeConstr(output_index, asTensorInfo(input_shape, _ctx.at(output_index).type(),
- _ctx.at(output_index).scale(),
- _ctx.at(output_index).zeroPoint()));
- _builder.addShapeConstr(input_index, asTensorInfo(output_shape, _ctx.at(input_index).type(),
- _ctx.at(input_index).scale(),
- _ctx.at(input_index).zeroPoint()));
+ _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()));
// Construct operation parameters
struct Param
assert(_ctx.at(inputData_index).shape().rank() == 1 ||
_ctx.at(inputData_index).shape().rank() == 2);
- const auto outputValues_shape = _ctx.at(outputValues_index).shape().asTensor();
- const auto outputIndices_shape = _ctx.at(outputIndices_index).shape().asTensor();
- const auto inputData_shape = _ctx.at(inputData_index).shape().asTensor();
const int32_t k = _ctx.at(k_index).asScalar<int32_t>();
// Set shape constraints
_builder.addShapeConstr(outputValues_index,
- asTensorInfo(outputValues_shape, _ctx.at(outputValues_index).type()));
+ asTensorInfo(asTensorShape(_ctx.at(outputValues_index).shape()),
+ _ctx.at(outputValues_index).type()));
_builder.addShapeConstr(outputIndices_index,
- asTensorInfo(outputIndices_shape, _ctx.at(outputIndices_index).type()));
+ asTensorInfo(asTensorShape(_ctx.at(outputIndices_index).shape()),
+ _ctx.at(outputIndices_index).type()));
_builder.addShapeConstr(inputData_index,
- asTensorInfo(inputData_shape, _ctx.at(inputData_index).type()));
+ asTensorInfo(asTensorShape(_ctx.at(inputData_index).shape()),
+ _ctx.at(inputData_index).type()));
// Construct operation parameters
struct Param
// Currently, 1D-input and 2D-input are supported.
assert(_ctx.at(lhs_index).shape().rank() == 1 || _ctx.at(lhs_index).shape().rank() == 2);
-
- // TODO Support generic tensor shape
- const auto ofm_shape = _ctx.at(ofm_index).shape();
- const auto lhs_shape = _ctx.at(lhs_index).shape();
- const auto rhs_shape = _ctx.at(rhs_index).shape().asVector();
+ assert(_ctx.at(rhs_index).shape().rank() == 1);
// Set Shape Constraints
- _builder.addShapeConstr(ofm_index, asTensorInfo(ofm_shape, _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(lhs_index, asTensorInfo(lhs_shape, _ctx.at(lhs_index).type()));
- _builder.addShapeConstr(rhs_index, asTensorInfo(rhs_shape, _ctx.at(rhs_index).type()));
+ _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()),
+ _ctx.at(ofm_index).type()));
+ _builder.addShapeConstr(lhs_index, asTensorInfo(asTensorShape(_ctx.at(lhs_index).shape()),
+ _ctx.at(lhs_index).type()));
+ _builder.addShapeConstr(rhs_index, asTensorInfo(asTensorShape(_ctx.at(rhs_index).shape()),
+ _ctx.at(rhs_index).type()));
// Construct operation parameters
struct Param
const ::internal::tflite::operand::Index ifm_index{node.param().ifm_index};
// Set shape constraints
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(_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(_ctx.at(ifm_index).shape(), _ctx.at(ifm_index).type(),
- _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
+ _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 ifm_index{node.param().ifm_index};
// Set shape constraints
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(_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(_ctx.at(ifm_index).shape(), _ctx.at(ifm_index).type(),
- _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
+ _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 ifm_index{node.param().ifm_index};
// Set shape constraints
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(_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(_ctx.at(ifm_index).shape(), _ctx.at(ifm_index).type(),
- _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
+ _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 ifm_index{node.param().ifm_index};
// Set shape constraints
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index,
- asTensorInfo(_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()));
+ _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()),
+ _ctx.at(ifm_index).type()));
struct Param
{
const ::internal::tflite::operand::Index ifm_index{node.param().ifm_index};
// Set shape constraints
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(_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(_ctx.at(ifm_index).shape(), _ctx.at(ifm_index).type(),
- _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
+ _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 int keep_dims = _ctx.at(keep_dims_index).asScalar<int>();
// Set shape constraints
- _builder.addShapeConstr(
- ofm_index, asTensorInfo(_ctx.at(ofm_index).shape().asTensor(), _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(
- ifm_index, asTensorInfo(_ctx.at(ifm_index).shape().asTensor(), _ctx.at(ifm_index).type()));
- _builder.addShapeConstr(
- axis_index, asTensorInfo(_ctx.at(axis_index).shape().asVector(), _ctx.at(axis_index).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(axis_index, asTensorInfo(asTensorShape(_ctx.at(axis_index).shape()),
+ _ctx.at(axis_index).type()));
// TODO keep_dims==0
assert(keep_dims != 0);
const auto axis_size = _ctx.at(axis_index).shape().asVector();
// NHWC type -> WHCN type
- if (_ctx.at(ofm_index).shape().asTensor().rank() == 4)
+ if (_ctx.at(ofm_index).shape().rank() == 4)
{
for (uint32_t n = 0; n < axis_size; ++n)
{
num_units == _ctx.at(hidden_state_out_index).shape().dim(1));
// Set Shape Constraints and TensorInfo
- _builder.addShapeConstr(
- output_index, asTensorInfo(_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()));
_builder.addShapeConstr(hidden_state_out_index,
- asTensorInfo(_ctx.at(hidden_state_out_index).shape(),
+ asTensorInfo(asTensorShape(_ctx.at(hidden_state_out_index).shape()),
_ctx.at(hidden_state_out_index).type()));
- _builder.addShapeConstr(input_index,
- asTensorInfo(_ctx.at(input_index).shape(), _ctx.at(input_index).type()));
- _builder.addShapeConstr(
- weights_index, asTensorInfo(_ctx.at(weights_index).shape(), _ctx.at(weights_index).type()));
+ _builder.addShapeConstr(input_index, asTensorInfo(asTensorShape(_ctx.at(input_index).shape()),
+ _ctx.at(input_index).type()));
+ _builder.addShapeConstr(weights_index, asTensorInfo(asTensorShape(_ctx.at(weights_index).shape()),
+ _ctx.at(weights_index).type()));
_builder.addShapeConstr(recurrent_weights_index,
- asTensorInfo(_ctx.at(recurrent_weights_index).shape(),
+ asTensorInfo(asTensorShape(_ctx.at(recurrent_weights_index).shape()),
_ctx.at(recurrent_weights_index).type()));
- _builder.addShapeConstr(bias_index,
- asTensorInfo(_ctx.at(bias_index).shape(), _ctx.at(bias_index).type()));
- _builder.addShapeConstr(
- hidden_state_in_index,
- asTensorInfo(_ctx.at(hidden_state_in_index).shape(), _ctx.at(hidden_state_in_index).type()));
+ _builder.addShapeConstr(bias_index, asTensorInfo(asTensorShape(_ctx.at(bias_index).shape()),
+ _ctx.at(bias_index).type()));
+ _builder.addShapeConstr(hidden_state_in_index,
+ asTensorInfo(asTensorShape(_ctx.at(hidden_state_in_index).shape()),
+ _ctx.at(hidden_state_in_index).type()));
// Construct operation parameters
struct Param
const ::internal::tflite::operand::Index ifm_index{node.param().ifm_index};
// Set shape constraints
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(_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(_ctx.at(ifm_index).shape(), _ctx.at(ifm_index).type(),
- _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint()));
+ _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()));
// NNAPI spec provides permutation vector for generic transpose
// TODO Make the permutation vector a part of Param
struct Param
const ::internal::tflite::operand::Index ifm_index{node.param().input_index};
// Set shape constraints
- _builder.addShapeConstr(ofm_index,
- asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type()));
- _builder.addShapeConstr(ifm_index,
- asTensorInfo(_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()));
+ _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()),
+ _ctx.at(ifm_index).type()));
struct Param
{
const int32_t slice_size = input_size / num_split;
// Set Shape Constraints and TensorInfo (for input)
- _builder.addShapeConstr(ifm_index, asTensorInfo(ifm_shape, _ctx.at(ifm_index).type()));
+ _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()),
+ _ctx.at(ifm_index).type()));
// Set Shape Constraints and TensorInfo (for output)
const auto rank = ifm_shape.rank();
for (const auto &index : node.param().ofm_indexes)
{
const ::internal::tflite::operand::Index ofm_index{index};
- const auto ofm_shape = _ctx.at(ofm_index).shape();
coordinates[coord_index] = depth;
- _builder.addSubsumptionConstr(ofm_index, ifm_index, coordinates, asTensorShape(ofm_shape),
- true);
+ _builder.addSubsumptionConstr(ofm_index, ifm_index, coordinates,
+ asTensorShape(_ctx.at(ofm_index).shape()), true);
depth += slice_size;
}