Documentation ¶
Index ¶
Constants ¶
const (
//DefaultSignatureKey signature key
DefaultSignatureKey = "serving_default"
)
Variables ¶
This section is empty.
Functions ¶
func Transform ¶
func Transform(ctx context.Context, signature *Signature, input *gtly.Object, output interface{}) (common.Storable, error)
The default Transformer will create an object that when marshalled will return as close to the the TensorFlow SavedModel signature as possible; with the caveat that any output will be keyed by the output tensor's name.
Types ¶
type Input ¶
type Input struct { Name string Index int // Position of Tensor in model input. Placeholder tf.Output // TODO refactor out this usage in service/domain.Signature is different from its usage in service/request.Request Vocab bool // false if embedded vocabulary should be ignored Auxiliary bool // true if this input isn't part of the model Type reflect.Type }
type Output ¶
type Output struct { Name string DataType string DataTypeKind reflect.Kind Index int *tf.Operation }
Output represents model output
type Signature ¶
type Signature struct { Method string Inputs []Input Outputs []Output Output Output // Deprecated: Use Outputs[0] if there is only 1 output }
Signature represents Tensorflow SavedModel function Signature. Contains information required to extract vocabularies, unmarshal requests, and validate request inputs. TODO document and address issues if reloaded model IO changes.
type Transformer ¶
type Transformer func(ctx context.Context, signature *Signature, input *gtly.Object, output interface{}) (common.Storable, error)
Transformer is an adapter module used when the output of the TensorFlow model wants to be modified server side. signature is the Signature of the relevant model, determined by request context. input is the request body object as a *gtly.Object output is the TensorFlow SavedModel prediction output.