Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "1.3.1" 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 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) ReadPredictionOutput ¶
func (*Predictor) ReadProfile ¶ 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, deviceId int) (*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, deviceId int) (*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 float64 `json:"ts,omitempty"`
Duration float64 `json:"dur,omitempty"`
ProcessID string `json:"pid,omitempty"`
ThreadID int64 `json:"tid,omitempty"`
Shape string `json:"shape,omitempty"`
AllocatedMemory int64 `json:"allocated_memory,omitempty"`
PeakMemory int64 `json:"peak_memory,omitempty"`
Index int64 `json:"layer_sequence_index,omitempty"`
Start int64 `json:"-"`
End int64 `json:"-"`
StartTime time.Time `json:"-"`
EndTime time.Time `json:"-"`
Seq int64 `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)
Click to show internal directories.
Click to hide internal directories.