types

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	UnsupportedSignatureMethodError    = "signature (%s) contains unsupported method (%s)"
	UnsupportedAPISchemaError          = "schemas for classify/regress APIs currently not supported"
	InconsistentInputOutputFormatError = "expecting all output tensors to have -1 in 0th dimension, like the input tensors"
)

Known error messages

View Source
const B64KeySuffix string = "_bytes"
View Source
const (
	MetaGraphNotFoundError = "model does not contain MetaGraph with tags %v"
)

Known error messages

View Source
const (
	SignatureDefNotFoundError = "SignatureDef (%s) not found in specified MetaGraph"
)

Known error messages

View Source
const (
	UnsupportedDataTypeError = "tensor (%s) contains unsupported data type (%s) for generating payloads"
)

Known error messages

Variables

This section is empty.

Functions

This section is empty.

Types

type TFDType

type TFDType int
const (
	// all the possible constants that can be JSON-ified according to
	// https://www.tensorflow.org/tfx/serving/api_rest#json_mapping
	// along with a representation for B64 strings
	DtBool TFDType = iota
	DtB64String
	DtString
	DtInt8
	DtUInt8
	DtInt16
	DtInt32
	DtUInt32
	DtInt64
	DtUInt64
	DtFloat
	DtDouble
)

func NewTFDType

func NewTFDType(name string, dType string) (TFDType, error)

func (*TFDType) Schema added in v0.1.1

func (t *TFDType) Schema() *openapi3.Schema

type TFMetaGraph

type TFMetaGraph struct {
	SignatureDefs []TFSignatureDef
	Tags          []string
}

func NewTFMetaGraph

func NewTFMetaGraph(metaGraph *pb.MetaGraphDef) (TFMetaGraph, error)

func (*TFMetaGraph) Schema

func (t *TFMetaGraph) Schema(sigDefKey string) (*openapi3.Schema, *openapi3.Schema, error)

type TFMethod

type TFMethod int
const (
	Predict TFMethod = iota
	Classify
	Regress
)

func NewTFMethod

func NewTFMethod(key string, method string) (TFMethod, error)

type TFSavedModel

type TFSavedModel struct {
	MetaGraphs []TFMetaGraph
}

func NewTFSavedModel

func NewTFSavedModel(model *pb.SavedModel) (TFSavedModel, error)

func (*TFSavedModel) Schema

func (t *TFSavedModel) Schema(metaGraphTags []string, sigDefKey string) (*openapi3.Schema, *openapi3.Schema, error)

type TFShape

type TFShape []int64

func NewTFShape

func NewTFShape(dimensions []*fw.TensorShapeProto_Dim) TFShape

type TFSignatureDef

type TFSignatureDef struct {
	Key     string
	Method  TFMethod
	Inputs  []TFTensor
	Outputs []TFTensor
}

func NewTFSignatureDef

func NewTFSignatureDef(key string, method string, inputs map[string]*pb.TensorInfo, outputs map[string]*pb.TensorInfo) (TFSignatureDef, error)

func (*TFSignatureDef) Schema

func (t *TFSignatureDef) Schema() (*openapi3.Schema, *openapi3.Schema, error)

type TFTensor

type TFTensor struct {
	// Name of the logical tensor
	Name string

	// Data type contained in this tensor
	DType TFDType

	// Length of the shape is rank when rank >= 0, nil otherwise
	Shape TFShape

	// If rank = -1, the shape is unknown. Otherwise, rank corresponds to the number of dimensions in this tensor
	Rank int64
}

func NewTFTensor

func NewTFTensor(name string, tensor *pb.TensorInfo) (TFTensor, error)

func (*TFTensor) ColSchema added in v0.1.1

func (t *TFTensor) ColSchema() *openapi3.Schema

func (*TFTensor) RowSchema added in v0.1.1

func (t *TFTensor) RowSchema() *openapi3.Schema

Jump to

Keyboard shortcuts

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