options

package
v0.2.23-0...-4aaa12c Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: NCSA Imports: 12 Imported by: 41

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

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

func DisableFrameworkAutoTuning(disabled bool) Option

func FeatureLimit

func FeatureLimit(num int) Option

func GPUMetrics

func GPUMetrics(m string) Option

func Graph

func Graph(g []byte) Option

func InputNodes

func InputNodes(ins []Node) Option

func OutputNodes

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

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

func (o *Options) DisableFrameworkAutoTuning() bool

func (*Options) FeatureLimit

func (o *Options) FeatureLimit() int

func (*Options) GPUMetrics

func (o *Options) GPUMetrics() string

func (*Options) Graph

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

func (*Options) InputNodes

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

func (*Options) OutputIndexes

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

func (*Options) OutputNodes

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

func (*Options) SetBatchSize

func (o *Options) SetBatchSize(n int)

func (*Options) SetContext

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

func (*Options) SetDevice

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

func (*Options) SetDisableFrameworkAutoTuning

func (o *Options) SetDisableFrameworkAutoTuning(disabled bool)

func (*Options) SetFeatureLimit

func (o *Options) SetFeatureLimit(n int)

func (*Options) SetGPUMetrics

func (o *Options) SetGPUMetrics(m string)

func (*Options) SetGraph

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

func (*Options) SetInputNodes

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

func (*Options) SetOutputIndexes

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

func (*Options) SetOutputNodes

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

func (*Options) SetTraceLevel

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

func (*Options) SetWeights

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