Documentation
¶
Index ¶
- Variables
- func GetError() error
- func GetErrorString() string
- func HasError() bool
- func PanicOnError()
- func PrintTensors(inputs ...*Tensor)
- func ResetError()
- type DType
- type DeviceKind
- type Error
- type Predictor
- func (p *Predictor) Close()
- func (p *Predictor) DisableProfiling() error
- func (p *Predictor) EnableProfiling() error
- func (p *Predictor) EndProfiling() error
- func (p *Predictor) Predict(ctx context.Context, inputs []tensor.Tensor) error
- func (p *Predictor) ReadPredictionOutput(ctx context.Context) ([]tensor.Tensor, error)
- func (p *Predictor) ReadProfile() (string, error)
- func (p *Predictor) StartProfiling(name, metadata string) error
- type Tensor
- type Trace
- type TraceEvent
- type TraceEvents
- type Tuple
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "1.0.4" BuildDate = "undefined" GitCommit = "undefined" )
Functions ¶
func GetErrorString ¶ added in v0.1.0
func GetErrorString() string
func PanicOnError ¶ added in v0.1.0
func PanicOnError()
func PrintTensors ¶ added in v0.1.0
func PrintTensors(inputs ...*Tensor)
PrintTensors prints tensors contents
func ResetError ¶ added in v0.1.0
func ResetError()
Types ¶
type DType ¶ added in v0.1.0
type DType C.Torch_DataType
DType tensor scalar data type
const ( UnknownType DType = C.Torch_Unknown // Byte byte tensors (go type uint8) Byte DType = C.Torch_Byte // Char char tensor (go type int8) Char DType = C.Torch_Char // Int int tensor (go type int32) Int DType = C.Torch_Int // Long long tensor (go type int64) Long DType = C.Torch_Long // Float tensor (go type float32) Float DType = C.Torch_Float // Double tensor (go type float64) Double DType = C.Torch_Double )
type DeviceKind ¶ added in v0.1.0
type DeviceKind C.Torch_DeviceKind
const ( UnknownDeviceKind DeviceKind = C.UNKNOWN_DEVICE_KIND CPUDeviceKind DeviceKind = C.CPU_DEVICE_KIND CUDADeviceKind DeviceKind = C.CUDA_DEVICE_KIND )
type Error ¶ added in v0.1.0
type Error struct {
// contains filtered or unexported fields
}
Error errors returned by torch functions
type Predictor ¶
type Predictor struct {
// contains filtered or unexported fields
}
func (*Predictor) DisableProfiling ¶ added in v0.1.0
func (*Predictor) EnableProfiling ¶ added in v0.1.0
func (*Predictor) EndProfiling ¶ added in v0.1.0
func (*Predictor) ReadPredictionOutput ¶
func (*Predictor) ReadProfile ¶ added in v0.1.0
func (*Predictor) StartProfiling ¶ added in v0.1.0
type Tensor ¶ added in v0.1.0
type Tensor struct {
// contains filtered or unexported fields
}
Tensor holds a multi-dimensional array of elements of a single data type.
func NewTensor ¶ added in v0.1.0
func NewTensor(value interface{}, device DeviceKind) (*Tensor, error)
NewTensor converts from a Go value to a Tensor. Valid values are scalars, slices, and arrays. Every element of a slice must have the same length so that the resulting Tensor has a valid shape.
func NewTensorWithShape ¶ added in v0.1.0
func NewTensorWithShape(value interface{}, shape []int64, dt DType, device DeviceKind) (*Tensor, error)
NewTensorWithShape converts a single dimensional Go array or slice into a Tensor with given shape
type Trace ¶ added in v0.1.0
type Trace struct { StartTime time.Time TraceEvents TraceEvents }
func (*Trace) Publish ¶ added in v0.1.0
func (t *Trace) Publish(ctx context.Context, lvl tracer.Level, opts ...opentracing.StartSpanOption) error
type TraceEvent ¶ added in v0.1.0
type TraceEvent struct { Name string `json:"name,omitempty"` Phase string `json:"ph,omitempty"` Timestamp float32 `json:"ts,omitempty"` Duration float32 `json:"dur,omitempty"` ProcessID string `json:"pid,omitempty"` ThreadID int64 `json:"tid,omitempty"` Start int64 `json:"-"` End int64 `json:"-"` StartTime time.Time `json:"-"` EndTime time.Time `json:"-"` }
func (TraceEvent) ID ¶ added in v0.1.0
func (t TraceEvent) ID() string
func (*TraceEvent) Publish ¶ added in v0.1.0
func (event *TraceEvent) Publish(ctx context.Context, lvl tracer.Level, opts ...opentracing.StartSpanOption) error
type TraceEvents ¶ added in v0.1.0
type TraceEvents []TraceEvent
func (TraceEvents) Len ¶ added in v0.1.0
func (t TraceEvents) Len() int
func (TraceEvents) Less ¶ added in v0.1.0
func (t TraceEvents) Less(i, j int) bool
func (TraceEvents) Swap ¶ added in v0.1.0
func (t TraceEvents) Swap(i, j int)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.