Documentation ¶
Index ¶
- Constants
- Variables
- type ArraysExtraInfo
- func (*ArraysExtraInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ArraysExtraInfo) GetEntries() []*ArraysExtraInfo_Entry
- func (*ArraysExtraInfo) ProtoMessage()
- func (x *ArraysExtraInfo) ProtoReflect() protoreflect.Message
- func (x *ArraysExtraInfo) Reset()
- func (x *ArraysExtraInfo) String() string
- type ArraysExtraInfo_Entry
- func (*ArraysExtraInfo_Entry) Descriptor() ([]byte, []int)deprecated
- func (x *ArraysExtraInfo_Entry) GetConstantFloatValue() float32
- func (x *ArraysExtraInfo_Entry) GetDataType() IODataType
- func (x *ArraysExtraInfo_Entry) GetMax() float64
- func (x *ArraysExtraInfo_Entry) GetMin() float64
- func (x *ArraysExtraInfo_Entry) GetName() string
- func (x *ArraysExtraInfo_Entry) GetNameRegexp() string
- func (x *ArraysExtraInfo_Entry) GetShape() *InputArrayShape
- func (*ArraysExtraInfo_Entry) ProtoMessage()
- func (x *ArraysExtraInfo_Entry) ProtoReflect() protoreflect.Message
- func (x *ArraysExtraInfo_Entry) Reset()
- func (x *ArraysExtraInfo_Entry) String() string
- type FileFormat
- func (FileFormat) Descriptor() protoreflect.EnumDescriptor
- func (x FileFormat) Enum() *FileFormat
- func (FileFormat) EnumDescriptor() ([]byte, []int)deprecated
- func (x FileFormat) Number() protoreflect.EnumNumber
- func (x FileFormat) String() string
- func (FileFormat) Type() protoreflect.EnumType
- func (x *FileFormat) UnmarshalJSON(b []byte) errordeprecated
- type IODataType
- func (IODataType) Descriptor() protoreflect.EnumDescriptor
- func (x IODataType) Enum() *IODataType
- func (IODataType) EnumDescriptor() ([]byte, []int)deprecated
- func (x IODataType) Number() protoreflect.EnumNumber
- func (x IODataType) String() string
- func (IODataType) Type() protoreflect.EnumType
- func (x *IODataType) UnmarshalJSON(b []byte) errordeprecated
- type InputArray
- func (*InputArray) Descriptor() ([]byte, []int)deprecated
- func (x *InputArray) GetDataType() IODataType
- func (x *InputArray) GetMeanValue() float32
- func (x *InputArray) GetName() string
- func (x *InputArray) GetShape() *InputArrayShape
- func (x *InputArray) GetStdValue() float32
- func (*InputArray) ProtoMessage()
- func (x *InputArray) ProtoReflect() protoreflect.Message
- func (x *InputArray) Reset()
- func (x *InputArray) String() string
- type InputArrayShape
- func (*InputArrayShape) Descriptor() ([]byte, []int)deprecated
- func (x *InputArrayShape) GetDims() []int32
- func (x *InputArrayShape) GetUnknownRank() bool
- func (*InputArrayShape) ProtoMessage()
- func (x *InputArrayShape) ProtoReflect() protoreflect.Message
- func (x *InputArrayShape) Reset()
- func (x *InputArrayShape) String() string
- type ModelFlags
- func (*ModelFlags) Descriptor() ([]byte, []int)deprecated
- func (x *ModelFlags) GetAllowNonasciiArrays() bool
- func (x *ModelFlags) GetAllowNonexistentArrays() bool
- func (x *ModelFlags) GetArraysExtraInfo() *ArraysExtraInfo
- func (x *ModelFlags) GetChangeConcatInputRanges() bool
- func (x *ModelFlags) GetControlOutputArrays() []string
- func (x *ModelFlags) GetHloFileType() ModelFlags_HloFileType
- func (x *ModelFlags) GetInputArrays() []*InputArray
- func (x *ModelFlags) GetModelChecks() []*ModelFlags_ModelCheck
- func (x *ModelFlags) GetOutputArrays() []string
- func (x *ModelFlags) GetRnnStates() []*RnnState
- func (x *ModelFlags) GetSavedModelDir() string
- func (x *ModelFlags) GetSavedModelExportedNames() []string
- func (x *ModelFlags) GetSavedModelTags() []string
- func (x *ModelFlags) GetSavedModelVersion() int32
- func (x *ModelFlags) GetUseHloImport() bool
- func (x *ModelFlags) GetVariableBatch() bool
- func (*ModelFlags) ProtoMessage()
- func (x *ModelFlags) ProtoReflect() protoreflect.Message
- func (x *ModelFlags) Reset()
- func (x *ModelFlags) String() string
- type ModelFlags_HloFileType
- func (ModelFlags_HloFileType) Descriptor() protoreflect.EnumDescriptor
- func (x ModelFlags_HloFileType) Enum() *ModelFlags_HloFileType
- func (ModelFlags_HloFileType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ModelFlags_HloFileType) Number() protoreflect.EnumNumber
- func (x ModelFlags_HloFileType) String() string
- func (ModelFlags_HloFileType) Type() protoreflect.EnumType
- func (x *ModelFlags_HloFileType) UnmarshalJSON(b []byte) errordeprecated
- type ModelFlags_ModelCheck
- func (*ModelFlags_ModelCheck) Descriptor() ([]byte, []int)deprecated
- func (x *ModelFlags_ModelCheck) GetCountMax() int32
- func (x *ModelFlags_ModelCheck) GetCountMin() int32
- func (x *ModelFlags_ModelCheck) GetCountType() string
- func (*ModelFlags_ModelCheck) ProtoMessage()
- func (x *ModelFlags_ModelCheck) ProtoReflect() protoreflect.Message
- func (x *ModelFlags_ModelCheck) Reset()
- func (x *ModelFlags_ModelCheck) String() string
- type RnnState
- func (*RnnState) Descriptor() ([]byte, []int)deprecated
- func (x *RnnState) GetBackEdgeSourceArray() string
- func (x *RnnState) GetDiscardable() bool
- func (x *RnnState) GetNumDims() int32
- func (x *RnnState) GetSize() int32
- func (x *RnnState) GetStateArray() string
- func (*RnnState) ProtoMessage()
- func (x *RnnState) ProtoReflect() protoreflect.Message
- func (x *RnnState) Reset()
- func (x *RnnState) String() string
- type TocoFlags
- func (*TocoFlags) Descriptor() ([]byte, []int)deprecated
- func (x *TocoFlags) GetAccumulationType() IODataType
- func (x *TocoFlags) GetAllowAllSelectTfOps() bool
- func (x *TocoFlags) GetAllowBfloat16() bool
- func (x *TocoFlags) GetAllowCustomOps() bool
- func (x *TocoFlags) GetAllowDynamicTensors() bool
- func (x *TocoFlags) GetAllowNudgingWeightsToUseFastGemmKernel() bool
- func (x *TocoFlags) GetConversionSummaryDir() string
- func (x *TocoFlags) GetCustomOpdefs() []stringdeprecated
- func (x *TocoFlags) GetDebugDisableRecurrentCellFusion() bool
- func (x *TocoFlags) GetDedupeArrayMinSizeBytes() int64
- func (x *TocoFlags) GetDefaultInt16RangesMax() float32
- func (x *TocoFlags) GetDefaultInt16RangesMin() float32
- func (x *TocoFlags) GetDefaultRangesMax() float32
- func (x *TocoFlags) GetDefaultRangesMin() float32
- func (x *TocoFlags) GetDefaultToSingleBatchInTensorListOps() bool
- func (x *TocoFlags) GetDisableInferTensorRange() bool
- func (x *TocoFlags) GetDisablePerChannelQuantization() bool
- func (x *TocoFlags) GetDropControlDependency() bool
- func (x *TocoFlags) GetDropFakeQuant() bool
- func (x *TocoFlags) GetDumpGraphvizDir() string
- func (x *TocoFlags) GetDumpGraphvizIncludeVideo() bool
- func (x *TocoFlags) GetEnableDynamicUpdateSlice() bool
- func (x *TocoFlags) GetEnableMlirDynamicRangeQuantizer() bool
- func (x *TocoFlags) GetEnableSelectTfOps() bool
- func (x *TocoFlags) GetEnableTfliteResourceVariables() bool
- func (x *TocoFlags) GetForceSelectTfOps() bool
- func (x *TocoFlags) GetGuaranteeAllFuncsOneUse() bool
- func (x *TocoFlags) GetInferenceInputType() IODataType
- func (x *TocoFlags) GetInferenceType() IODataType
- func (x *TocoFlags) GetInputFormat() FileFormat
- func (x *TocoFlags) GetLowerTensorListOps() bool
- func (x *TocoFlags) GetOutputFormat() FileFormat
- func (x *TocoFlags) GetPostTrainingQuantize() bool
- func (x *TocoFlags) GetPreserveAssertOp() bool
- func (x *TocoFlags) GetPropagateFakeQuantNumBits() bool
- func (x *TocoFlags) GetQuantizeToFloat16() bool
- func (x *TocoFlags) GetQuantizeWeights() bool
- func (x *TocoFlags) GetReorderAcrossFakeQuant() bool
- func (x *TocoFlags) GetSelectUserTfOps() []string
- func (x *TocoFlags) GetSplitTfliteLstmInputs() bool
- func (x *TocoFlags) GetSupportedBackends() []string
- func (x *TocoFlags) GetTfQuantizationMode() string
- func (x *TocoFlags) GetUnfoldBatchmatmul() bool
- func (x *TocoFlags) GetUnfoldLargeSplatConstant() bool
- func (x *TocoFlags) GetUseFakeQuantNumBits() bool
- func (*TocoFlags) ProtoMessage()
- func (x *TocoFlags) ProtoReflect() protoreflect.Message
- func (x *TocoFlags) Reset()
- func (x *TocoFlags) String() string
Constants ¶
const ( Default_ModelFlags_ModelCheck_CountType = string("None") Default_ModelFlags_ModelCheck_CountMin = int32(-1) Default_ModelFlags_ModelCheck_CountMax = int32(-1) )
Default values for ModelFlags_ModelCheck fields.
const ( Default_TocoFlags_DedupeArrayMinSizeBytes = int64(64) Default_TocoFlags_SplitTfliteLstmInputs = bool(true) Default_TocoFlags_QuantizeWeights = bool(false) Default_TocoFlags_PostTrainingQuantize = bool(false) Default_TocoFlags_EnableSelectTfOps = bool(false) Default_TocoFlags_ForceSelectTfOps = bool(false) Default_TocoFlags_QuantizeToFloat16 = bool(false) Default_TocoFlags_AllowDynamicTensors = bool(true) Default_TocoFlags_EnableTfliteResourceVariables = bool(true) Default_TocoFlags_UnfoldBatchmatmul = bool(true) Default_TocoFlags_LowerTensorListOps = bool(true) Default_TocoFlags_AllowBfloat16 = bool(false) Default_TocoFlags_UnfoldLargeSplatConstant = bool(false) Default_TocoFlags_DefaultToSingleBatchInTensorListOps = bool(false) Default_TocoFlags_DisablePerChannelQuantization = bool(false) Default_TocoFlags_EnableMlirDynamicRangeQuantizer = bool(false) Default_TocoFlags_DisableInferTensorRange = bool(false) Default_TocoFlags_UseFakeQuantNumBits = bool(false) Default_TocoFlags_EnableDynamicUpdateSlice = bool(false) Default_TocoFlags_PreserveAssertOp = bool(false) Default_TocoFlags_GuaranteeAllFuncsOneUse = bool(false) )
Default values for TocoFlags fields.
const (
Default_InputArray_StdValue = float32(1)
)
Default values for InputArray fields.
const (
Default_ModelFlags_ChangeConcatInputRanges = bool(true)
)
Default values for ModelFlags fields.
Variables ¶
var ( ModelFlags_HloFileType_name = map[int32]string{ 0: "UNKNOWN", 1: "HLO_TEXT", 2: "HLO_PROTO", } ModelFlags_HloFileType_value = map[string]int32{ "UNKNOWN": 0, "HLO_TEXT": 1, "HLO_PROTO": 2, } )
Enum value maps for ModelFlags_HloFileType.
var ( FileFormat_name = map[int32]string{ 0: "FILE_FORMAT_UNKNOWN", 1: "TENSORFLOW_GRAPHDEF", 2: "TFLITE", 3: "GRAPHVIZ_DOT", } FileFormat_value = map[string]int32{ "FILE_FORMAT_UNKNOWN": 0, "TENSORFLOW_GRAPHDEF": 1, "TFLITE": 2, "GRAPHVIZ_DOT": 3, } )
Enum value maps for FileFormat.
var ( IODataType_name = map[int32]string{ 0: "IO_DATA_TYPE_UNKNOWN", 1: "FLOAT", 2: "QUANTIZED_UINT8", 3: "INT32", 4: "INT64", 5: "STRING", 6: "QUANTIZED_INT16", 7: "BOOL", 8: "COMPLEX64", 9: "QUANTIZED_INT8", 10: "FLOAT16", 11: "FLOAT64", 12: "COMPLEX128", 13: "UINT64", 14: "RESOURCE", 15: "VARIANT", 16: "UINT32", 17: "UINT8", 18: "INT8", 19: "INT16", 20: "UINT16", } IODataType_value = map[string]int32{ "IO_DATA_TYPE_UNKNOWN": 0, "FLOAT": 1, "QUANTIZED_UINT8": 2, "INT32": 3, "INT64": 4, "STRING": 5, "QUANTIZED_INT16": 6, "BOOL": 7, "COMPLEX64": 8, "QUANTIZED_INT8": 9, "FLOAT16": 10, "FLOAT64": 11, "COMPLEX128": 12, "UINT64": 13, "RESOURCE": 14, "VARIANT": 15, "UINT32": 16, "UINT8": 17, "INT8": 18, "INT16": 19, "UINT16": 20, } )
Enum value maps for IODataType.
var File_tensorflow_lite_toco_model_flags_proto protoreflect.FileDescriptor
var File_tensorflow_lite_toco_toco_flags_proto protoreflect.FileDescriptor
var File_tensorflow_lite_toco_types_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type ArraysExtraInfo ¶
type ArraysExtraInfo struct { Entries []*ArraysExtraInfo_Entry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"` // contains filtered or unexported fields }
An ArraysExtraInfo message stores a collection of additional Information about arrays in a model, complementing the information in the model itself. It is intentionally a separate message so that it may be serialized and passed separately from the model. See --arrays_extra_info_file.
A typical use case is to manually specify MinMax for specific arrays in a model that does not already contain such MinMax information.
func (*ArraysExtraInfo) Descriptor
deprecated
func (*ArraysExtraInfo) Descriptor() ([]byte, []int)
Deprecated: Use ArraysExtraInfo.ProtoReflect.Descriptor instead.
func (*ArraysExtraInfo) GetEntries ¶
func (x *ArraysExtraInfo) GetEntries() []*ArraysExtraInfo_Entry
func (*ArraysExtraInfo) ProtoMessage ¶
func (*ArraysExtraInfo) ProtoMessage()
func (*ArraysExtraInfo) ProtoReflect ¶
func (x *ArraysExtraInfo) ProtoReflect() protoreflect.Message
func (*ArraysExtraInfo) Reset ¶
func (x *ArraysExtraInfo) Reset()
func (*ArraysExtraInfo) String ¶
func (x *ArraysExtraInfo) String() string
type ArraysExtraInfo_Entry ¶
type ArraysExtraInfo_Entry struct { // Next ID to use: 8. Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` NameRegexp *string `protobuf:"bytes,7,opt,name=name_regexp,json=nameRegexp" json:"name_regexp,omitempty"` Min *float64 `protobuf:"fixed64,2,opt,name=min" json:"min,omitempty"` Max *float64 `protobuf:"fixed64,3,opt,name=max" json:"max,omitempty"` DataType *IODataType `protobuf:"varint,4,opt,name=data_type,json=dataType,enum=toco.IODataType" json:"data_type,omitempty"` Shape *InputArrayShape `protobuf:"bytes,5,opt,name=shape" json:"shape,omitempty"` ConstantFloatValue *float32 `protobuf:"fixed32,6,opt,name=constant_float_value,json=constantFloatValue" json:"constant_float_value,omitempty"` // contains filtered or unexported fields }
func (*ArraysExtraInfo_Entry) Descriptor
deprecated
func (*ArraysExtraInfo_Entry) Descriptor() ([]byte, []int)
Deprecated: Use ArraysExtraInfo_Entry.ProtoReflect.Descriptor instead.
func (*ArraysExtraInfo_Entry) GetConstantFloatValue ¶
func (x *ArraysExtraInfo_Entry) GetConstantFloatValue() float32
func (*ArraysExtraInfo_Entry) GetDataType ¶
func (x *ArraysExtraInfo_Entry) GetDataType() IODataType
func (*ArraysExtraInfo_Entry) GetMax ¶
func (x *ArraysExtraInfo_Entry) GetMax() float64
func (*ArraysExtraInfo_Entry) GetMin ¶
func (x *ArraysExtraInfo_Entry) GetMin() float64
func (*ArraysExtraInfo_Entry) GetName ¶
func (x *ArraysExtraInfo_Entry) GetName() string
func (*ArraysExtraInfo_Entry) GetNameRegexp ¶
func (x *ArraysExtraInfo_Entry) GetNameRegexp() string
func (*ArraysExtraInfo_Entry) GetShape ¶
func (x *ArraysExtraInfo_Entry) GetShape() *InputArrayShape
func (*ArraysExtraInfo_Entry) ProtoMessage ¶
func (*ArraysExtraInfo_Entry) ProtoMessage()
func (*ArraysExtraInfo_Entry) ProtoReflect ¶
func (x *ArraysExtraInfo_Entry) ProtoReflect() protoreflect.Message
func (*ArraysExtraInfo_Entry) Reset ¶
func (x *ArraysExtraInfo_Entry) Reset()
func (*ArraysExtraInfo_Entry) String ¶
func (x *ArraysExtraInfo_Entry) String() string
type FileFormat ¶
type FileFormat int32
Supported I/O file formats. Some formats may be input-only or output-only.
const ( FileFormat_FILE_FORMAT_UNKNOWN FileFormat = 0 // GraphDef, third_party/tensorflow/core/framework/graph.proto FileFormat_TENSORFLOW_GRAPHDEF FileFormat = 1 // Tensorflow's mobile inference model. // third_party/tensorflow/lite/schema/schema.fbs FileFormat_TFLITE FileFormat = 2 // GraphViz // Export-only. FileFormat_GRAPHVIZ_DOT FileFormat = 3 )
func (FileFormat) Descriptor ¶
func (FileFormat) Descriptor() protoreflect.EnumDescriptor
func (FileFormat) Enum ¶
func (x FileFormat) Enum() *FileFormat
func (FileFormat) EnumDescriptor
deprecated
func (FileFormat) EnumDescriptor() ([]byte, []int)
Deprecated: Use FileFormat.Descriptor instead.
func (FileFormat) Number ¶
func (x FileFormat) Number() protoreflect.EnumNumber
func (FileFormat) String ¶
func (x FileFormat) String() string
func (FileFormat) Type ¶
func (FileFormat) Type() protoreflect.EnumType
func (*FileFormat) UnmarshalJSON
deprecated
func (x *FileFormat) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type IODataType ¶
type IODataType int32
IODataType describes the numeric data types of input and output arrays of a model.
const ( IODataType_IO_DATA_TYPE_UNKNOWN IODataType = 0 // Float32, not quantized IODataType_FLOAT IODataType = 1 // Uint8, quantized IODataType_QUANTIZED_UINT8 IODataType = 2 // Int32, not quantized IODataType_INT32 IODataType = 3 // Int64, not quantized IODataType_INT64 IODataType = 4 // String, not quantized IODataType_STRING IODataType = 5 // Int16, quantized IODataType_QUANTIZED_INT16 IODataType = 6 // Boolean IODataType_BOOL IODataType = 7 // Complex64, not quantized IODataType_COMPLEX64 IODataType = 8 // Int8, quantized based on QuantizationParameters in schema. IODataType_QUANTIZED_INT8 IODataType = 9 // Half precision float, not quantized. IODataType_FLOAT16 IODataType = 10 // Double precision float, not quantized. IODataType_FLOAT64 IODataType = 11 // Complex128, not quantized IODataType_COMPLEX128 IODataType = 12 // Uint64, not quantized IODataType_UINT64 IODataType = 13 // Resource type IODataType_RESOURCE IODataType = 14 // Variant type IODataType_VARIANT IODataType = 15 // Uint32 IODataType_UINT32 IODataType = 16 // Uint8, not quantized IODataType_UINT8 IODataType = 17 // Int8, not quantized IODataType_INT8 IODataType = 18 // Int16, not quantized IODataType_INT16 IODataType = 19 // Uint16, not quantized IODataType_UINT16 IODataType = 20 )
func (IODataType) Descriptor ¶
func (IODataType) Descriptor() protoreflect.EnumDescriptor
func (IODataType) Enum ¶
func (x IODataType) Enum() *IODataType
func (IODataType) EnumDescriptor
deprecated
func (IODataType) EnumDescriptor() ([]byte, []int)
Deprecated: Use IODataType.Descriptor instead.
func (IODataType) Number ¶
func (x IODataType) Number() protoreflect.EnumNumber
func (IODataType) String ¶
func (x IODataType) String() string
func (IODataType) Type ¶
func (IODataType) Type() protoreflect.EnumType
func (*IODataType) UnmarshalJSON
deprecated
func (x *IODataType) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type InputArray ¶
type InputArray struct { // Name of the input arrays, i.e. the arrays from which input activations // will be read. Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Shape of the input. For many applications the dimensions are {batch, // height, width, depth}. Often the batch is left "unspecified" by providing // a value of -1. // // The last dimension is typically called 'depth' or 'channels'. For example, // for an image model taking RGB images as input, this would have the value 3. Shape *InputArrayShape `protobuf:"bytes,6,opt,name=shape" json:"shape,omitempty"` // mean_value and std_value parameters control the interpretation of raw input // activation values (elements of the input array) as real numbers. The // mapping is given by: // // real_value = (raw_input_value - mean_value) / std_value // // In particular, the defaults (mean_value=0, std_value=1) yield // real_value = raw_input_value. Often, non-default values are used in image // models. For example, an image model taking uint8 image channel values as // its raw inputs, in [0, 255] range, may use mean_value=128, std_value=128 to // map them into the interval [-1, 1). // // Note: this matches exactly the meaning of mean_value and std_value in // (TensorFlow via LegacyFedInput). MeanValue *float32 `protobuf:"fixed32,3,opt,name=mean_value,json=meanValue" json:"mean_value,omitempty"` StdValue *float32 `protobuf:"fixed32,4,opt,name=std_value,json=stdValue,def=1" json:"std_value,omitempty"` // Data type of the input. // // In many graphs, the input arrays already have defined data types, // e.g. Placeholder nodes in a TensorFlow GraphDef have a dtype attribute. // In those cases, it is not needed to specify this data_type flag. // The purpose of this flag is only to define the data type of input // arrays whose type isn't defined in the input graph file. For example, // when specifying an arbitrary (not Placeholder) --input_array into // a TensorFlow GraphDef. // // When this data_type is quantized (e.g. QUANTIZED_UINT8), the // corresponding quantization parameters are the mean_value, std_value // fields. // // It is also important to understand the nuance between this data_type // flag and the inference_input_type in TocoFlags. The basic difference // is that this data_type (like all ModelFlags) describes a property // of the input graph, while inference_input_type (like all TocoFlags) // describes an aspect of the toco transformation process and thus of // the output file. The types of input arrays may be different between // the input and output files if quantization or dequantization occurred. // Such differences can only occur for real-number data i.e. only // between FLOAT and quantized types (e.g. QUANTIZED_UINT8). DataType *IODataType `protobuf:"varint,5,opt,name=data_type,json=dataType,enum=toco.IODataType" json:"data_type,omitempty"` // contains filtered or unexported fields }
Next ID to USE: 7.
func (*InputArray) Descriptor
deprecated
func (*InputArray) Descriptor() ([]byte, []int)
Deprecated: Use InputArray.ProtoReflect.Descriptor instead.
func (*InputArray) GetDataType ¶
func (x *InputArray) GetDataType() IODataType
func (*InputArray) GetMeanValue ¶
func (x *InputArray) GetMeanValue() float32
func (*InputArray) GetName ¶
func (x *InputArray) GetName() string
func (*InputArray) GetShape ¶
func (x *InputArray) GetShape() *InputArrayShape
func (*InputArray) GetStdValue ¶
func (x *InputArray) GetStdValue() float32
func (*InputArray) ProtoMessage ¶
func (*InputArray) ProtoMessage()
func (*InputArray) ProtoReflect ¶
func (x *InputArray) ProtoReflect() protoreflect.Message
func (*InputArray) Reset ¶
func (x *InputArray) Reset()
func (*InputArray) String ¶
func (x *InputArray) String() string
type InputArrayShape ¶
type InputArrayShape struct { // Dimensions of the tensor. Dims []int32 `protobuf:"varint,2,rep,name=dims" json:"dims,omitempty"` // If true, the number of dimensions in the shape is unknown. // // If true, "dims.size()" must be 0. UnknownRank *bool `protobuf:"varint,3,opt,name=unknown_rank,json=unknownRank" json:"unknown_rank,omitempty"` // contains filtered or unexported fields }
func (*InputArrayShape) Descriptor
deprecated
func (*InputArrayShape) Descriptor() ([]byte, []int)
Deprecated: Use InputArrayShape.ProtoReflect.Descriptor instead.
func (*InputArrayShape) GetDims ¶
func (x *InputArrayShape) GetDims() []int32
func (*InputArrayShape) GetUnknownRank ¶
func (x *InputArrayShape) GetUnknownRank() bool
func (*InputArrayShape) ProtoMessage ¶
func (*InputArrayShape) ProtoMessage()
func (*InputArrayShape) ProtoReflect ¶
func (x *InputArrayShape) ProtoReflect() protoreflect.Message
func (*InputArrayShape) Reset ¶
func (x *InputArrayShape) Reset()
func (*InputArrayShape) String ¶
func (x *InputArrayShape) String() string
type ModelFlags ¶
type ModelFlags struct { // Information about the input arrays, i.e. the arrays from which input // activations will be read. InputArrays []*InputArray `protobuf:"bytes,1,rep,name=input_arrays,json=inputArrays" json:"input_arrays,omitempty"` // Name of the output arrays, i.e. the arrays into which output activations // will be written. OutputArrays []string `protobuf:"bytes,2,rep,name=output_arrays,json=outputArrays" json:"output_arrays,omitempty"` // Name of the control outputs. ControlOutputArrays []string `protobuf:"bytes,24,rep,name=control_output_arrays,json=controlOutputArrays" json:"control_output_arrays,omitempty"` // If true, the model accepts an arbitrary batch size. Mutually exclusive with // the 'batch' field: at most one of these two fields can be set. VariableBatch *bool `protobuf:"varint,10,opt,name=variable_batch,json=variableBatch" json:"variable_batch,omitempty"` RnnStates []*RnnState `protobuf:"bytes,12,rep,name=rnn_states,json=rnnStates" json:"rnn_states,omitempty"` ModelChecks []*ModelFlags_ModelCheck `protobuf:"bytes,14,rep,name=model_checks,json=modelChecks" json:"model_checks,omitempty"` // If true, will allow passing inexistent arrays in --input_arrays // and --output_arrays. This makes little sense, is only useful to // more easily get graph visualizations. AllowNonexistentArrays *bool `protobuf:"varint,16,opt,name=allow_nonexistent_arrays,json=allowNonexistentArrays" json:"allow_nonexistent_arrays,omitempty"` // If true, will allow passing non-ascii-printable characters in // --input_arrays and --output_arrays. By default (if false), only // ascii printable characters are allowed, i.e. character codes // ranging from 32 to 127. This is disallowed by default so as to // catch common copy-and-paste issues where invisible unicode // characters are unwittingly added to these strings. AllowNonasciiArrays *bool `protobuf:"varint,17,opt,name=allow_nonascii_arrays,json=allowNonasciiArrays" json:"allow_nonascii_arrays,omitempty"` // If set, this ArraysExtraInfo allows to pass extra information about arrays // not specified in the input model file, such as extra MinMax information. ArraysExtraInfo *ArraysExtraInfo `protobuf:"bytes,18,opt,name=arrays_extra_info,json=arraysExtraInfo" json:"arrays_extra_info,omitempty"` // When set to false, toco will not change the input ranges and the output // ranges of concat operator to the overlap of all input ranges. ChangeConcatInputRanges *bool `` /* 135-byte string literal not displayed */ // Filepath of the saved model to be converted. This value will be non-empty // only when the saved model import path will be used. Otherwise, the graph // def-based conversion will be processed. SavedModelDir *string `protobuf:"bytes,20,opt,name=saved_model_dir,json=savedModelDir" json:"saved_model_dir,omitempty"` // SavedModel file format version of The saved model file to be converted. // This value will be set only when the SavedModel import path will be used. SavedModelVersion *int32 `protobuf:"varint,21,opt,name=saved_model_version,json=savedModelVersion" json:"saved_model_version,omitempty"` // Set of string saved model tags, formatted in the comma-separated value. // This value will be set only when the SavedModel import path will be used. SavedModelTags []string `protobuf:"bytes,22,rep,name=saved_model_tags,json=savedModelTags" json:"saved_model_tags,omitempty"` // Names to be exported (default: export all) when the saved model import path // is on. This value will be set only when the SavedModel import path will be // used. SavedModelExportedNames []string `` /* 128-byte string literal not displayed */ // Whether or not to use hlo import. UseHloImport *bool `protobuf:"varint,25,opt,name=use_hlo_import,json=useHloImport" json:"use_hlo_import,omitempty"` // Hlo file type, this will be used for hlo import. HloFileType *ModelFlags_HloFileType `protobuf:"varint,26,opt,name=hlo_file_type,json=hloFileType,enum=toco.ModelFlags_HloFileType" json:"hlo_file_type,omitempty"` // contains filtered or unexported fields }
ModelFlags encodes properties of a model that, depending on the file format, may or may not be recorded in the model file. The purpose of representing these properties in ModelFlags is to allow passing them separately from the input model file, for instance as command-line parameters, so that we can offer a single uniform interface that can handle files from different input formats.
For each of these properties, and each supported file format, we detail in comments below whether the property exists in the given file format.
Obsolete flags that have been removed:
optional int32 input_depth = 3; optional int32 input_width = 4; optional int32 input_height = 5; optional int32 batch = 6 [ default = 1]; optional float mean_value = 7; optional float std_value = 8 [default = 1.]; optional int32 input_dims = 11 [ default = 4]; repeated int32 input_shape = 13;
Next ID to USE: 27.
func (*ModelFlags) Descriptor
deprecated
func (*ModelFlags) Descriptor() ([]byte, []int)
Deprecated: Use ModelFlags.ProtoReflect.Descriptor instead.
func (*ModelFlags) GetAllowNonasciiArrays ¶
func (x *ModelFlags) GetAllowNonasciiArrays() bool
func (*ModelFlags) GetAllowNonexistentArrays ¶
func (x *ModelFlags) GetAllowNonexistentArrays() bool
func (*ModelFlags) GetArraysExtraInfo ¶
func (x *ModelFlags) GetArraysExtraInfo() *ArraysExtraInfo
func (*ModelFlags) GetChangeConcatInputRanges ¶
func (x *ModelFlags) GetChangeConcatInputRanges() bool
func (*ModelFlags) GetControlOutputArrays ¶
func (x *ModelFlags) GetControlOutputArrays() []string
func (*ModelFlags) GetHloFileType ¶
func (x *ModelFlags) GetHloFileType() ModelFlags_HloFileType
func (*ModelFlags) GetInputArrays ¶
func (x *ModelFlags) GetInputArrays() []*InputArray
func (*ModelFlags) GetModelChecks ¶
func (x *ModelFlags) GetModelChecks() []*ModelFlags_ModelCheck
func (*ModelFlags) GetOutputArrays ¶
func (x *ModelFlags) GetOutputArrays() []string
func (*ModelFlags) GetRnnStates ¶
func (x *ModelFlags) GetRnnStates() []*RnnState
func (*ModelFlags) GetSavedModelDir ¶
func (x *ModelFlags) GetSavedModelDir() string
func (*ModelFlags) GetSavedModelExportedNames ¶
func (x *ModelFlags) GetSavedModelExportedNames() []string
func (*ModelFlags) GetSavedModelTags ¶
func (x *ModelFlags) GetSavedModelTags() []string
func (*ModelFlags) GetSavedModelVersion ¶
func (x *ModelFlags) GetSavedModelVersion() int32
func (*ModelFlags) GetUseHloImport ¶
func (x *ModelFlags) GetUseHloImport() bool
func (*ModelFlags) GetVariableBatch ¶
func (x *ModelFlags) GetVariableBatch() bool
func (*ModelFlags) ProtoMessage ¶
func (*ModelFlags) ProtoMessage()
func (*ModelFlags) ProtoReflect ¶
func (x *ModelFlags) ProtoReflect() protoreflect.Message
func (*ModelFlags) Reset ¶
func (x *ModelFlags) Reset()
func (*ModelFlags) String ¶
func (x *ModelFlags) String() string
type ModelFlags_HloFileType ¶
type ModelFlags_HloFileType int32
The hlo file type enum.
const ( ModelFlags_UNKNOWN ModelFlags_HloFileType = 0 ModelFlags_HLO_TEXT ModelFlags_HloFileType = 1 ModelFlags_HLO_PROTO ModelFlags_HloFileType = 2 )
func (ModelFlags_HloFileType) Descriptor ¶
func (ModelFlags_HloFileType) Descriptor() protoreflect.EnumDescriptor
func (ModelFlags_HloFileType) Enum ¶
func (x ModelFlags_HloFileType) Enum() *ModelFlags_HloFileType
func (ModelFlags_HloFileType) EnumDescriptor
deprecated
func (ModelFlags_HloFileType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ModelFlags_HloFileType.Descriptor instead.
func (ModelFlags_HloFileType) Number ¶
func (x ModelFlags_HloFileType) Number() protoreflect.EnumNumber
func (ModelFlags_HloFileType) String ¶
func (x ModelFlags_HloFileType) String() string
func (ModelFlags_HloFileType) Type ¶
func (ModelFlags_HloFileType) Type() protoreflect.EnumType
func (*ModelFlags_HloFileType) UnmarshalJSON
deprecated
func (x *ModelFlags_HloFileType) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type ModelFlags_ModelCheck ¶
type ModelFlags_ModelCheck struct { // Use the name of a type of operator to check its counts. // Use "Total" for overall operator counts. // Use "Arrays" for overall array counts. CountType *string `protobuf:"bytes,1,opt,name=count_type,json=countType,def=None" json:"count_type,omitempty"` // A count of zero is a meaningful check, so negative used to mean disable. CountMin *int32 `protobuf:"varint,2,opt,name=count_min,json=countMin,def=-1" json:"count_min,omitempty"` // If count_max < count_min, then count_min is only allowed value. CountMax *int32 `protobuf:"varint,3,opt,name=count_max,json=countMax,def=-1" json:"count_max,omitempty"` // contains filtered or unexported fields }
Checks applied to the model, typically after toco's comprehensive graph transformations. Next ID to USE: 4.
func (*ModelFlags_ModelCheck) Descriptor
deprecated
func (*ModelFlags_ModelCheck) Descriptor() ([]byte, []int)
Deprecated: Use ModelFlags_ModelCheck.ProtoReflect.Descriptor instead.
func (*ModelFlags_ModelCheck) GetCountMax ¶
func (x *ModelFlags_ModelCheck) GetCountMax() int32
func (*ModelFlags_ModelCheck) GetCountMin ¶
func (x *ModelFlags_ModelCheck) GetCountMin() int32
func (*ModelFlags_ModelCheck) GetCountType ¶
func (x *ModelFlags_ModelCheck) GetCountType() string
func (*ModelFlags_ModelCheck) ProtoMessage ¶
func (*ModelFlags_ModelCheck) ProtoMessage()
func (*ModelFlags_ModelCheck) ProtoReflect ¶
func (x *ModelFlags_ModelCheck) ProtoReflect() protoreflect.Message
func (*ModelFlags_ModelCheck) Reset ¶
func (x *ModelFlags_ModelCheck) Reset()
func (*ModelFlags_ModelCheck) String ¶
func (x *ModelFlags_ModelCheck) String() string
type RnnState ¶
type RnnState struct { StateArray *string `protobuf:"bytes,1,opt,name=state_array,json=stateArray" json:"state_array,omitempty"` BackEdgeSourceArray *string `protobuf:"bytes,2,opt,name=back_edge_source_array,json=backEdgeSourceArray" json:"back_edge_source_array,omitempty"` Discardable *bool `protobuf:"varint,5,opt,name=discardable" json:"discardable,omitempty"` // size allows to specify a 1-D shape for the RNN state array. // Will be expanded with 1's to fit the model. // TODO(benoitjacob): should allow a generic, explicit shape. Size *int32 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"` NumDims *int32 `protobuf:"varint,4,opt,name=num_dims,json=numDims" json:"num_dims,omitempty"` // contains filtered or unexported fields }
func (*RnnState) Descriptor
deprecated
func (*RnnState) GetBackEdgeSourceArray ¶
func (*RnnState) GetDiscardable ¶
func (*RnnState) GetNumDims ¶
func (*RnnState) GetStateArray ¶
func (*RnnState) ProtoMessage ¶
func (*RnnState) ProtoMessage()
func (*RnnState) ProtoReflect ¶
func (x *RnnState) ProtoReflect() protoreflect.Message
type TocoFlags ¶
type TocoFlags struct { // Input file format InputFormat *FileFormat `protobuf:"varint,1,opt,name=input_format,json=inputFormat,enum=toco.FileFormat" json:"input_format,omitempty"` // Output file format OutputFormat *FileFormat `protobuf:"varint,2,opt,name=output_format,json=outputFormat,enum=toco.FileFormat" json:"output_format,omitempty"` // Similar to inference_type, but allows to control specifically the // quantization of input arrays, separately from other arrays. // // If not set, then the value of inference_type is implicitly used, i.e. // by default input arrays are quantized like other arrays. // // Like inference_type, this only affects real-number arrays. By "real-number" // we mean float arrays, and quantized arrays. This excludes plain // integer arrays, strings arrays, and every other data type. // // The typical use for this flag is for vision models taking a bitmap // as input, typically with uint8 channels, yet still requiring floating-point // inference. For such image models, the uint8 input is quantized, i.e. // the uint8 values are interpreted as real numbers, and the quantization // parameters used for such input arrays are their mean_value, std_value // parameters. InferenceInputType *IODataType `` /* 133-byte string literal not displayed */ // Sets the type of real-number arrays in the output file, that is, controls // the representation (quantization) of real numbers in the output file, // except for input arrays, which are controlled by inference_input_type. // // NOTE: this flag only impacts real-number arrays. By "real-number" // we mean float arrays, and quantized arrays. This excludes plain // integer arrays, strings arrays, and every other data type. // // For real-number arrays, the impact of this flag is to allow the output // file to choose a different real-numbers representation (quantization) // from what the input file used. For any other types of arrays, changing // the data type would not make sense. // // Specifically: // - If FLOAT, then real-numbers arrays will be of type float in // the output file. If they were quantized in the input file, then // they get dequantized. // - If QUANTIZED_UINT8, then real-numbers arrays will be quantized // as uint8 in the output file. If they were float in the input file, // then they get quantized. // - If not set, then all real-numbers arrays retain the same type in the // output file as they have in the input file. InferenceType *IODataType `protobuf:"varint,4,opt,name=inference_type,json=inferenceType,enum=toco.IODataType" json:"inference_type,omitempty"` // default_ranges_min and default_ranges_max are helpers to experiment // with quantization of models. Normally, quantization requires the input // model to have (min, max) range information for every activations array. // This is needed in order to know how to quantize arrays and still achieve // satisfactory accuracy. However, in some circumstances one would just like // to estimate the performance of quantized inference, without caring about // accuracy. That is what default_ranges_min and default_ranges_max are for: // when specified, they will be used as default (min, max) range boundaries // for all activation arrays that lack (min, max) range information, thus // allowing for quantization to proceed. // // It should be clear from the above explanation that these parameters are // for experimentation purposes only and should not be used in production: // they make it easy to quantize models, but the resulting quantized model // will be inaccurate. // // These values only apply to arrays quantized with the kUint8 data type. DefaultRangesMin *float32 `protobuf:"fixed32,5,opt,name=default_ranges_min,json=defaultRangesMin" json:"default_ranges_min,omitempty"` DefaultRangesMax *float32 `protobuf:"fixed32,6,opt,name=default_ranges_max,json=defaultRangesMax" json:"default_ranges_max,omitempty"` // Equivalent versions of default_ranges_min/_max for arrays quantized with // the kInt16 data type. DefaultInt16RangesMin *float32 `protobuf:"fixed32,15,opt,name=default_int16_ranges_min,json=defaultInt16RangesMin" json:"default_int16_ranges_min,omitempty"` DefaultInt16RangesMax *float32 `protobuf:"fixed32,16,opt,name=default_int16_ranges_max,json=defaultInt16RangesMax" json:"default_int16_ranges_max,omitempty"` // Ignore and discard FakeQuant nodes. For instance, that can be used to // generate plain float code without fake-quantization from a quantized // graph. DropFakeQuant *bool `protobuf:"varint,7,opt,name=drop_fake_quant,json=dropFakeQuant" json:"drop_fake_quant,omitempty"` // Normally, FakeQuant nodes must be strict boundaries for graph // transformations, in order to ensure that quantized inference has the // exact same arithmetic behavior as quantized training --- which is the // whole point of quantized training and of FakeQuant nodes in the first // place. However, that entails subtle requirements on where exactly // FakeQuant nodes must be placed in the graph. Some quantized graphs // have FakeQuant nodes at unexpected locations, that prevent graph // transformations that are necessary in order to generate inference // code for these graphs. Such graphs should be fixed, but as a // temporary work-around, setting this reorder_across_fake_quant flag // allows toco to perform necessary graph transformations on them, // at the cost of no longer faithfully matching inference and training // arithmetic. ReorderAcrossFakeQuant *bool `protobuf:"varint,8,opt,name=reorder_across_fake_quant,json=reorderAcrossFakeQuant" json:"reorder_across_fake_quant,omitempty"` // If true, allow TOCO to create TF Lite Custom operators for all the // unsupported Tensorflow ops. AllowCustomOps *bool `protobuf:"varint,10,opt,name=allow_custom_ops,json=allowCustomOps" json:"allow_custom_ops,omitempty"` // Applies only to the case when the input format is TENSORFLOW_GRAPHDEF. // If true, then control dependencies will be immediately dropped during // import. // If not set, the default behavior is as follows: // - Default to false if the output format is TENSORFLOW_GRAPHDEF. // - Default to true in all other cases. DropControlDependency *bool `protobuf:"varint,12,opt,name=drop_control_dependency,json=dropControlDependency" json:"drop_control_dependency,omitempty"` // Disables transformations that fuse subgraphs such as known LSTMs (not all // LSTMs are identified). DebugDisableRecurrentCellFusion *bool `` /* 155-byte string literal not displayed */ // Uses the FakeQuantWithMinMaxArgs.num_bits attribute to adjust quantized // array data types throughout the graph. The graph must be properly annotated // with FakeQuant* ops on at least the edges and may contain additional ops on // the interior of the graph to widen/narrow as desired. // // Input and output array data types may change because of this propagation // and users must be sure to query the final data_type values. PropagateFakeQuantNumBits *bool `` /* 137-byte string literal not displayed */ // Some fast uint8 GEMM kernels require uint8 weights to avoid the value 0. // This flag allows nudging them to 1 to allow proceeding, with moderate // inaccuracy. AllowNudgingWeightsToUseFastGemmKernel *bool `` /* 182-byte string literal not displayed */ // Minimum size of constant arrays to deduplicate; arrays smaller will not be // deduplicated. DedupeArrayMinSizeBytes *int64 `` /* 138-byte string literal not displayed */ // Split the LSTM inputs from 5 tensors to 18 tensors for TFLite. // Ignored if the output format is not TFLite. SplitTfliteLstmInputs *bool `` /* 129-byte string literal not displayed */ // Store weights as quantized weights followed by dequantize operations. // Computation is still done in float, but reduces model size (at the cost of // accuracy and latency). // DEPRECATED: Please use post_training_quantize instead. QuantizeWeights *bool `protobuf:"varint,20,opt,name=quantize_weights,json=quantizeWeights,def=0" json:"quantize_weights,omitempty"` // Full filepath of folder to dump the graphs at various stages of processing // GraphViz .dot files. Preferred over --output_format=GRAPHVIZ_DOT in order // to keep the requirements of the output file. DumpGraphvizDir *string `protobuf:"bytes,24,opt,name=dump_graphviz_dir,json=dumpGraphvizDir" json:"dump_graphviz_dir,omitempty"` // Boolean indicating whether to dump the graph after every graph // transformation. DumpGraphvizIncludeVideo *bool `` /* 132-byte string literal not displayed */ // Boolean indicating whether to quantize the weights of the converted float // model. Model size will be reduced and there will be latency improvements // (at the cost of accuracy). PostTrainingQuantize *bool `protobuf:"varint,26,opt,name=post_training_quantize,json=postTrainingQuantize,def=0" json:"post_training_quantize,omitempty"` // This flag only works when converting to TensorFlow Lite format. // When enabled, unsupported ops will be converted to select TensorFlow ops. // TODO(ycling): Consider to rename the following 2 flags and don't call it // "Flex". // `enable_select_tf_ops` should always be used with `allow_custom_ops`. // WARNING: Experimental interface, subject to change EnableSelectTfOps *bool `protobuf:"varint,27,opt,name=enable_select_tf_ops,json=enableSelectTfOps,def=0" json:"enable_select_tf_ops,omitempty"` // This flag only works when converting to TensorFlow Lite format. // When enabled, all TensorFlow ops will be converted to select TensorFlow // ops. // This will force `enable_select_tf_ops` to true. // `force_select_tf_ops` should always be used with `enable_select_tf_ops`. // WARNING: Experimental interface, subject to change ForceSelectTfOps *bool `protobuf:"varint,28,opt,name=force_select_tf_ops,json=forceSelectTfOps,def=0" json:"force_select_tf_ops,omitempty"` // Boolean indicating whether to convert float32 constant buffers to // float16. This is typically done to reduce model size. Delegates may also // wish to implement kernels on reduced precision floats for performance // gains. QuantizeToFloat16 *bool `protobuf:"varint,29,opt,name=quantize_to_float16,json=quantizeToFloat16,def=0" json:"quantize_to_float16,omitempty"` // Boolean flag indicating whether the converter should allow models with // dynamic Tensor shape. When set to False, the converter will generate // runtime memory offsets for activation Tensors (with 128 bits alignment) // and error out on models with undetermined Tensor shape. (Default: True) AllowDynamicTensors *bool `protobuf:"varint,30,opt,name=allow_dynamic_tensors,json=allowDynamicTensors,def=1" json:"allow_dynamic_tensors,omitempty"` // Full filepath of the folder to dump conversion logs. This includes a global // view of the conversion process, and user can choose to submit those logs. ConversionSummaryDir *string `protobuf:"bytes,31,opt,name=conversion_summary_dir,json=conversionSummaryDir" json:"conversion_summary_dir,omitempty"` // String representing the custom ops OpDefs that are included in the // GraphDef. // Deprecated do not use. // // Deprecated: Marked as deprecated in tensorflow/lite/toco/toco_flags.proto. CustomOpdefs []string `protobuf:"bytes,32,rep,name=custom_opdefs,json=customOpdefs" json:"custom_opdefs,omitempty"` // Name of user's defined Tensorflow ops required in the TensorFlow Lite // runtime. These ops will be supported as select TensorFlow ops. SelectUserTfOps []string `protobuf:"bytes,33,rep,name=select_user_tf_ops,json=selectUserTfOps" json:"select_user_tf_ops,omitempty"` // Whether to enable tflite resource variables during conversion or not. // Note: This is an experimental feature. EnableTfliteResourceVariables *bool `` /* 153-byte string literal not displayed */ // Whether to unfold tf.BatchMatMul to a set of tfl.fully_connected ops. If // not, translate to tfl.batch_matmul. // WARNING: Experimental interface, subject to change. UnfoldBatchmatmul *bool `protobuf:"varint,35,opt,name=unfold_batchmatmul,json=unfoldBatchmatmul,def=1" json:"unfold_batchmatmul,omitempty"` // Whether to lower static Tensor List ops to builtin ops. If not, use Flex // tensor list ops. // WARNING: Experimental interface, subject to change. LowerTensorListOps *bool `protobuf:"varint,36,opt,name=lower_tensor_list_ops,json=lowerTensorListOps,def=1" json:"lower_tensor_list_ops,omitempty"` // The accumulation type to use when quantize_to_float16 is true. Typical // choices would be either float16 or float32. AccumulationType *IODataType `protobuf:"varint,37,opt,name=accumulation_type,json=accumulationType,enum=toco.IODataType" json:"accumulation_type,omitempty"` // Whether this model supports inference in bfloat16. // Note: This is an experimental feature. AllowBfloat16 *bool `protobuf:"varint,38,opt,name=allow_bfloat16,json=allowBfloat16,def=0" json:"allow_bfloat16,omitempty"` // If true, automatically adds all tf ops into the model as select Tensorflow // ops. AllowAllSelectTfOps *bool `protobuf:"varint,39,opt,name=allow_all_select_tf_ops,json=allowAllSelectTfOps" json:"allow_all_select_tf_ops,omitempty"` // Whether to unfold large splat constant tensors in the flatbuffer to reduce // model size. UnfoldLargeSplatConstant *bool `` /* 138-byte string literal not displayed */ // Name of TFLite backends which are needed to check compatibility. // WARNING: Experimental interface, subject to change. SupportedBackends []string `protobuf:"bytes,41,rep,name=supported_backends,json=supportedBackends" json:"supported_backends,omitempty"` // Whether to force to use batch size one when the batch size is None during // lowering tensor list ops. DefaultToSingleBatchInTensorListOps *bool `` /* 179-byte string literal not displayed */ // Disable per_channel quantization for dynamic range quantization. // Note: This is an experimental feature DisablePerChannelQuantization *bool `` /* 153-byte string literal not displayed */ // If false, the old TOCO dynamic range quantization is used. // Note: This is an experimental feature EnableMlirDynamicRangeQuantizer *bool `` /* 161-byte string literal not displayed */ // When the output model is used for TF Quantization, this flag indicates the // mode of TF Quantization. Ex: DEFAULT, LEGACY_INTEGER,... TfQuantizationMode *string `protobuf:"bytes,45,opt,name=tf_quantization_mode,json=tfQuantizationMode" json:"tf_quantization_mode,omitempty"` // Disable inferring tensor range for quantization. // Note: This is an experimental feature DisableInferTensorRange *bool `` /* 135-byte string literal not displayed */ // Enable using num bits set in fake quant attributes for quantization. // Note: This is an experimental feature UseFakeQuantNumBits *bool `protobuf:"varint,47,opt,name=use_fake_quant_num_bits,json=useFakeQuantNumBits,def=0" json:"use_fake_quant_num_bits,omitempty"` // Enable converting to DynamicUpdateSlice op (for ops like TensorListSetItem) // Note: This is an experimental feature EnableDynamicUpdateSlice *bool `` /* 138-byte string literal not displayed */ // Whether to preserve `TF::AssertOp`. PreserveAssertOp *bool `protobuf:"varint,49,opt,name=preserve_assert_op,json=preserveAssertOp,def=0" json:"preserve_assert_op,omitempty"` // Whether to ensure each function has a single use. GuaranteeAllFuncsOneUse *bool `` /* 137-byte string literal not displayed */ // contains filtered or unexported fields }
TocoFlags encodes extra parameters that drive tooling operations, that are not normally encoded in model files and in general may not be thought of as properties of models, instead describing how models are to be processed in the context of the present tooling job.
Next ID to use: 51.
func (*TocoFlags) Descriptor
deprecated
func (*TocoFlags) GetAccumulationType ¶
func (x *TocoFlags) GetAccumulationType() IODataType
func (*TocoFlags) GetAllowAllSelectTfOps ¶
func (*TocoFlags) GetAllowBfloat16 ¶
func (*TocoFlags) GetAllowCustomOps ¶
func (*TocoFlags) GetAllowDynamicTensors ¶
func (*TocoFlags) GetAllowNudgingWeightsToUseFastGemmKernel ¶
func (*TocoFlags) GetConversionSummaryDir ¶
func (*TocoFlags) GetCustomOpdefs
deprecated
func (*TocoFlags) GetDebugDisableRecurrentCellFusion ¶
func (*TocoFlags) GetDedupeArrayMinSizeBytes ¶
func (*TocoFlags) GetDefaultInt16RangesMax ¶
func (*TocoFlags) GetDefaultInt16RangesMin ¶
func (*TocoFlags) GetDefaultRangesMax ¶
func (*TocoFlags) GetDefaultRangesMin ¶
func (*TocoFlags) GetDefaultToSingleBatchInTensorListOps ¶
func (*TocoFlags) GetDisableInferTensorRange ¶
func (*TocoFlags) GetDisablePerChannelQuantization ¶
func (*TocoFlags) GetDropControlDependency ¶
func (*TocoFlags) GetDropFakeQuant ¶
func (*TocoFlags) GetDumpGraphvizDir ¶
func (*TocoFlags) GetDumpGraphvizIncludeVideo ¶
func (*TocoFlags) GetEnableDynamicUpdateSlice ¶
func (*TocoFlags) GetEnableMlirDynamicRangeQuantizer ¶
func (*TocoFlags) GetEnableSelectTfOps ¶
func (*TocoFlags) GetEnableTfliteResourceVariables ¶
func (*TocoFlags) GetForceSelectTfOps ¶
func (*TocoFlags) GetGuaranteeAllFuncsOneUse ¶
func (*TocoFlags) GetInferenceInputType ¶
func (x *TocoFlags) GetInferenceInputType() IODataType
func (*TocoFlags) GetInferenceType ¶
func (x *TocoFlags) GetInferenceType() IODataType
func (*TocoFlags) GetInputFormat ¶
func (x *TocoFlags) GetInputFormat() FileFormat
func (*TocoFlags) GetLowerTensorListOps ¶
func (*TocoFlags) GetOutputFormat ¶
func (x *TocoFlags) GetOutputFormat() FileFormat
func (*TocoFlags) GetPostTrainingQuantize ¶
func (*TocoFlags) GetPreserveAssertOp ¶
func (*TocoFlags) GetPropagateFakeQuantNumBits ¶
func (*TocoFlags) GetQuantizeToFloat16 ¶
func (*TocoFlags) GetQuantizeWeights ¶
func (*TocoFlags) GetReorderAcrossFakeQuant ¶
func (*TocoFlags) GetSelectUserTfOps ¶
func (*TocoFlags) GetSplitTfliteLstmInputs ¶
func (*TocoFlags) GetSupportedBackends ¶
func (*TocoFlags) GetTfQuantizationMode ¶
func (*TocoFlags) GetUnfoldBatchmatmul ¶
func (*TocoFlags) GetUnfoldLargeSplatConstant ¶
func (*TocoFlags) GetUseFakeQuantNumBits ¶
func (*TocoFlags) ProtoMessage ¶
func (*TocoFlags) ProtoMessage()
func (*TocoFlags) ProtoReflect ¶
func (x *TocoFlags) ProtoReflect() protoreflect.Message