diff options
author | Jeremy Johnson <jeremy.johnson@arm.com> | 2022-05-30 16:51:21 +0100 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2022-05-31 17:39:12 +0000 |
commit | c23fc3b03ce7173ba5616234ed7b84fad61941e8 (patch) | |
tree | d096f62a2656c55849a191df1f3e62ea37ec01aa /reference_model | |
parent | f7f78ae236e623a57919f9450e8b2043e681ddb3 (diff) | |
download | reference_model-c23fc3b03ce7173ba5616234ed7b84fad61941e8.tar.gz |
Remove RESHAPE -1 dimensions support
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Change-Id: I098daf49c92da12c07143cdd23ac9bb58acebbb9
Diffstat (limited to 'reference_model')
-rw-r--r-- | reference_model/src/ops/data_layout.cc | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/reference_model/src/ops/data_layout.cc b/reference_model/src/ops/data_layout.cc index 387152f..24c86ed 100644 --- a/reference_model/src/ops/data_layout.cc +++ b/reference_model/src/ops/data_layout.cc @@ -236,8 +236,6 @@ OpReshape<InRank, OutRank, Dtype>::~OpReshape() template <int InRank, int OutRank, DType Dtype> int OpReshape<InRank, OutRank, Dtype>::checkTensorAttributes() { - uint32_t minusOneCount = 0; - if (validateRequiredOperands()) return 1; @@ -258,21 +256,8 @@ int OpReshape<InRank, OutRank, Dtype>::checkTensorAttributes() for (uint32_t d = 0; d < OutRank; d++) { - if (attribute->shape()[d] == -1) - { - minusOneCount++; - } - else - { - ERROR_IF(attribute->shape()[d] != outputs[0]->getShape()[d], - "OpReshape: new_shape doesn't match output shape"); - } - } - - if (minusOneCount > 1) - { - printNodeValidationError("OpReshape: new shape has more than one -1 dimension"); - return 1; + ERROR_IF(attribute->shape()[d] != outputs[0]->getShape()[d], + "OpReshape: new_shape doesn't match output shape"); } in = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[0]); @@ -284,27 +269,10 @@ int OpReshape<InRank, OutRank, Dtype>::checkTensorAttributes() template <int InRank, int OutRank, DType Dtype> int OpReshape<InRank, OutRank, Dtype>::eval() { - uint32_t remainingSize = in->getElementCount(); - - // If there is a -1 dimension, find the remainder in one pass over the output shape - for (int32_t d = 0; d < OutRank; d++) - { - if (attribute->shape()[d] != -1) - { - remainingSize = remainingSize / attribute->shape()[d]; - } - } - for (int32_t d = 0; d < OutRank; d++) { array_shape[d] = attribute->shape()[OutRank - 1 - d]; out_reverser[d] = OutRank - 1 - d; - - // Jam in the remainder here - if (array_shape[d] == -1) - { - array_shape[d] = remainingSize; - } } for (int32_t d = 0; d < InRank; d++) |