Documentation
¶
Index ¶
- Variables
- func Dictionary(session *tf.Session, graph *tf.Graph, signature *domain.Signature) (*common.Dictionary, error)
- func DiscoverDictionary(session *tf.Session, graph *tf.Graph, layers []string) (*common.Dictionary, error)
- func Export(session *tf.Session, graph *tf.Graph, name string) (interface{}, error)
- func MatchOperation(graph *tf.Graph, name string) string
- func RunExport(session *tf.Session, exportOp *tf.Operation) (interface{}, error)
- type Evaluator
- type Runner
- type Service
- func (s *Service) Close() error
- func (s *Service) Dictionary() *common.Dictionary
- func (s *Service) Inputs() map[string]*domain.Input
- func (s *Service) Predict(ctx context.Context, params []interface{}) ([]interface{}, error)
- func (s *Service) ReloadIfNeeded(ctx context.Context) error
- func (s *Service) Signature() *domain.Signature
- func (s *Service) Stats(r map[string]interface{})
Constants ¶
This section is empty.
Variables ¶
var TFSessionPanicDuration time.Duration = 1 * time.Minute
Functions ¶
func Dictionary ¶ added in v0.13.0
func Dictionary(session *tf.Session, graph *tf.Graph, signature *domain.Signature) (*common.Dictionary, error)
Dictionary uses domain.Signature to determine which inputs should have an encoding lookup from the Tensorflow graph. TODO pull out *domain.Signature, just use a slice of something.
func DiscoverDictionary ¶ added in v0.13.0
func DiscoverDictionary(session *tf.Session, graph *tf.Graph, layers []string) (*common.Dictionary, error)
DiscoverDictionary extracts vocabulary from from best guessed layer and operations.
func MatchOperation ¶
MatchOperation will attempt to locate an LookupTableExportV2 operation that is associated to the provided name.
Types ¶
type Evaluator ¶
Evaluator represents evaluator
func NewEvaluator ¶
NewEvaluator creates new evaluator
type Service ¶ added in v0.13.0
type Service struct { // Should point to service.Service.ReloadOK ReloadOK *int32 // contains filtered or unexported fields }
Service is responsible for being the entrypoint for all Tensorflow model runs. It manages loading and reloading the model files, as well as providing metadata based off the model and configuration.
func NewService ¶ added in v0.13.0
func NewService(cfg *config.Model, fs afs.Service, metrics *gmetric.Service, sema *semaphore.Weighted, maxEvaluatorWait time.Duration) *Service
NewService creates an unprepared Service. This service isn't ready until ReloadIfNeeded() is called.
func (*Service) Dictionary ¶ added in v0.13.0
func (s *Service) Dictionary() *common.Dictionary
func (*Service) ReloadIfNeeded ¶ added in v0.13.0
Assumes that after the initial reload, there is no significant changes to the inputs and outputs from reloading the model. If a model reload results in changes to inputs or outputs, the resulting behavior is undefined. TODO restructure to easily test configuration signature merging.