Documentation
¶
Index ¶
- Variables
- func ExtensionApisVersion() string
- func SchemaVersion() int
- func Version() string
- type BuiltinOperator
- type DynamicBuffer
- type ExpRegistration
- type Interpreter
- func (i *Interpreter) AllocateTensors() Status
- func (i *Interpreter) Cancel() Status
- func (i *Interpreter) Delete()
- func (i *Interpreter) EnsureTensorDataIsReadable(index int) Status
- func (i *Interpreter) GetInputTensor(index int) *Tensor
- func (i *Interpreter) GetInputTensorCount() int
- func (i *Interpreter) GetInputTensorIndex(input_index int) int
- func (i *Interpreter) GetOutputTensor(index int) *Tensor
- func (i *Interpreter) GetOutputTensorCount() int
- func (i *Interpreter) GetOutputTensorIndex(output_index int) int
- func (i *Interpreter) GetSignatureCount() int
- func (i *Interpreter) GetSignatureKey(index int) string
- func (i *Interpreter) GetSignatureRunner(key string) *SignatureRunner
- func (i *Interpreter) GetTensor(index int) *Tensor
- func (i *Interpreter) GetVariableTensor(index int) *Tensor
- func (i *Interpreter) GetVariableTensorCount() int
- func (i *Interpreter) InputTensorIndices() []int
- func (i *Interpreter) Invoke() Status
- func (i *Interpreter) ModifyGraphWithDelegate(d delegates.Delegater) Status
- func (i *Interpreter) OutputTensorIndices() []int
- func (i *Interpreter) ResetVariableTensors() Status
- func (i *Interpreter) ResizeInputTensor(index int, dims []int32) Status
- type InterpreterOptions
- func (o *InterpreterOptions) AddDelegate(d delegates.Delegater)
- func (o *InterpreterOptions) Copy() *InterpreterOptions
- func (o *InterpreterOptions) Delete()
- func (o *InterpreterOptions) EnableCancellation(enable bool) Status
- func (o *InterpreterOptions) ExpAddBuiltinOp(op BuiltinOperator, reg *ExpRegistration, minVersion, maxVersion int)
- func (o *InterpreterOptions) ExpAddCustomOp(name string, reg *ExpRegistration, minVersion, maxVersion int)
- func (o *InterpreterOptions) SetEnableDelegateFallback(enable bool)
- func (o *InterpreterOptions) SetErrorReporter(f func(string, interface{}), user_data interface{})
- func (o *InterpreterOptions) SetNumThread(num_threads int)
- func (o *InterpreterOptions) SetUseNNAPI(enable bool)
- type Model
- func NewModel(model_data []byte) *Model
- func NewModelFromFile(model_path string) *Model
- func NewModelFromFileWithErrorReporter(model_path string, f func(string, interface{}), user_data interface{}) *Model
- func NewModelWithErrorReporter(model_data []byte, f func(string, interface{}), user_data interface{}) *Model
- type QuantizationParams
- type SignatureRunner
- func (r *SignatureRunner) AllocateTensors() Status
- func (r *SignatureRunner) Cancel() Status
- func (r *SignatureRunner) Delete()
- func (r *SignatureRunner) GetInputCount() int
- func (r *SignatureRunner) GetInputName(index int) string
- func (r *SignatureRunner) GetInputTensor(name string) *Tensor
- func (r *SignatureRunner) GetOutputCount() int
- func (r *SignatureRunner) GetOutputName(index int) string
- func (r *SignatureRunner) GetOutputTensor(name string) *Tensor
- func (r *SignatureRunner) Invoke() Status
- func (r *SignatureRunner) ResizeInputTensor(name string, dims []int32) Status
- type Status
- type Tensor
- func (t *Tensor) ByteSize() uint
- func (t *Tensor) CopyFromBuffer(b interface{}) Status
- func (t *Tensor) CopyToBuffer(b interface{}) Status
- func (t *Tensor) Data() unsafe.Pointer
- func (t *Tensor) Dim(index int) int
- func (t *Tensor) Float32At(at ...int) float32
- func (t *Tensor) Float32s() []float32
- func (t *Tensor) GetString(index int) string
- func (t *Tensor) Int8s() []int8
- func (t *Tensor) Int16s() []int16
- func (t *Tensor) Int32s() []int32
- func (t *Tensor) Int64s() []int64
- func (t *Tensor) Name() string
- func (t *Tensor) NumDims() int
- func (t *Tensor) QuantizationParams() QuantizationParams
- func (t *Tensor) SetFloat32s(v []float32) error
- func (t *Tensor) SetInt8s(v []int8) error
- func (t *Tensor) SetInt16s(v []int16) error
- func (t *Tensor) SetInt32s(v []int32) error
- func (t *Tensor) SetInt64s(v []int64) error
- func (t *Tensor) SetUint8s(v []uint8) error
- func (t *Tensor) Shape() []int
- func (t *Tensor) String() string
- func (t *Tensor) Type() TensorType
- func (t *Tensor) UInt8s() []uint8
- type TensorType
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTypeMismatch is type mismatch. ErrTypeMismatch = errors.New("type mismatch") // ErrBadTensor is bad tensor. ErrBadTensor = errors.New("bad tensor") )
Functions ¶
func ExtensionApisVersion ¶ added in v1.0.8
func ExtensionApisVersion() string
ExtensionApisVersion return version string of the TensorFlow Lite Extension APIs.
func SchemaVersion ¶ added in v1.0.8
func SchemaVersion() int
SchemaVersion return the supported version of the TensorFlow Lite model schema.
Types ¶
type BuiltinOperator ¶
type BuiltinOperator int
const ( BuiltinOperator_ADD BuiltinOperator = 0 BuiltinOperator_AVERAGE_POOL_2D BuiltinOperator = 1 BuiltinOperator_CONCATENATION BuiltinOperator = 2 BuiltinOperator_CONV_2D BuiltinOperator = 3 BuiltinOperator_DEPTHWISE_CONV_2D BuiltinOperator = 4 BuiltinOperator_DEQUANTIZE BuiltinOperator = 6 BuiltinOperator_EMBEDDING_LOOKUP BuiltinOperator = 7 BuiltinOperator_FLOOR BuiltinOperator = 8 BuiltinOperator_FULLY_CONNECTED BuiltinOperator = 9 BuiltinOperator_HASHTABLE_LOOKUP BuiltinOperator = 10 BuiltinOperator_L2_NORMALIZATION BuiltinOperator = 11 BuiltinOperator_L2_POOL_2D BuiltinOperator = 12 BuiltinOperator_LOCAL_RESPONSE_NORMALIZATION BuiltinOperator = 13 BuiltinOperator_LOGISTIC BuiltinOperator = 14 BuiltinOperator_LSH_PROJECTION BuiltinOperator = 15 BuiltinOperator_LSTM BuiltinOperator = 16 BuiltinOperator_MAX_POOL_2D BuiltinOperator = 17 BuiltinOperator_MUL BuiltinOperator = 18 BuiltinOperator_RELU BuiltinOperator = 19 BuiltinOperator_RELU_N1_TO_1 BuiltinOperator = 20 BuiltinOperator_RELU6 BuiltinOperator = 21 BuiltinOperator_RESHAPE BuiltinOperator = 22 BuiltinOperator_RESIZE_BILINEAR BuiltinOperator = 23 BuiltinOperator_RNN BuiltinOperator = 24 BuiltinOperator_SOFTMAX BuiltinOperator = 25 BuiltinOperator_SPACE_TO_DEPTH BuiltinOperator = 26 BuiltinOperator_SVDF BuiltinOperator = 27 BuiltinOperator_TANH BuiltinOperator = 28 BuiltinOperator_CONCAT_EMBEDDINGS BuiltinOperator = 29 BuiltinOperator_SKIP_GRAM BuiltinOperator = 30 BuiltinOperator_CALL BuiltinOperator = 31 BuiltinOperator_CUSTOM BuiltinOperator = 32 BuiltinOperator_EMBEDDING_LOOKUP_SPARSE BuiltinOperator = 33 BuiltinOperator_PAD BuiltinOperator = 34 BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_RNN BuiltinOperator = 35 BuiltinOperator_GATHER BuiltinOperator = 36 BuiltinOperator_BATCH_TO_SPACE_ND BuiltinOperator = 37 BuiltinOperator_SPACE_TO_BATCH_ND BuiltinOperator = 38 BuiltinOperator_TRANSPOSE BuiltinOperator = 39 BuiltinOperator_MEAN BuiltinOperator = 40 BuiltinOperator_SUB BuiltinOperator = 41 BuiltinOperator_DIV BuiltinOperator = 42 BuiltinOperator_SQUEEZE BuiltinOperator = 43 BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_LSTM BuiltinOperator = 44 BuiltinOperator_STRIDED_SLICE BuiltinOperator = 45 BuiltinOperator_BIDIRECTIONAL_SEQUENCE_RNN BuiltinOperator = 46 BuiltinOperator_EXP BuiltinOperator = 47 BuiltinOperator_TOPK_V2 BuiltinOperator = 48 BuiltinOperator_SPLIT BuiltinOperator = 49 BuiltinOperator_LOG_SOFTMAX BuiltinOperator = 50 BuiltinOperator_DELEGATE BuiltinOperator = 51 BuiltinOperator_BIDIRECTIONAL_SEQUENCE_LSTM BuiltinOperator = 52 BuiltinOperator_CAST BuiltinOperator = 53 BuiltinOperator_PRELU BuiltinOperator = 54 BuiltinOperator_MAXIMUM BuiltinOperator = 55 BuiltinOperator_ARG_MAX BuiltinOperator = 56 BuiltinOperator_MINIMUM BuiltinOperator = 57 BuiltinOperator_LESS BuiltinOperator = 58 BuiltinOperator_NEG BuiltinOperator = 59 BuiltinOperator_PADV2 BuiltinOperator = 60 BuiltinOperator_GREATER BuiltinOperator = 61 BuiltinOperator_GREATER_EQUAL BuiltinOperator = 62 BuiltinOperator_LESS_EQUAL BuiltinOperator = 63 BuiltinOperator_SELECT BuiltinOperator = 64 BuiltinOperator_SLICE BuiltinOperator = 65 BuiltinOperator_SIN BuiltinOperator = 66 BuiltinOperator_TRANSPOSE_CONV BuiltinOperator = 67 BuiltinOperator_SPARSE_TO_DENSE BuiltinOperator = 68 BuiltinOperator_TILE BuiltinOperator = 69 BuiltinOperator_EXPAND_DIMS BuiltinOperator = 70 BuiltinOperator_EQUAL BuiltinOperator = 71 BuiltinOperator_NOT_EQUAL BuiltinOperator = 72 BuiltinOperator_LOG BuiltinOperator = 73 BuiltinOperator_SUM BuiltinOperator = 74 BuiltinOperator_SQRT BuiltinOperator = 75 BuiltinOperator_RSQRT BuiltinOperator = 76 BuiltinOperator_SHAPE BuiltinOperator = 77 BuiltinOperator_POW BuiltinOperator = 78 BuiltinOperator_ARG_MIN BuiltinOperator = 79 BuiltinOperator_FAKE_QUANT BuiltinOperator = 80 BuiltinOperator_REDUCE_PROD BuiltinOperator = 81 BuiltinOperator_REDUCE_MAX BuiltinOperator = 82 BuiltinOperator_PACK BuiltinOperator = 83 BuiltinOperator_LOGICAL_OR BuiltinOperator = 84 BuiltinOperator_ONE_HOT BuiltinOperator = 85 BuiltinOperator_LOGICAL_AND BuiltinOperator = 86 BuiltinOperator_LOGICAL_NOT BuiltinOperator = 87 BuiltinOperator_UNPACK BuiltinOperator = 88 BuiltinOperator_REDUCE_MIN BuiltinOperator = 89 BuiltinOperator_FLOOR_DIV BuiltinOperator = 90 BuiltinOperator_REDUCE_ANY BuiltinOperator = 91 BuiltinOperator_SQUARE BuiltinOperator = 92 BuiltinOperator_ZEROS_LIKE BuiltinOperator = 93 BuiltinOperator_FILL BuiltinOperator = 94 BuiltinOperator_FLOOR_MOD BuiltinOperator = 95 BuiltinOperator_RANGE BuiltinOperator = 96 BuiltinOperator_RESIZE_NEAREST_NEIGHBOR BuiltinOperator = 97 BuiltinOperator_LEAKY_RELU BuiltinOperator = 98 BuiltinOperator_SQUARED_DIFFERENCE BuiltinOperator = 99 BuiltinOperator_MIRROR_PAD BuiltinOperator = 100 BuiltinOperator_ABS BuiltinOperator = 101 BuiltinOperator_SPLIT_V BuiltinOperator = 102 BuiltinOperator_UNIQUE BuiltinOperator = 103 BuiltinOperator_CEIL BuiltinOperator = 104 BuiltinOperator_REVERSE_V2 BuiltinOperator = 105 BuiltinOperator_ADD_N BuiltinOperator = 106 BuiltinOperator_GATHER_ND BuiltinOperator = 107 BuiltinOperator_COS BuiltinOperator = 108 BuiltinOperator_WHERE BuiltinOperator = 109 BuiltinOperator_RANK BuiltinOperator = 110 BuiltinOperator_ELU BuiltinOperator = 111 BuiltinOperator_REVERSE_SEQUENCE BuiltinOperator = 112 BuiltinOperator_MATRIX_DIAG BuiltinOperator = 113 BuiltinOperator_QUANTIZE BuiltinOperator = 114 BuiltinOperator_MATRIX_SET_DIAG BuiltinOperator = 115 BuiltinOperator_MIN BuiltinOperator = BuiltinOperator_ADD BuiltinOperator_MAX BuiltinOperator = BuiltinOperator_MATRIX_SET_DIAG )
type DynamicBuffer ¶
type DynamicBuffer struct {
// contains filtered or unexported fields
}
DynamicBuffer is buffer hold multiple strings.
func (*DynamicBuffer) AddString ¶
func (d *DynamicBuffer) AddString(s string)
AddString append to the dynamic buffer.
func (*DynamicBuffer) WriteToTensorAsVector ¶
func (d *DynamicBuffer) WriteToTensorAsVector(t *Tensor)
WriteToTensorAsVector write buffer into the tensor as vector.
type ExpRegistration ¶
type ExpRegistration struct {
Init unsafe.Pointer
Free unsafe.Pointer
Prepare unsafe.Pointer
Invoke unsafe.Pointer
ProfilingString unsafe.Pointer
}
ExtRegistration indicate registration structure.
type Interpreter ¶
type Interpreter struct {
// contains filtered or unexported fields
}
Interpreter implement TfLiteInterpreter.
func NewInterpreter ¶
func NewInterpreter(model *Model, options *InterpreterOptions) *Interpreter
NewInterpreter create new Interpreter.
func (*Interpreter) AllocateTensors ¶
func (i *Interpreter) AllocateTensors() Status
AllocateTensor allocate tensors for the interpreter.
func (*Interpreter) Cancel ¶ added in v1.0.8
func (i *Interpreter) Cancel() Status
Cancel cancel the in-flight invocation. The Invoke call aborted this way returns an error status. Requires EnableCancellation on the options used to create the interpreter.
func (*Interpreter) EnsureTensorDataIsReadable ¶ added in v1.0.8
func (i *Interpreter) EnsureTensorDataIsReadable(index int) Status
EnsureTensorDataIsReadable ensure the data of the tensor specified by index in the global tensor list is readable.
func (*Interpreter) GetInputTensor ¶
func (i *Interpreter) GetInputTensor(index int) *Tensor
GetInputTensor return input tensor specified by index.
func (*Interpreter) GetInputTensorCount ¶
func (i *Interpreter) GetInputTensorCount() int
GetInputTensorCount return number of input tensors.
func (*Interpreter) GetInputTensorIndex ¶ added in v1.0.8
func (i *Interpreter) GetInputTensorIndex(input_index int) int
GetInputTensorIndex return the index in the global tensor list of the input tensor specified by input_index.
func (*Interpreter) GetOutputTensor ¶
func (i *Interpreter) GetOutputTensor(index int) *Tensor
GetOutputTensor return output tensor specified by index.
func (*Interpreter) GetOutputTensorCount ¶
func (i *Interpreter) GetOutputTensorCount() int
GetOutputTensorCount return number of output tensors.
func (*Interpreter) GetOutputTensorIndex ¶ added in v1.0.8
func (i *Interpreter) GetOutputTensorIndex(output_index int) int
GetOutputTensorIndex return the index in the global tensor list of the output tensor specified by output_index.
func (*Interpreter) GetSignatureCount ¶ added in v1.0.8
func (i *Interpreter) GetSignatureCount() int
GetSignatureCount return the number of signatures defined in the model.
func (*Interpreter) GetSignatureKey ¶ added in v1.0.8
func (i *Interpreter) GetSignatureKey(index int) string
GetSignatureKey return the key of the signature specified by index.
func (*Interpreter) GetSignatureRunner ¶ added in v1.0.8
func (i *Interpreter) GetSignatureRunner(key string) *SignatureRunner
GetSignatureRunner return the runner for the signature specified by key. The returned runner must be deleted with Delete before the interpreter is deleted.
func (*Interpreter) GetTensor ¶ added in v1.0.8
func (i *Interpreter) GetTensor(index int) *Tensor
GetTensor return the tensor specified by index in the global tensor list of the interpreter.
func (*Interpreter) GetVariableTensor ¶ added in v1.0.8
func (i *Interpreter) GetVariableTensor(index int) *Tensor
GetVariableTensor return the variable tensor specified by index.
func (*Interpreter) GetVariableTensorCount ¶ added in v1.0.8
func (i *Interpreter) GetVariableTensorCount() int
GetVariableTensorCount return number of variable tensors associated with the interpreter.
func (*Interpreter) InputTensorIndices ¶ added in v1.0.8
func (i *Interpreter) InputTensorIndices() []int
InputTensorIndices return the tensor indices of the input tensors in the global tensor list of the interpreter.
func (*Interpreter) ModifyGraphWithDelegate ¶ added in v1.0.8
func (i *Interpreter) ModifyGraphWithDelegate(d delegates.Delegater) Status
ModifyGraphWithDelegate apply the delegate to the interpreter after creation. Prefer passing delegates via InterpreterOptions.AddDelegate.
func (*Interpreter) OutputTensorIndices ¶ added in v1.0.8
func (i *Interpreter) OutputTensorIndices() []int
OutputTensorIndices return the tensor indices of the output tensors in the global tensor list of the interpreter.
func (*Interpreter) ResetVariableTensors ¶
func (i *Interpreter) ResetVariableTensors() Status
ResetVariableTensors resets variable tensors.
func (*Interpreter) ResizeInputTensor ¶
func (i *Interpreter) ResizeInputTensor(index int, dims []int32) Status
ResizeInputTensor resize the tensor specified by index with dims.
type InterpreterOptions ¶
type InterpreterOptions struct {
// contains filtered or unexported fields
}
InterpreterOptions implement TfLiteInterpreterOptions.
func NewInterpreterOptions ¶
func NewInterpreterOptions() *InterpreterOptions
NewInterpreterOptions create new InterpreterOptions.
func (*InterpreterOptions) AddDelegate ¶
func (o *InterpreterOptions) AddDelegate(d delegates.Delegater)
func (*InterpreterOptions) Copy ¶ added in v1.0.8
func (o *InterpreterOptions) Copy() *InterpreterOptions
Copy return a copy of the interpreter options.
func (*InterpreterOptions) Delete ¶
func (o *InterpreterOptions) Delete()
Delete delete instance of InterpreterOptions.
func (*InterpreterOptions) EnableCancellation ¶ added in v1.0.8
func (o *InterpreterOptions) EnableCancellation(enable bool) Status
EnableCancellation enable or disable cancellation for the interpreter created with these options. When enabled, an in-flight Invoke call can be aborted with Interpreter.Cancel.
func (*InterpreterOptions) ExpAddBuiltinOp ¶
func (o *InterpreterOptions) ExpAddBuiltinOp(op BuiltinOperator, reg *ExpRegistration, minVersion, maxVersion int)
ExpAddBuiltinOp add builtin op specified by code and registration. Current implementation is work in progress.
func (*InterpreterOptions) ExpAddCustomOp ¶
func (o *InterpreterOptions) ExpAddCustomOp(name string, reg *ExpRegistration, minVersion, maxVersion int)
ExpAddCustomOp add custom op specified by name and registration. Current implementation is work in progress.
func (*InterpreterOptions) SetEnableDelegateFallback ¶ added in v1.0.8
func (o *InterpreterOptions) SetEnableDelegateFallback(enable bool)
SetEnableDelegateFallback enable or disable fallback to CPU when delegate application or invocation fails. When enabled and Invoke returns an error, the interpreter automatically falls back to not using any delegates.
func (*InterpreterOptions) SetErrorReporter ¶
func (o *InterpreterOptions) SetErrorReporter(f func(string, interface{}), user_data interface{})
SetErrorRepoter set a function of reporter.
func (*InterpreterOptions) SetNumThread ¶
func (o *InterpreterOptions) SetNumThread(num_threads int)
SetNumThread set number of threads.
func (*InterpreterOptions) SetUseNNAPI ¶ added in v1.0.2
func (o *InterpreterOptions) SetUseNNAPI(enable bool)
SetUseNNAPI enable or disable the NN API for the interpreter (true to enable).
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is TfLiteModel.
func NewModelFromFile ¶
NewModelFromFile create new Model from file data.
func NewModelFromFileWithErrorReporter ¶ added in v1.0.8
func NewModelFromFileWithErrorReporter(model_path string, f func(string, interface{}), user_data interface{}) *Model
NewModelFromFileWithErrorReporter create new Model from file data. The reporter is called with error messages produced while loading the model.
func NewModelWithErrorReporter ¶ added in v1.0.8
func NewModelWithErrorReporter(model_data []byte, f func(string, interface{}), user_data interface{}) *Model
NewModelWithErrorReporter create new Model from buffer. The reporter is called with error messages produced while loading the model.
type QuantizationParams ¶
QuantizationParams implement TfLiteQuantizationParams.
type SignatureRunner ¶ added in v1.0.8
type SignatureRunner struct {
// contains filtered or unexported fields
}
SignatureRunner implement TfLiteSignatureRunner. It is used to run inference on a specific SavedModel signature.
func (*SignatureRunner) AllocateTensors ¶ added in v1.0.8
func (r *SignatureRunner) AllocateTensors() Status
AllocateTensors allocate tensors for the signature runner.
func (*SignatureRunner) Cancel ¶ added in v1.0.8
func (r *SignatureRunner) Cancel() Status
Cancel cancel the in-flight invocation of the signature runner. Requires EnableCancellation on the options used to create the interpreter.
func (*SignatureRunner) Delete ¶ added in v1.0.8
func (r *SignatureRunner) Delete()
Delete delete instance of the signature runner.
func (*SignatureRunner) GetInputCount ¶ added in v1.0.8
func (r *SignatureRunner) GetInputCount() int
GetInputCount return number of inputs of the signature.
func (*SignatureRunner) GetInputName ¶ added in v1.0.8
func (r *SignatureRunner) GetInputName(index int) string
GetInputName return name of the input specified by index.
func (*SignatureRunner) GetInputTensor ¶ added in v1.0.8
func (r *SignatureRunner) GetInputTensor(name string) *Tensor
GetInputTensor return the input tensor specified by name.
func (*SignatureRunner) GetOutputCount ¶ added in v1.0.8
func (r *SignatureRunner) GetOutputCount() int
GetOutputCount return number of outputs of the signature.
func (*SignatureRunner) GetOutputName ¶ added in v1.0.8
func (r *SignatureRunner) GetOutputName(index int) string
GetOutputName return name of the output specified by index.
func (*SignatureRunner) GetOutputTensor ¶ added in v1.0.8
func (r *SignatureRunner) GetOutputTensor(name string) *Tensor
GetOutputTensor return the output tensor specified by name.
func (*SignatureRunner) Invoke ¶ added in v1.0.8
func (r *SignatureRunner) Invoke() Status
Invoke run the signature.
func (*SignatureRunner) ResizeInputTensor ¶ added in v1.0.8
func (r *SignatureRunner) ResizeInputTensor(name string, dims []int32) Status
ResizeInputTensor resize the input tensor specified by name with dims.
type Tensor ¶
type Tensor struct {
// contains filtered or unexported fields
}
Tensor implement TfLiteTensor.
func (*Tensor) CopyFromBuffer ¶
CopyFromBuffer write buffer to the tensor.
func (*Tensor) CopyToBuffer ¶
CopyToBuffer write buffer from the tensor.
func (*Tensor) QuantizationParams ¶
func (t *Tensor) QuantizationParams() QuantizationParams
QuantizationParams return quantization parameters of the tensor.
func (*Tensor) SetFloat32s ¶
SetFloat32s sets float32s.
type TensorType ¶
type TensorType int
TensorType is types of the tensor.
const ( NoType TensorType = 0 Float32 TensorType = 1 Int32 TensorType = 2 UInt8 TensorType = 3 Int64 TensorType = 4 String TensorType = 5 Bool TensorType = 6 Int16 TensorType = 7 Complex64 TensorType = 8 Int8 TensorType = 9 )
func (TensorType) String ¶
func (i TensorType) String() string
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
_example
|
|
|
fizzbuzz
command
|
|
|
iris
command
|
|
|
sin
command
|
|
|
smartreply
command
|
|
|
text_classification
command
|
|
|
fizzbuzz_edgetpu
module
|
|
|
qa
module
|
|
|
xor_embedded
module
|
|
|
lib
module
|
|
