pub struct WeightParams {
pub float_value: Vec<f32>,
pub float16_value: Vec<u8>,
pub raw_value: Vec<u8>,
pub int8_raw_value: Vec<u8>,
pub quantization: Option<QuantizationParams>,
pub is_updatable: bool,
}Expand description
Weights for layer parameters. Weights are stored as repeated floating point numbers using row-major ordering and can represent 1-, 2-, 3-, or 4-dimensional data.
Fields§
§float_value: Vec<f32>Values specified in single / float / FP32 precision.
float16_value: Vec<u8>Values in 16-bit half precision floating point.
raw_value: Vec<u8>Raw value specification for quantized lower precisions.
This field is interpreted as uintN, where N is the number of bits in quantization. E.g. if n=8, the field is interpreted as an array of UINT8. Use this field for quantized parameters unless specifically noted to use int8RawValue.
int8_raw_value: Vec<u8>Field to be used if int8DynamicQuantize is set in the parent layer. Cannot be set if rawValue is also set. The values in this field are interpreted as INT8.
If this field is set, following conditions must hold true:
- QuantizationType == LinearQuantizationParams, such that
- size of the “scale” field is 1 and “bias” field is empty in “LinearQuantizationParams”
quantization: Option<QuantizationParams>Quantization related parameters.
is_updatable: boolTrait Implementations§
Source§impl Clone for WeightParams
impl Clone for WeightParams
Source§fn clone(&self) -> WeightParams
fn clone(&self) -> WeightParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WeightParams
impl Debug for WeightParams
Source§impl Default for WeightParams
impl Default for WeightParams
Source§impl Message for WeightParams
impl Message for WeightParams
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for WeightParams
impl PartialEq for WeightParams
Source§fn eq(&self, other: &WeightParams) -> bool
fn eq(&self, other: &WeightParams) -> bool
self and other values to be equal, and is used by ==.