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:
parent
6f34b66ae4
commit
7fc264a9e6
|
|
@ -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);
|
||||||
...
|
...
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 };
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue