Add support for one dimension of size -1 in ReshapeOp
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Change-Id: I0ef7607f4266296a1204c5cccdb5be36f345b5ba
diff --git a/reference_model/src/tensor.h b/reference_model/src/tensor.h
index b68a9b6..21cf148 100644
--- a/reference_model/src/tensor.h
+++ b/reference_model/src/tensor.h
@@ -96,6 +96,12 @@
return shape;
}
+ void setDimSize(size_t dim, uint32_t new_size)
+ {
+ this->shape[dim] = new_size;
+ return;
+ }
+
std::string getShapeAsString() const
{
std::string shape_str("[");
@@ -269,7 +275,7 @@
protected:
const std::string tensorName;
const DType serializationDtype;
- const std::vector<int> shape;
+ std::vector<int> shape;
const TOSA_REF_TYPE tensorDtype;
int isValid;
int isSubgraphInput;