quantization

package
v2.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_tensorflow_compiler_mlir_lite_quantization_quantization_info_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type QuantizationInfo

type QuantizationInfo struct {

	// List of quantization parameters for tensors.
	Entries []*QuantizationInfo_QuantParams `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
	// contains filtered or unexported fields
}

Represents the quantization parameters for a list of named tensors.

func (*QuantizationInfo) Descriptor deprecated

func (*QuantizationInfo) Descriptor() ([]byte, []int)

Deprecated: Use QuantizationInfo.ProtoReflect.Descriptor instead.

func (*QuantizationInfo) GetEntries

func (*QuantizationInfo) ProtoMessage

func (*QuantizationInfo) ProtoMessage()

func (*QuantizationInfo) ProtoReflect

func (x *QuantizationInfo) ProtoReflect() protoreflect.Message

func (*QuantizationInfo) Reset

func (x *QuantizationInfo) Reset()

func (*QuantizationInfo) String

func (x *QuantizationInfo) String() string

type QuantizationInfo_AffineParams

type QuantizationInfo_AffineParams struct {
	Scale     float32 `protobuf:"fixed32,1,opt,name=scale,proto3" json:"scale,omitempty"`
	ZeroPoint int32   `protobuf:"varint,2,opt,name=zero_point,json=zeroPoint,proto3" json:"zero_point,omitempty"`
	// contains filtered or unexported fields
}

Affine parameters to quantize the per axis value. The metadata of the target properties should be specified as well.

func (*QuantizationInfo_AffineParams) Descriptor deprecated

func (*QuantizationInfo_AffineParams) Descriptor() ([]byte, []int)

Deprecated: Use QuantizationInfo_AffineParams.ProtoReflect.Descriptor instead.

func (*QuantizationInfo_AffineParams) GetScale

func (x *QuantizationInfo_AffineParams) GetScale() float32

func (*QuantizationInfo_AffineParams) GetZeroPoint

func (x *QuantizationInfo_AffineParams) GetZeroPoint() int32

func (*QuantizationInfo_AffineParams) ProtoMessage

func (*QuantizationInfo_AffineParams) ProtoMessage()

func (*QuantizationInfo_AffineParams) ProtoReflect

func (*QuantizationInfo_AffineParams) Reset

func (x *QuantizationInfo_AffineParams) Reset()

func (*QuantizationInfo_AffineParams) String

type QuantizationInfo_Metadata

type QuantizationInfo_Metadata struct {

	// Bit number of fixed-point data the target kernel supports.
	NumBits int32 `protobuf:"varint,1,opt,name=num_bits,json=numBits,proto3" json:"num_bits,omitempty"`
	// The quantized axis index if it is per-axis quantization.
	QuantizeAxis int32 `protobuf:"varint,2,opt,name=quantize_axis,json=quantizeAxis,proto3" json:"quantize_axis,omitempty"`
	// The minimum allowed value of the fixed-point data range.
	// This can also be used to derive the sign of storage type.
	RangeMin int32 `protobuf:"varint,3,opt,name=range_min,json=rangeMin,proto3" json:"range_min,omitempty"`
	// The minimum allowed value of the fixed-point data range.
	RangeMax int32 `protobuf:"varint,4,opt,name=range_max,json=rangeMax,proto3" json:"range_max,omitempty"`
	// contains filtered or unexported fields
}

The metadata defines the target properties.

func (*QuantizationInfo_Metadata) Descriptor deprecated

func (*QuantizationInfo_Metadata) Descriptor() ([]byte, []int)

Deprecated: Use QuantizationInfo_Metadata.ProtoReflect.Descriptor instead.

func (*QuantizationInfo_Metadata) GetNumBits

func (x *QuantizationInfo_Metadata) GetNumBits() int32

func (*QuantizationInfo_Metadata) GetQuantizeAxis

func (x *QuantizationInfo_Metadata) GetQuantizeAxis() int32

func (*QuantizationInfo_Metadata) GetRangeMax

func (x *QuantizationInfo_Metadata) GetRangeMax() int32

func (*QuantizationInfo_Metadata) GetRangeMin

func (x *QuantizationInfo_Metadata) GetRangeMin() int32

func (*QuantizationInfo_Metadata) ProtoMessage

func (*QuantizationInfo_Metadata) ProtoMessage()

func (*QuantizationInfo_Metadata) ProtoReflect

func (*QuantizationInfo_Metadata) Reset

func (x *QuantizationInfo_Metadata) Reset()

func (*QuantizationInfo_Metadata) String

func (x *QuantizationInfo_Metadata) String() string

type QuantizationInfo_MinMax

type QuantizationInfo_MinMax struct {
	Min float32 `protobuf:"fixed32,1,opt,name=min,proto3" json:"min,omitempty"`
	Max float32 `protobuf:"fixed32,2,opt,name=max,proto3" json:"max,omitempty"`
	// contains filtered or unexported fields
}

min/max of the per axis value range. To quantize the value, the metadata of the target properties should be specified or read from the ops quantization specification.

func (*QuantizationInfo_MinMax) Descriptor deprecated

func (*QuantizationInfo_MinMax) Descriptor() ([]byte, []int)

Deprecated: Use QuantizationInfo_MinMax.ProtoReflect.Descriptor instead.

func (*QuantizationInfo_MinMax) GetMax

func (x *QuantizationInfo_MinMax) GetMax() float32

func (*QuantizationInfo_MinMax) GetMin

func (x *QuantizationInfo_MinMax) GetMin() float32

func (*QuantizationInfo_MinMax) ProtoMessage

func (*QuantizationInfo_MinMax) ProtoMessage()

func (*QuantizationInfo_MinMax) ProtoReflect

func (x *QuantizationInfo_MinMax) ProtoReflect() protoreflect.Message

func (*QuantizationInfo_MinMax) Reset

func (x *QuantizationInfo_MinMax) Reset()

func (*QuantizationInfo_MinMax) String

func (x *QuantizationInfo_MinMax) String() string

type QuantizationInfo_PerAxisParams

type QuantizationInfo_PerAxisParams struct {

	// Types that are assignable to ParamsOneof:
	//
	//	*QuantizationInfo_PerAxisParams_MinMax
	//	*QuantizationInfo_PerAxisParams_AffineParams
	ParamsOneof isQuantizationInfo_PerAxisParams_ParamsOneof `protobuf_oneof:"params_oneof"`
	// contains filtered or unexported fields
}

Params to quantize the axis. Only one of the field can be used.

func (*QuantizationInfo_PerAxisParams) Descriptor deprecated

func (*QuantizationInfo_PerAxisParams) Descriptor() ([]byte, []int)

Deprecated: Use QuantizationInfo_PerAxisParams.ProtoReflect.Descriptor instead.

func (*QuantizationInfo_PerAxisParams) GetAffineParams

func (*QuantizationInfo_PerAxisParams) GetMinMax

func (*QuantizationInfo_PerAxisParams) GetParamsOneof

func (m *QuantizationInfo_PerAxisParams) GetParamsOneof() isQuantizationInfo_PerAxisParams_ParamsOneof

func (*QuantizationInfo_PerAxisParams) ProtoMessage

func (*QuantizationInfo_PerAxisParams) ProtoMessage()

func (*QuantizationInfo_PerAxisParams) ProtoReflect

func (*QuantizationInfo_PerAxisParams) Reset

func (x *QuantizationInfo_PerAxisParams) Reset()

func (*QuantizationInfo_PerAxisParams) String

type QuantizationInfo_PerAxisParams_AffineParams

type QuantizationInfo_PerAxisParams_AffineParams struct {
	// affine parameters to quantize the per axis value.
	AffineParams *QuantizationInfo_AffineParams `protobuf:"bytes,2,opt,name=affine_params,json=affineParams,proto3,oneof"`
}

type QuantizationInfo_PerAxisParams_MinMax

type QuantizationInfo_PerAxisParams_MinMax struct {
	// min/max of the ranges.
	MinMax *QuantizationInfo_MinMax `protobuf:"bytes,1,opt,name=min_max,json=minMax,proto3,oneof"`
}

type QuantizationInfo_QuantParams

type QuantizationInfo_QuantParams struct {

	// The tensor name has the following convention:
	//
	//	tensor_name := op_name | op_name  ’:’  port_number.
	//
	// If the op has only one port, op_name can be used.
	// If the op has internal states, such as fused LSTM, the port_number should
	// follow a predefined convention.
	//
	// Types that are assignable to NameOneof:
	//
	//	*QuantizationInfo_QuantParams_Name
	//	*QuantizationInfo_QuantParams_NameRegex
	NameOneof isQuantizationInfo_QuantParams_NameOneof `protobuf_oneof:"name_oneof"`
	// The quantization parameters for the tensor. If it is for per-axis, the
	// parameters should be defined for each axis, otherwise, if it is for
	// per-tensor, this repeated field should only contain a single element.
	Params []*QuantizationInfo_PerAxisParams `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty"`
	// Metadata about the quantization parameters.
	Meta *QuantizationInfo_Metadata `protobuf:"bytes,5,opt,name=meta,proto3" json:"meta,omitempty"`
	// contains filtered or unexported fields
}

The quantization parameters for a named tensor.

func (*QuantizationInfo_QuantParams) Descriptor deprecated

func (*QuantizationInfo_QuantParams) Descriptor() ([]byte, []int)

Deprecated: Use QuantizationInfo_QuantParams.ProtoReflect.Descriptor instead.

func (*QuantizationInfo_QuantParams) GetMeta

func (*QuantizationInfo_QuantParams) GetName

func (x *QuantizationInfo_QuantParams) GetName() string

func (*QuantizationInfo_QuantParams) GetNameOneof

func (m *QuantizationInfo_QuantParams) GetNameOneof() isQuantizationInfo_QuantParams_NameOneof

func (*QuantizationInfo_QuantParams) GetNameRegex

func (x *QuantizationInfo_QuantParams) GetNameRegex() string

func (*QuantizationInfo_QuantParams) GetParams

func (*QuantizationInfo_QuantParams) ProtoMessage

func (*QuantizationInfo_QuantParams) ProtoMessage()

func (*QuantizationInfo_QuantParams) ProtoReflect

func (*QuantizationInfo_QuantParams) Reset

func (x *QuantizationInfo_QuantParams) Reset()

func (*QuantizationInfo_QuantParams) String

type QuantizationInfo_QuantParams_Name

type QuantizationInfo_QuantParams_Name struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3,oneof"`
}

type QuantizationInfo_QuantParams_NameRegex

type QuantizationInfo_QuantParams_NameRegex struct {
	// An regex can be used to match multiple tensors.
	NameRegex string `protobuf:"bytes,2,opt,name=name_regex,json=nameRegex,proto3,oneof"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL