Previously shape inference stage for TFReshape node was erroneously
done for wildcard dimension as well. This commit fixes this bug to
reject dynamic reshape case.
Signed-off-by: Cheongyo Bahk <ch.bahk@samsung.com>
shape_data.rank(shape_rank);
for (uint32_t axis = 0; axis < shape_rank; ++axis)
{
- shape_data.dim(axis) = const_shape_input->at<loco::DataType::S32>(axis);
+ auto shape_dim = const_shape_input->at<loco::DataType::S32>(axis);
+ if (shape_dim == -1)
+ {
+ // Reshape's new shape has wildcard dimension, i.e. dynamic reshape
+ return false;
+ }
+ assert(shape_dim >= 1);
+ shape_data.dim(axis) = shape_dim;
}
// TODO Compare 'tensor' input and validate coherency?