refine tensor to support attribute access
This commit is contained in:
parent
404817db1f
commit
8e63e8c8f3
|
|
@ -48,25 +48,29 @@ class Quantization {
|
||||||
scales_(std::move(scales)),
|
scales_(std::move(scales)),
|
||||||
zero_points_(std::move(zero_points)) {}
|
zero_points_(std::move(zero_points)) {}
|
||||||
|
|
||||||
QuantType Type() { return type_; }
|
QuantType& Type() { return type_; }
|
||||||
|
const QuantType& Type() const { return type_; }
|
||||||
Quantization& SetType(QuantType type) {
|
Quantization& SetType(QuantType type) {
|
||||||
this->type_ = type;
|
this->type_ = type;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ChannelDim() { return this->channel_dim_; }
|
int32_t& ChannelDim() { return this->channel_dim_; }
|
||||||
|
const int32_t& ChannelDim() const { return this->channel_dim_; }
|
||||||
Quantization& SetChannelDim(int32_t channel_dim) {
|
Quantization& SetChannelDim(int32_t channel_dim) {
|
||||||
this->channel_dim_ = channel_dim;
|
this->channel_dim_ = channel_dim;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<float>& Scales() { return this->scales_; }
|
std::vector<float>& Scales() { return this->scales_; }
|
||||||
|
const std::vector<float>& Scales() const { return this->scales_; }
|
||||||
Quantization& SetScales(std::vector<float> scales) {
|
Quantization& SetScales(std::vector<float> scales) {
|
||||||
this->scales_ = scales;
|
this->scales_ = scales;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<int32_t>& ZeroPoints() { return this->zero_points_; }
|
std::vector<int32_t>& ZeroPoints() { return this->zero_points_; }
|
||||||
|
const std::vector<int32_t>& ZeroPoints() const { return this->zero_points_; }
|
||||||
Quantization& SetZeroPoints(std::vector<int32_t> zero_points) {
|
Quantization& SetZeroPoints(std::vector<int32_t> zero_points) {
|
||||||
this->zero_points_ = zero_points;
|
this->zero_points_ = zero_points;
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue