Documentation
¶
Index ¶
- type Base
- func (b Base) BatchSize() int
- func (p Base) Close() error
- func (b Base) DeviceID() int
- func (b Base) FeatureLimit() int
- func (b Base) GPUMetrics() string
- func (p Base) GetFeaturesChecksum() string
- func (p Base) GetFeaturesPath() string
- func (p Base) GetFeaturesUrl() string
- func (p Base) GetGraphChecksum() string
- func (p Base) GetGraphPath() string
- func (p Base) GetGraphUrl() string
- func (p Base) GetInputLayerName(layer string) (string, error)
- func (p Base) GetLabels() ([]string, error)
- func (b Base) GetPredictionOptions() (*options.Options, error)
- func (p Base) GetTypeParameter(typeParameters map[string]*dlframework.ModelManifest_Type_Parameter, ...) (string, error)
- func (p Base) GetWeightsChecksum() string
- func (p Base) GetWeightsPath() string
- func (p Base) GetWeightsUrl() string
- func (b Base) Info() (dlframework.FrameworkManifest, dlframework.ModelManifest, error)
- func (b Base) Modality() (dlframework.Modality, error)
- func (p Base) Reset(ctx context.Context) error
- func (b Base) TraceLevel() tracer.Level
- func (b Base) UseGPU() bool
- type Predictor
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) FeatureLimit ¶
func (Base) GPUMetrics ¶
func (Base) GetFeaturesChecksum ¶ added in v1.4.0
func (Base) GetFeaturesPath ¶ added in v1.4.0
func (Base) GetFeaturesUrl ¶
func (Base) GetGraphChecksum ¶
func (Base) GetGraphPath ¶
func (Base) GetGraphUrl ¶
func (Base) GetInputLayerName ¶ added in v1.4.0
func (Base) GetTypeParameter ¶
func (p Base) GetTypeParameter(typeParameters map[string]*dlframework.ModelManifest_Type_Parameter, name string) (string, error)
func (Base) GetWeightsChecksum ¶
func (Base) GetWeightsPath ¶
func (Base) GetWeightsUrl ¶
func (Base) Info ¶
func (b Base) Info() (dlframework.FrameworkManifest, dlframework.ModelManifest, error)
func (Base) TraceLevel ¶
type Predictor ¶
type Predictor interface {
// Gets framework and model manifests
Info() (dlframework.FrameworkManifest, dlframework.ModelManifest, error)
// Gets predictor's Modality
Modality() (dlframework.Modality, error)
// Set desired output modality if not general
SetDesiredOutput(modality dlframework.Modality)
// 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
}
Click to show internal directories.
Click to hide internal directories.