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 Tuple
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "0.0.1" BuildDate = "undefined" GitCommit = "undefined" )
Functions ¶
func GetErrorString ¶
func GetErrorString() string
func PanicOnError ¶
func PanicOnError()
func ResetError ¶
func ResetError()
Types ¶
type DType ¶
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 ¶
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 ¶
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 ¶
func (*Predictor) EnableProfiling ¶
func (*Predictor) EndProfiling ¶
func (*Predictor) ReadPredictionOutput ¶
func (*Predictor) ReadProfile ¶
func (*Predictor) StartProfiling ¶
type Tensor ¶
type Tensor struct {
// contains filtered or unexported fields
}
Tensor holds a multi-dimensional array of elements of a single data type.
func NewTensor ¶
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 ¶
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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.