predictor

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: NCSA Imports: 16 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Framework dlframework.FrameworkManifest
	Model     dlframework.ModelManifest
	WorkDir   string
	Options   *options.Options
}

func (Base) BatchSize

func (b Base) BatchSize() int

func (Base) Close added in v1.4.0

func (p Base) Close() error

func (Base) DeviceID added in v1.4.0

func (b Base) DeviceID() int

func (Base) FeatureLimit

func (b Base) FeatureLimit() int

func (Base) GPUMetrics

func (b Base) GPUMetrics() string

func (Base) GetFeaturesChecksum added in v1.4.0

func (p Base) GetFeaturesChecksum() string

func (Base) GetFeaturesPath added in v1.4.0

func (p Base) GetFeaturesPath() string

func (Base) GetFeaturesUrl

func (p Base) GetFeaturesUrl() string

func (Base) GetGraphChecksum

func (p Base) GetGraphChecksum() string

func (Base) GetGraphPath

func (p Base) GetGraphPath() string

func (Base) GetGraphUrl

func (p Base) GetGraphUrl() string

func (Base) GetInputLayerName added in v1.4.0

func (p Base) GetInputLayerName(layer string) (string, error)

func (Base) GetLabels added in v1.4.0

func (p Base) GetLabels() ([]string, error)

func (Base) GetPredictionOptions

func (b Base) GetPredictionOptions() (*options.Options, error)

func (Base) GetTypeParameter

func (p Base) GetTypeParameter(typeParameters map[string]*dlframework.ModelManifest_Type_Parameter, name string) (string, error)

func (Base) GetWeightsChecksum

func (p Base) GetWeightsChecksum() string

func (Base) GetWeightsPath

func (p Base) GetWeightsPath() string

func (Base) GetWeightsUrl

func (p Base) GetWeightsUrl() string

func (Base) Modality

func (b Base) Modality() (dlframework.Modality, error)

func (Base) Reset added in v1.4.0

func (p Base) Reset(ctx context.Context) error

func (Base) TraceLevel

func (b Base) TraceLevel() tracer.Level

func (Base) UseGPU

func (b Base) UseGPU() bool

type Predictor

type Predictor interface {
	// Gets framework and model manifests
	Info() (dlframework.FrameworkManifest, dlframework.ModelManifest, error)
	// Gets predictor's Modality
	Modality() (dlframework.Modality, error)
	// Load model from manifest
	Load(ctx context.Context, model dlframework.ModelManifest, opts ...options.Option) (Predictor, error)
	// Returns the prediction options
	GetPredictionOptions() (*options.Options, error)
	// Returns the handle to features
	Predict(ctx context.Context, data interface{}, opts ...options.Option) error
	// Returns the raw inference result as go tensors
	ReadPredictedFeaturesAsMap(ctx context.Context) (map[string]interface{}, error)
	// Clears the internal state of a predictor
	Reset(ctx context.Context) error

	io.Closer
}

Jump to

Keyboard shortcuts

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