Refine Tensor::SetShape api to avoid compile warning using const ref (#640)

* Move int4/uint4 to the end of DataType

* Refine api Tensor::SetShape, using const ref avoid compile warning
This commit is contained in:
xie-oritek 2023-08-25 00:47:24 +08:00 committed by GitHub
parent 6f34b66ae4
commit 7fc264a9e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -35,7 +35,7 @@ struct TensorSpec {
TensorSpec& SetDataType(DataType datatype); TensorSpec& SetDataType(DataType datatype);
TensorSpec& SetShape(ShapeType& shape); TensorSpec& SetShape(const ShapeType& shape);
TensorSpec& SetAttribute(TensorAttribute attr); TensorSpec& SetAttribute(TensorAttribute attr);
... ...

View File

@ -106,7 +106,7 @@ struct TensorSpec {
TensorSpec& SetDataType(DataType datatype); TensorSpec& SetDataType(DataType datatype);
TensorSpec& SetShape(ShapeType& shape); TensorSpec& SetShape(const ShapeType& shape);
TensorSpec& SetAttribute(TensorAttribute attr); TensorSpec& SetAttribute(TensorAttribute attr);

View File

@ -29,8 +29,6 @@ namespace vx {
enum class DataType { enum class DataType {
UNKNOWN, UNKNOWN,
INT4,
UINT4,
INT8, INT8,
UINT8, UINT8,
INT16, INT16,
@ -40,7 +38,9 @@ enum class DataType {
INT64, INT64,
FLOAT16, FLOAT16,
FLOAT32, FLOAT32,
BOOL8 BOOL8,
INT4,
UINT4
}; };
enum class QuantType { NONE, ASYMMETRIC, SYMMETRIC_PER_CHANNEL, DYNAMIC_FIXED_POINT }; enum class QuantType { NONE, ASYMMETRIC, SYMMETRIC_PER_CHANNEL, DYNAMIC_FIXED_POINT };

View File

@ -401,7 +401,7 @@ TensorSpec& TensorSpec::SetDataType(DataType datatype) {
return *this; return *this;
} }
TensorSpec& TensorSpec::SetShape(ShapeType& shape) { TensorSpec& TensorSpec::SetShape(const ShapeType& shape) {
this->shape_ = shape; this->shape_ = shape;
return *this; return *this;
} }