options

package
v1.4.16 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: NCSA Imports: 12 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultBatchSize    int = 1
	DefaultFeatureLimit int = 10
	DefaultGPUMetrics   string
	DefaultDevice       device
)
View Source
var (
	Config = &optionsConfig{
		done: make(chan struct{}),
	}
)

Functions

This section is empty.

Types

type DeviceType

type DeviceType int
const (
	CPU_DEVICE  DeviceType = iota + 1 // cpu device type
	CUDA_DEVICE DeviceType = 2        // cuda device type
)

func (DeviceType) String

func (d DeviceType) String() string

type Node added in v0.3.0

type Node struct {
	Key   string // name
	Shape []int  // Shape of ndarray
	Dtype tensor.Dtype
}

type Option

type Option func(*Options)

func BatchSize

func BatchSize(n int) Option

func Context

func Context(ctx context.Context) Option

func Device

func Device(deviceType DeviceType, id int) Option

func DisableFrameworkAutoTuning added in v0.3.0

func DisableFrameworkAutoTuning(disabled bool) Option

func FeatureLimit added in v0.3.0

func FeatureLimit(num int) Option

func GPUMetrics added in v0.3.0

func GPUMetrics(m string) Option

func Graph

func Graph(g []byte) Option

func InputNodes added in v0.3.0

func InputNodes(ins []Node) Option

func OutputNodes added in v0.3.0

func OutputNodes(outs []Node) Option

func PredictorOptions

func PredictorOptions(p *dl.PredictionOptions) Option

func Weights

func Weights(w []byte) Option

func WithOptions

func WithOptions(opts *Options) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Options

func (*Options) Append added in v0.3.0

func (o *Options) Append(opts ...Option) *Options

func (*Options) BatchSize

func (o *Options) BatchSize() int

func (*Options) Context

func (o *Options) Context() context.Context

func (*Options) Devices

func (o *Options) Devices() devices

func (*Options) DisableFrameworkAutoTuning added in v0.3.0

func (o *Options) DisableFrameworkAutoTuning() bool

func (*Options) FeatureLimit added in v0.3.0

func (o *Options) FeatureLimit() int

func (*Options) GPUMetrics added in v0.3.0

func (o *Options) GPUMetrics() string

func (*Options) Graph

func (o *Options) Graph() []byte

func (*Options) InputNodes

func (o *Options) InputNodes() []Node

func (*Options) OutputIndexes added in v0.3.0

func (o *Options) OutputIndexes() []int

func (*Options) OutputNodes added in v0.3.0

func (o *Options) OutputNodes() []Node

func (*Options) SetBatchSize added in v0.3.0

func (o *Options) SetBatchSize(n int)

func (*Options) SetContext added in v0.3.0

func (o *Options) SetContext(ctx context.Context)

func (*Options) SetDevice added in v0.3.0

func (o *Options) SetDevice(deviceType DeviceType, id int)

func (*Options) SetDisableFrameworkAutoTuning added in v0.3.0

func (o *Options) SetDisableFrameworkAutoTuning(disabled bool)

func (*Options) SetFeatureLimit added in v0.3.0

func (o *Options) SetFeatureLimit(n int)

func (*Options) SetGPUMetrics added in v0.3.0

func (o *Options) SetGPUMetrics(m string)

func (*Options) SetGraph added in v0.3.0

func (o *Options) SetGraph(g []byte)

func (*Options) SetInputNodes added in v0.3.0

func (o *Options) SetInputNodes(ins []Node)

func (*Options) SetOutputIndexes added in v0.3.0

func (o *Options) SetOutputIndexes(outIdxs []int)

func (*Options) SetOutputNodes added in v0.3.0

func (o *Options) SetOutputNodes(ins []Node)

func (*Options) SetTraceLevel added in v0.3.0

func (o *Options) SetTraceLevel(g tracer.Level)

func (*Options) SetWeights added in v0.3.0

func (o *Options) SetWeights(w []byte)

func (*Options) TraceLevel

func (o *Options) TraceLevel() tracer.Level

func (*Options) UsesGPU

func (o *Options) UsesGPU() bool

func (*Options) Weights

func (o *Options) Weights() []byte

Jump to

Keyboard shortcuts

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