Documentation ¶
Overview ¶
Package etensor provides a basic set of tensor data structures (n-dimensional arrays of data), based on apache/arrow/go/tensor and intercompatible with those structures.
The primary differences are:
- pure simple unidimensional Go slice used as the backing data array, auto allocated
- fully modifiable data -- arrow is designed to be read-only
- Shape struct is fully usable separate from the tensor data
- Everything exported, e.g., Offset method on Shape
- int used instead of int64 to make everything easier -- target platforms are all 64bit and have 64bit int in Go by default
Index ¶
- Variables
- func BoolToFloat64(bv bool) float64
- func ColMajorStrides(shape []int) []int
- func CopyInts(a []int) []int
- func CopyInts64(a []int64) []int
- func CopyStrings(a []string) []string
- func EqualInts(a, b []int) bool
- func Float64ToBool(val float64) bool
- func Float64ToString(val float64) string
- func IntTo64(isl []int) []int64
- func Prjn2DSet(tsr Tensor, oddRow bool, row, col int, val float64)
- func Prjn2DShape(tsr Tensor, oddRow bool) (rows, cols int)
- func Prjn2DVal(tsr Tensor, oddRow bool, row, col int) float64
- func RowMajorStrides(shape []int) []int
- func StringToFloat64(str string) float64
- type AggFunc
- type Bits
- func (tsr *Bits) AddRows(n int)
- func (tsr *Bits) Agg(ini float64, fun AggFunc) float64
- func (tsr *Bits) At(i, j int) float64
- func (tsr *Bits) Clone() Tensor
- func (tsr *Bits) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Bits) CopyFrom(frm Tensor)
- func (tsr *Bits) DataType() Type
- func (tsr *Bits) Dims() (r, c int)
- func (tsr *Bits) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Bits) FloatVal(i []int) float64
- func (tsr *Bits) FloatVal1D(off int) float64
- func (tsr *Bits) Floats() []float64
- func (tsr *Bits) IsNull(i []int) bool
- func (tsr *Bits) IsNull1D(i int) bool
- func (tsr *Bits) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Bits) Set(i []int, val bool)
- func (tsr *Bits) SetFloat(i []int, val float64)
- func (tsr *Bits) SetFloat1D(off int, val float64)
- func (tsr *Bits) SetFloats(vals []float64)
- func (tsr *Bits) SetFunc(fun EvalFunc)
- func (tsr *Bits) SetNull(i []int, nul bool)
- func (tsr *Bits) SetNull1D(i int, nul bool)
- func (tsr *Bits) SetNumRows(rows int)
- func (tsr *Bits) SetShape(shape, strides []int, names []string)
- func (tsr *Bits) SetString(i []int, val string)
- func (tsr *Bits) SetString1D(off int, val string)
- func (tsr *Bits) SetZeros()
- func (tsr *Bits) ShapeObj() *Shape
- func (tsr *Bits) StringVal(i []int) string
- func (tsr *Bits) StringVal1D(off int) string
- func (tsr *Bits) SubSpace(subdim int, offs []int) Tensor
- func (tsr *Bits) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *Bits) T() mat.Matrix
- func (tsr *Bits) Value(i []int) bool
- func (tsr *Bits) Value1D(i int) bool
- type BoolType
- type EvalFunc
- type Float32
- func (tsr *Float32) AddRows(n int)
- func (tsr *Float32) Agg(ini float64, fun AggFunc) float64
- func (tsr *Float32) At(i, j int) float64
- func (tsr *Float32) Clone() Tensor
- func (tsr *Float32) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Float32) CopyFrom(frm Tensor)
- func (tsr *Float32) DataType() Type
- func (tsr *Float32) Dims() (r, c int)
- func (tsr *Float32) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Float32) FloatVal(i []int) float64
- func (tsr *Float32) FloatVal1D(off int) float64
- func (tsr *Float32) Floats() []float64
- func (tsr *Float32) FromArrow(arw *tensor.Float32, cpy bool)
- func (tsr *Float32) IsNull(i []int) bool
- func (tsr *Float32) IsNull1D(i int) bool
- func (tsr *Float32) Label() string
- func (tsr *Float32) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Float32) Set(i []int, val float32)
- func (tsr *Float32) SetFloat(i []int, val float64)
- func (tsr *Float32) SetFloat1D(off int, val float64)
- func (tsr *Float32) SetFloats(vals []float64)
- func (tsr *Float32) SetFunc(fun EvalFunc)
- func (tsr *Float32) SetNull(i []int, nul bool)
- func (tsr *Float32) SetNull1D(i int, nul bool)
- func (tsr *Float32) SetNumRows(rows int)
- func (tsr *Float32) SetShape(shape, strides []int, names []string)
- func (tsr *Float32) SetString(i []int, val string)
- func (tsr *Float32) SetString1D(off int, val string)
- func (tsr *Float32) SetZeros()
- func (tsr *Float32) ShapeObj() *Shape
- func (tsr *Float32) String() string
- func (tsr *Float32) StringVal(i []int) string
- func (tsr *Float32) StringVal1D(off int) string
- func (tsr *Float32) SubSpace(subdim int, offs []int) Tensor
- func (tsr *Float32) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *Float32) T() mat.Matrix
- func (tsr *Float32) ToArrow() *tensor.Float32
- func (tsr *Float32) Value(i []int) float32
- func (tsr *Float32) Value1D(i int) float32
- type Float64
- func (tsr *Float64) AddRows(n int)
- func (tsr *Float64) Agg(ini float64, fun AggFunc) float64
- func (tsr *Float64) At(i, j int) float64
- func (tsr *Float64) Clone() Tensor
- func (tsr *Float64) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Float64) CopyFrom(frm Tensor)
- func (tsr *Float64) DataType() Type
- func (tsr *Float64) Dims() (r, c int)
- func (tsr *Float64) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Float64) FloatVal(i []int) float64
- func (tsr *Float64) FloatVal1D(off int) float64
- func (tsr *Float64) Floats() []float64
- func (tsr *Float64) FromArrow(arw *tensor.Float64, cpy bool)
- func (tsr *Float64) IsNull(i []int) bool
- func (tsr *Float64) IsNull1D(i int) bool
- func (tsr *Float64) Label() string
- func (tsr *Float64) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Float64) Set(i []int, val float64)
- func (tsr *Float64) SetFloat(i []int, val float64)
- func (tsr *Float64) SetFloat1D(off int, val float64)
- func (tsr *Float64) SetFloats(vals []float64)
- func (tsr *Float64) SetFunc(fun EvalFunc)
- func (tsr *Float64) SetNull(i []int, nul bool)
- func (tsr *Float64) SetNull1D(i int, nul bool)
- func (tsr *Float64) SetNumRows(rows int)
- func (tsr *Float64) SetShape(shape, strides []int, names []string)
- func (tsr *Float64) SetString(i []int, val string)
- func (tsr *Float64) SetString1D(off int, val string)
- func (tsr *Float64) SetZeros()
- func (tsr *Float64) ShapeObj() *Shape
- func (tsr *Float64) String() string
- func (tsr *Float64) StringVal(i []int) string
- func (tsr *Float64) StringVal1D(off int) string
- func (tsr *Float64) SubSpace(subdim int, offs []int) Tensor
- func (tsr *Float64) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *Float64) T() mat.Matrix
- func (tsr *Float64) ToArrow() *tensor.Float64
- func (tsr *Float64) Value(i []int) float64
- func (tsr *Float64) Value1D(i int) float64
- type Int16
- func (tsr *Int16) AddRows(n int)
- func (tsr *Int16) Agg(ini float64, fun AggFunc) float64
- func (tsr *Int16) At(i, j int) float64
- func (tsr *Int16) Clone() Tensor
- func (tsr *Int16) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Int16) CopyFrom(frm Tensor)
- func (tsr *Int16) DataType() Type
- func (tsr *Int16) Dims() (r, c int)
- func (tsr *Int16) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Int16) FloatVal(i []int) float64
- func (tsr *Int16) FloatVal1D(off int) float64
- func (tsr *Int16) Floats() []float64
- func (tsr *Int16) FromArrow(arw *tensor.Int16, cpy bool)
- func (tsr *Int16) IsNull(i []int) bool
- func (tsr *Int16) IsNull1D(i int) bool
- func (tsr *Int16) Label() string
- func (tsr *Int16) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Int16) Set(i []int, val int16)
- func (tsr *Int16) SetFloat(i []int, val float64)
- func (tsr *Int16) SetFloat1D(off int, val float64)
- func (tsr *Int16) SetFloats(vals []float64)
- func (tsr *Int16) SetFunc(fun EvalFunc)
- func (tsr *Int16) SetNull(i []int, nul bool)
- func (tsr *Int16) SetNull1D(i int, nul bool)
- func (tsr *Int16) SetNumRows(rows int)
- func (tsr *Int16) SetShape(shape, strides []int, names []string)
- func (tsr *Int16) SetString(i []int, val string)
- func (tsr *Int16) SetString1D(off int, val string)
- func (tsr *Int16) SetZeros()
- func (tsr *Int16) ShapeObj() *Shape
- func (tsr *Int16) String() string
- func (tsr *Int16) StringVal(i []int) string
- func (tsr *Int16) StringVal1D(off int) string
- func (tsr *Int16) SubSpace(subdim int, offs []int) Tensor
- func (tsr *Int16) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *Int16) T() mat.Matrix
- func (tsr *Int16) ToArrow() *tensor.Int16
- func (tsr *Int16) Value(i []int) int16
- func (tsr *Int16) Value1D(i int) int16
- type Int32
- func (tsr *Int32) AddRows(n int)
- func (tsr *Int32) Agg(ini float64, fun AggFunc) float64
- func (tsr *Int32) At(i, j int) float64
- func (tsr *Int32) Clone() Tensor
- func (tsr *Int32) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Int32) CopyFrom(frm Tensor)
- func (tsr *Int32) DataType() Type
- func (tsr *Int32) Dims() (r, c int)
- func (tsr *Int32) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Int32) FloatVal(i []int) float64
- func (tsr *Int32) FloatVal1D(off int) float64
- func (tsr *Int32) Floats() []float64
- func (tsr *Int32) FromArrow(arw *tensor.Int32, cpy bool)
- func (tsr *Int32) IsNull(i []int) bool
- func (tsr *Int32) IsNull1D(i int) bool
- func (tsr *Int32) Label() string
- func (tsr *Int32) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Int32) Set(i []int, val int32)
- func (tsr *Int32) SetFloat(i []int, val float64)
- func (tsr *Int32) SetFloat1D(off int, val float64)
- func (tsr *Int32) SetFloats(vals []float64)
- func (tsr *Int32) SetFunc(fun EvalFunc)
- func (tsr *Int32) SetNull(i []int, nul bool)
- func (tsr *Int32) SetNull1D(i int, nul bool)
- func (tsr *Int32) SetNumRows(rows int)
- func (tsr *Int32) SetShape(shape, strides []int, names []string)
- func (tsr *Int32) SetString(i []int, val string)
- func (tsr *Int32) SetString1D(off int, val string)
- func (tsr *Int32) SetZeros()
- func (tsr *Int32) ShapeObj() *Shape
- func (tsr *Int32) String() string
- func (tsr *Int32) StringVal(i []int) string
- func (tsr *Int32) StringVal1D(off int) string
- func (tsr *Int32) SubSpace(subdim int, offs []int) Tensor
- func (tsr *Int32) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *Int32) T() mat.Matrix
- func (tsr *Int32) ToArrow() *tensor.Int32
- func (tsr *Int32) Value(i []int) int32
- func (tsr *Int32) Value1D(i int) int32
- type Int64
- func (tsr *Int64) AddRows(n int)
- func (tsr *Int64) Agg(ini float64, fun AggFunc) float64
- func (tsr *Int64) At(i, j int) float64
- func (tsr *Int64) Clone() Tensor
- func (tsr *Int64) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Int64) CopyFrom(frm Tensor)
- func (tsr *Int64) DataType() Type
- func (tsr *Int64) Dims() (r, c int)
- func (tsr *Int64) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Int64) FloatVal(i []int) float64
- func (tsr *Int64) FloatVal1D(off int) float64
- func (tsr *Int64) Floats() []float64
- func (tsr *Int64) FromArrow(arw *tensor.Int64, cpy bool)
- func (tsr *Int64) IsNull(i []int) bool
- func (tsr *Int64) IsNull1D(i int) bool
- func (tsr *Int64) Label() string
- func (tsr *Int64) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Int64) Set(i []int, val int64)
- func (tsr *Int64) SetFloat(i []int, val float64)
- func (tsr *Int64) SetFloat1D(off int, val float64)
- func (tsr *Int64) SetFloats(vals []float64)
- func (tsr *Int64) SetFunc(fun EvalFunc)
- func (tsr *Int64) SetNull(i []int, nul bool)
- func (tsr *Int64) SetNull1D(i int, nul bool)
- func (tsr *Int64) SetNumRows(rows int)
- func (tsr *Int64) SetShape(shape, strides []int, names []string)
- func (tsr *Int64) SetString(i []int, val string)
- func (tsr *Int64) SetString1D(off int, val string)
- func (tsr *Int64) SetZeros()
- func (tsr *Int64) ShapeObj() *Shape
- func (tsr *Int64) String() string
- func (tsr *Int64) StringVal(i []int) string
- func (tsr *Int64) StringVal1D(off int) string
- func (tsr *Int64) SubSpace(subdim int, offs []int) Tensor
- func (tsr *Int64) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *Int64) T() mat.Matrix
- func (tsr *Int64) ToArrow() *tensor.Int64
- func (tsr *Int64) Value(i []int) int64
- func (tsr *Int64) Value1D(i int) int64
- type Int8
- func (tsr *Int8) AddRows(n int)
- func (tsr *Int8) Agg(ini float64, fun AggFunc) float64
- func (tsr *Int8) At(i, j int) float64
- func (tsr *Int8) Clone() Tensor
- func (tsr *Int8) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Int8) CopyFrom(frm Tensor)
- func (tsr *Int8) DataType() Type
- func (tsr *Int8) Dims() (r, c int)
- func (tsr *Int8) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Int8) FloatVal(i []int) float64
- func (tsr *Int8) FloatVal1D(off int) float64
- func (tsr *Int8) Floats() []float64
- func (tsr *Int8) FromArrow(arw *tensor.Int8, cpy bool)
- func (tsr *Int8) IsNull(i []int) bool
- func (tsr *Int8) IsNull1D(i int) bool
- func (tsr *Int8) Label() string
- func (tsr *Int8) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Int8) Set(i []int, val int8)
- func (tsr *Int8) SetFloat(i []int, val float64)
- func (tsr *Int8) SetFloat1D(off int, val float64)
- func (tsr *Int8) SetFloats(vals []float64)
- func (tsr *Int8) SetFunc(fun EvalFunc)
- func (tsr *Int8) SetNull(i []int, nul bool)
- func (tsr *Int8) SetNull1D(i int, nul bool)
- func (tsr *Int8) SetNumRows(rows int)
- func (tsr *Int8) SetShape(shape, strides []int, names []string)
- func (tsr *Int8) SetString(i []int, val string)
- func (tsr *Int8) SetString1D(off int, val string)
- func (tsr *Int8) SetZeros()
- func (tsr *Int8) ShapeObj() *Shape
- func (tsr *Int8) String() string
- func (tsr *Int8) StringVal(i []int) string
- func (tsr *Int8) StringVal1D(off int) string
- func (tsr *Int8) SubSpace(subdim int, offs []int) Tensor
- func (tsr *Int8) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *Int8) T() mat.Matrix
- func (tsr *Int8) ToArrow() *tensor.Int8
- func (tsr *Int8) Value(i []int) int8
- func (tsr *Int8) Value1D(i int) int8
- type Shape
- func (sh *Shape) CopyShape(cp *Shape)
- func (sh *Shape) Dim(i int) int
- func (sh *Shape) DimName(i int) string
- func (sh *Shape) DimNames() []string
- func (sh *Shape) Index(offset int) []int
- func (sh *Shape) IsColMajor() bool
- func (sh *Shape) IsContiguous() bool
- func (sh *Shape) IsEqual(oth *Shape) bool
- func (sh *Shape) IsRowMajor() bool
- func (sh *Shape) Len() int
- func (sh *Shape) NumDims() int
- func (sh *Shape) Offset(index []int) int
- func (sh *Shape) RowCellSize() (rows, cells int)
- func (sh *Shape) SetShape(shape, strides []int, names []string)
- func (sh *Shape) SetShape64(shape, strides []int64, names []string)
- func (sh *Shape) Shape64() []int64
- func (sh *Shape) Shapes() []int
- func (sh *Shape) Strides() []int
- func (sh *Shape) Strides64() []int64
- func (sh *Shape) String() string
- type String
- func (tsr *String) AddRows(n int)
- func (tsr *String) Agg(ini float64, fun AggFunc) float64
- func (tsr *String) At(i, j int) float64
- func (tsr *String) Clone() Tensor
- func (tsr *String) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *String) CopyFrom(frm Tensor)
- func (tsr *String) DataType() Type
- func (tsr *String) Dims() (r, c int)
- func (tsr *String) Eval(res *[]float64, fun EvalFunc)
- func (tsr *String) FloatVal(i []int) float64
- func (tsr *String) FloatVal1D(off int) float64
- func (tsr *String) Floats() []float64
- func (tsr *String) IsNull(i []int) bool
- func (tsr *String) IsNull1D(i int) bool
- func (tsr *String) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *String) Set(i []int, val string)
- func (tsr *String) SetFloat(i []int, val float64)
- func (tsr *String) SetFloat1D(off int, val float64)
- func (tsr *String) SetFloats(vals []float64)
- func (tsr *String) SetFunc(fun EvalFunc)
- func (tsr *String) SetNull(i []int, nul bool)
- func (tsr *String) SetNull1D(i int, nul bool)
- func (tsr *String) SetNumRows(rows int)
- func (tsr *String) SetShape(shape, strides []int, names []string)
- func (tsr *String) SetString(i []int, val string)
- func (tsr *String) SetString1D(off int, val string)
- func (tsr *String) SetZeros()
- func (tsr *String) ShapeObj() *Shape
- func (tsr *String) StringVal(i []int) string
- func (tsr *String) StringVal1D(off int) string
- func (tsr *String) SubSpace(subdim int, offs []int) Tensor
- func (tsr *String) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *String) T() mat.Matrix
- func (tsr *String) Value(i []int) string
- func (tsr *String) Value1D(i int) string
- type Tensor
- type Type
- type Uint16
- func (tsr *Uint16) AddRows(n int)
- func (tsr *Uint16) Agg(ini float64, fun AggFunc) float64
- func (tsr *Uint16) At(i, j int) float64
- func (tsr *Uint16) Clone() Tensor
- func (tsr *Uint16) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Uint16) CopyFrom(frm Tensor)
- func (tsr *Uint16) DataType() Type
- func (tsr *Uint16) Dims() (r, c int)
- func (tsr *Uint16) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Uint16) FloatVal(i []int) float64
- func (tsr *Uint16) FloatVal1D(off int) float64
- func (tsr *Uint16) Floats() []float64
- func (tsr *Uint16) FromArrow(arw *tensor.Uint16, cpy bool)
- func (tsr *Uint16) IsNull(i []int) bool
- func (tsr *Uint16) IsNull1D(i int) bool
- func (tsr *Uint16) Label() string
- func (tsr *Uint16) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Uint16) Set(i []int, val uint16)
- func (tsr *Uint16) SetFloat(i []int, val float64)
- func (tsr *Uint16) SetFloat1D(off int, val float64)
- func (tsr *Uint16) SetFloats(vals []float64)
- func (tsr *Uint16) SetFunc(fun EvalFunc)
- func (tsr *Uint16) SetNull(i []int, nul bool)
- func (tsr *Uint16) SetNull1D(i int, nul bool)
- func (tsr *Uint16) SetNumRows(rows int)
- func (tsr *Uint16) SetShape(shape, strides []int, names []string)
- func (tsr *Uint16) SetString(i []int, val string)
- func (tsr *Uint16) SetString1D(off int, val string)
- func (tsr *Uint16) SetZeros()
- func (tsr *Uint16) ShapeObj() *Shape
- func (tsr *Uint16) String() string
- func (tsr *Uint16) StringVal(i []int) string
- func (tsr *Uint16) StringVal1D(off int) string
- func (tsr *Uint16) SubSpace(subdim int, offs []int) Tensor
- func (tsr *Uint16) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *Uint16) T() mat.Matrix
- func (tsr *Uint16) ToArrow() *tensor.Uint16
- func (tsr *Uint16) Value(i []int) uint16
- func (tsr *Uint16) Value1D(i int) uint16
- type Uint32
- func (tsr *Uint32) AddRows(n int)
- func (tsr *Uint32) Agg(ini float64, fun AggFunc) float64
- func (tsr *Uint32) At(i, j int) float64
- func (tsr *Uint32) Clone() Tensor
- func (tsr *Uint32) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Uint32) CopyFrom(frm Tensor)
- func (tsr *Uint32) DataType() Type
- func (tsr *Uint32) Dims() (r, c int)
- func (tsr *Uint32) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Uint32) FloatVal(i []int) float64
- func (tsr *Uint32) FloatVal1D(off int) float64
- func (tsr *Uint32) Floats() []float64
- func (tsr *Uint32) FromArrow(arw *tensor.Uint32, cpy bool)
- func (tsr *Uint32) IsNull(i []int) bool
- func (tsr *Uint32) IsNull1D(i int) bool
- func (tsr *Uint32) Label() string
- func (tsr *Uint32) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Uint32) Set(i []int, val uint32)
- func (tsr *Uint32) SetFloat(i []int, val float64)
- func (tsr *Uint32) SetFloat1D(off int, val float64)
- func (tsr *Uint32) SetFloats(vals []float64)
- func (tsr *Uint32) SetFunc(fun EvalFunc)
- func (tsr *Uint32) SetNull(i []int, nul bool)
- func (tsr *Uint32) SetNull1D(i int, nul bool)
- func (tsr *Uint32) SetNumRows(rows int)
- func (tsr *Uint32) SetShape(shape, strides []int, names []string)
- func (tsr *Uint32) SetString(i []int, val string)
- func (tsr *Uint32) SetString1D(off int, val string)
- func (tsr *Uint32) SetZeros()
- func (tsr *Uint32) ShapeObj() *Shape
- func (tsr *Uint32) String() string
- func (tsr *Uint32) StringVal(i []int) string
- func (tsr *Uint32) StringVal1D(off int) string
- func (tsr *Uint32) SubSpace(subdim int, offs []int) Tensor
- func (tsr *Uint32) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *Uint32) T() mat.Matrix
- func (tsr *Uint32) ToArrow() *tensor.Uint32
- func (tsr *Uint32) Value(i []int) uint32
- func (tsr *Uint32) Value1D(i int) uint32
- type Uint64
- func (tsr *Uint64) AddRows(n int)
- func (tsr *Uint64) Agg(ini float64, fun AggFunc) float64
- func (tsr *Uint64) At(i, j int) float64
- func (tsr *Uint64) Clone() Tensor
- func (tsr *Uint64) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Uint64) CopyFrom(frm Tensor)
- func (tsr *Uint64) DataType() Type
- func (tsr *Uint64) Dims() (r, c int)
- func (tsr *Uint64) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Uint64) FloatVal(i []int) float64
- func (tsr *Uint64) FloatVal1D(off int) float64
- func (tsr *Uint64) Floats() []float64
- func (tsr *Uint64) FromArrow(arw *tensor.Uint64, cpy bool)
- func (tsr *Uint64) IsNull(i []int) bool
- func (tsr *Uint64) IsNull1D(i int) bool
- func (tsr *Uint64) Label() string
- func (tsr *Uint64) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Uint64) Set(i []int, val uint64)
- func (tsr *Uint64) SetFloat(i []int, val float64)
- func (tsr *Uint64) SetFloat1D(off int, val float64)
- func (tsr *Uint64) SetFloats(vals []float64)
- func (tsr *Uint64) SetFunc(fun EvalFunc)
- func (tsr *Uint64) SetNull(i []int, nul bool)
- func (tsr *Uint64) SetNull1D(i int, nul bool)
- func (tsr *Uint64) SetNumRows(rows int)
- func (tsr *Uint64) SetShape(shape, strides []int, names []string)
- func (tsr *Uint64) SetString(i []int, val string)
- func (tsr *Uint64) SetString1D(off int, val string)
- func (tsr *Uint64) SetZeros()
- func (tsr *Uint64) ShapeObj() *Shape
- func (tsr *Uint64) String() string
- func (tsr *Uint64) StringVal(i []int) string
- func (tsr *Uint64) StringVal1D(off int) string
- func (tsr *Uint64) SubSpace(subdim int, offs []int) Tensor
- func (tsr *Uint64) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *Uint64) T() mat.Matrix
- func (tsr *Uint64) ToArrow() *tensor.Uint64
- func (tsr *Uint64) Value(i []int) uint64
- func (tsr *Uint64) Value1D(i int) uint64
- type Uint8
- func (tsr *Uint8) AddRows(n int)
- func (tsr *Uint8) Agg(ini float64, fun AggFunc) float64
- func (tsr *Uint8) At(i, j int) float64
- func (tsr *Uint8) Clone() Tensor
- func (tsr *Uint8) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Uint8) CopyFrom(frm Tensor)
- func (tsr *Uint8) DataType() Type
- func (tsr *Uint8) Dims() (r, c int)
- func (tsr *Uint8) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Uint8) FloatVal(i []int) float64
- func (tsr *Uint8) FloatVal1D(off int) float64
- func (tsr *Uint8) Floats() []float64
- func (tsr *Uint8) FromArrow(arw *tensor.Uint8, cpy bool)
- func (tsr *Uint8) IsNull(i []int) bool
- func (tsr *Uint8) IsNull1D(i int) bool
- func (tsr *Uint8) Label() string
- func (tsr *Uint8) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Uint8) Set(i []int, val uint8)
- func (tsr *Uint8) SetFloat(i []int, val float64)
- func (tsr *Uint8) SetFloat1D(off int, val float64)
- func (tsr *Uint8) SetFloats(vals []float64)
- func (tsr *Uint8) SetFunc(fun EvalFunc)
- func (tsr *Uint8) SetNull(i []int, nul bool)
- func (tsr *Uint8) SetNull1D(i int, nul bool)
- func (tsr *Uint8) SetNumRows(rows int)
- func (tsr *Uint8) SetShape(shape, strides []int, names []string)
- func (tsr *Uint8) SetString(i []int, val string)
- func (tsr *Uint8) SetString1D(off int, val string)
- func (tsr *Uint8) SetZeros()
- func (tsr *Uint8) ShapeObj() *Shape
- func (tsr *Uint8) String() string
- func (tsr *Uint8) StringVal(i []int) string
- func (tsr *Uint8) StringVal1D(off int) string
- func (tsr *Uint8) SubSpace(subdim int, offs []int) Tensor
- func (tsr *Uint8) SubSpaceTry(subdim int, offs []int) (Tensor, error)
- func (tsr *Uint8) T() mat.Matrix
- func (tsr *Uint8) ToArrow() *tensor.Uint8
- func (tsr *Uint8) Value(i []int) uint8
- func (tsr *Uint8) Value1D(i int) uint8
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BoolToFloat64 ¶
func ColMajorStrides ¶
ColMajorStrides returns strides for shape where the first dimension is inner-most and subsequent dimensions are progressively outer
func CopyInts64 ¶
CopyInts64 makes a copy of an int64 slice to an int slice
func Float64ToBool ¶
func Float64ToString ¶
func Prjn2DSet ¶
Prjn2DSet sets a float64 value at given row, col coords for a 2D projection of the given tensor, collapsing higher dimensions down to 2D (and 1D up to 2D). For any odd number of dimensions, the remaining outer-most dimension can either be multipliexed across the row or column, given the oddRow arg. Even multiples of inner-most dimensions are assumed to be row, then column. RowMajor and ColMajor layouts are handled appropriately.
func Prjn2DShape ¶
Prjn2DShape returns the size of a 2D projection of the given tensor, collapsing higher dimensions down to 2D (and 1D up to 2D). For any odd number of dimensions, the remaining outer-most dimension can either be multipliexed across the row or column, given the oddRow arg. Even multiples of inner-most dimensions are assumed to be row, then column. RowMajor and ColMajor layouts are handled appropriately.
func Prjn2DVal ¶
Prjn2DVal returns the float64 value at given row, col coords for a 2D projection of the given tensor, collapsing higher dimensions down to 2D (and 1D up to 2D). For any odd number of dimensions, the remaining outer-most dimension can either be multipliexed across the row or column, given the oddRow arg. Even multiples of inner-most dimensions are assumed to be row, then column. RowMajor and ColMajor layouts are handled appropriately.
func RowMajorStrides ¶
RowMajorStrides returns strides for shape where the first dimension is outer-most and subsequent dimensions are progressively inner
func StringToFloat64 ¶
Types ¶
type AggFunc ¶
AggFunc is an aggregation function that incrementally updates agg value from each element in the tensor in turn -- returns new agg value that will be passed into next item as agg
type Bits ¶
etensor.Bits is a tensor of bits backed by a bitslice.Slice for efficient storage of binary data
func NewBits ¶
NewBits returns a new n-dimensional array of bits If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func NewBitsShape ¶
NewBitsShape returns a new n-dimensional array of bits If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func (*Bits) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Bits) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Not supported for Bits -- do not call!
func (*Bits) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Bits) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Bits) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Bits) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Not supported for Bits -- do not call!
func (*Bits) Eval ¶
Eval applies given function to each element in the tensor, using float64 conversions of the values, and puts the results into given float64 slice, which is ensured to be of the proper length
func (*Bits) FloatVal1D ¶
func (*Bits) SetFloat1D ¶
func (*Bits) SetFunc ¶
SetFunc applies given function to each element in the tensor, using float64 conversions of the values, and writes the results back into the same tensor values
func (*Bits) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Bits) SetString1D ¶
func (*Bits) SetZeros ¶
func (tsr *Bits) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Bits) StringVal1D ¶
func (*Bits) SubSpaceTry ¶
SubSpaceTry is not applicable to Bits tensor
type EvalFunc ¶
EvalFunc is an evaluation function that computes a function on each element value, returning the computed value
type Float32 ¶
Float32 is an n-dim array of float32s.
func NewFloat32 ¶
NewFloat32 returns a new n-dimensional array of float32s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewFloat32Shape ¶
NewFloat32Shape returns a new n-dimensional array of float32s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Float32) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Float32) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Float32) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Float32) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Float32) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Float32) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Float32) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Float32) FloatVal1D ¶
func (*Float32) Floats ¶
Floats returns a []float64 slice of all elements in the tensor. For Float64 tensor type, this directly returns its underlying Values which are writable as well -- for all others this is a new slice (read only). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Float32) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Float32) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Float32) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Float32) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Float32) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Float32) SetFloat1D ¶
func (*Float32) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Float32) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Float32) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Float32) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Float32) SetString1D ¶
func (*Float32) SetZeros ¶
func (tsr *Float32) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Float32) StringVal1D ¶
func (*Float32) SubSpace ¶
SubSpace returns a new tensor as a subspace of the current one, incorporating the given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for row or column major layouts.
- subdim are the inner, contiguous dimensions (i.e., the last in RowMajor and the first in ColMajor).
- offs are offsets for the outer dimensions (len = NDims - subdim) for the subspace to return.
The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two.
func (*Float32) SubSpaceTry ¶
SubSpaceTry is SubSpace but returns an error message if the subdim and offs do not match the tensor Shape.
func (*Float32) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Float64 ¶
Float64 is an n-dim array of float64s.
func NewFloat64 ¶
NewFloat64 returns a new n-dimensional array of float64s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewFloat64Shape ¶
NewFloat64Shape returns a new n-dimensional array of float64s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Float64) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Float64) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Float64) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Float64) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Float64) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Float64) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Float64) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Float64) FloatVal1D ¶
func (*Float64) Floats ¶
Floats returns a []float64 slice of all elements in the tensor. For Float64 tensor type, this directly returns its underlying Values which are writable as well -- for all others this is a new slice (read only). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Float64) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Float64) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Float64) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Float64) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Float64) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Float64) SetFloat1D ¶
func (*Float64) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Float64) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Float64) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Float64) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Float64) SetString1D ¶
func (*Float64) SetZeros ¶
func (tsr *Float64) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Float64) StringVal1D ¶
func (*Float64) SubSpace ¶
SubSpace returns a new tensor as a subspace of the current one, incorporating the given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for row or column major layouts.
- subdim are the inner, contiguous dimensions (i.e., the last in RowMajor and the first in ColMajor).
- offs are offsets for the outer dimensions (len = NDims - subdim) for the subspace to return.
The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two.
func (*Float64) SubSpaceTry ¶
SubSpaceTry is SubSpace but returns an error message if the subdim and offs do not match the tensor Shape.
func (*Float64) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Int16 ¶
Int16 is an n-dim array of int16s.
func NewInt16 ¶
NewInt16 returns a new n-dimensional array of int16s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewInt16Shape ¶
NewInt16Shape returns a new n-dimensional array of int16s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Int16) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Int16) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int16) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Int16) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Int16) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Int16) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int16) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Int16) FloatVal1D ¶
func (*Int16) Floats ¶
Floats returns a []float64 slice of all elements in the tensor. For Float64 tensor type, this directly returns its underlying Values which are writable as well -- for all others this is a new slice (read only). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Int16) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Int16) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Int16) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Int16) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Int16) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Int16) SetFloat1D ¶
func (*Int16) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Int16) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int16) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int16) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Int16) SetString1D ¶
func (*Int16) SetZeros ¶
func (tsr *Int16) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Int16) StringVal1D ¶
func (*Int16) SubSpace ¶
SubSpace returns a new tensor as a subspace of the current one, incorporating the given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for row or column major layouts.
- subdim are the inner, contiguous dimensions (i.e., the last in RowMajor and the first in ColMajor).
- offs are offsets for the outer dimensions (len = NDims - subdim) for the subspace to return.
The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two.
func (*Int16) SubSpaceTry ¶
SubSpaceTry is SubSpace but returns an error message if the subdim and offs do not match the tensor Shape.
func (*Int16) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Int32 ¶
Int32 is an n-dim array of int32s.
func NewInt32 ¶
NewInt32 returns a new n-dimensional array of int32s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewInt32Shape ¶
NewInt32Shape returns a new n-dimensional array of int32s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Int32) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Int32) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int32) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Int32) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Int32) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Int32) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int32) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Int32) FloatVal1D ¶
func (*Int32) Floats ¶
Floats returns a []float64 slice of all elements in the tensor. For Float64 tensor type, this directly returns its underlying Values which are writable as well -- for all others this is a new slice (read only). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Int32) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Int32) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Int32) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Int32) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Int32) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Int32) SetFloat1D ¶
func (*Int32) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Int32) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int32) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int32) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Int32) SetString1D ¶
func (*Int32) SetZeros ¶
func (tsr *Int32) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Int32) StringVal1D ¶
func (*Int32) SubSpace ¶
SubSpace returns a new tensor as a subspace of the current one, incorporating the given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for row or column major layouts.
- subdim are the inner, contiguous dimensions (i.e., the last in RowMajor and the first in ColMajor).
- offs are offsets for the outer dimensions (len = NDims - subdim) for the subspace to return.
The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two.
func (*Int32) SubSpaceTry ¶
SubSpaceTry is SubSpace but returns an error message if the subdim and offs do not match the tensor Shape.
func (*Int32) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Int64 ¶
Int64 is an n-dim array of int64s.
func NewInt64 ¶
NewInt64 returns a new n-dimensional array of int64s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewInt64Shape ¶
NewInt64Shape returns a new n-dimensional array of int64s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Int64) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Int64) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int64) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Int64) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Int64) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Int64) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int64) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Int64) FloatVal1D ¶
func (*Int64) Floats ¶
Floats returns a []float64 slice of all elements in the tensor. For Float64 tensor type, this directly returns its underlying Values which are writable as well -- for all others this is a new slice (read only). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Int64) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Int64) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Int64) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Int64) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Int64) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Int64) SetFloat1D ¶
func (*Int64) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Int64) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int64) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int64) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Int64) SetString1D ¶
func (*Int64) SetZeros ¶
func (tsr *Int64) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Int64) StringVal1D ¶
func (*Int64) SubSpace ¶
SubSpace returns a new tensor as a subspace of the current one, incorporating the given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for row or column major layouts.
- subdim are the inner, contiguous dimensions (i.e., the last in RowMajor and the first in ColMajor).
- offs are offsets for the outer dimensions (len = NDims - subdim) for the subspace to return.
The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two.
func (*Int64) SubSpaceTry ¶
SubSpaceTry is SubSpace but returns an error message if the subdim and offs do not match the tensor Shape.
func (*Int64) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Int8 ¶
Int8 is an n-dim array of int8s.
func NewInt8 ¶
NewInt8 returns a new n-dimensional array of int8s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewInt8Shape ¶
NewInt8Shape returns a new n-dimensional array of int8s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Int8) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Int8) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int8) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Int8) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Int8) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Int8) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int8) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Int8) FloatVal1D ¶
func (*Int8) Floats ¶
Floats returns a []float64 slice of all elements in the tensor. For Float64 tensor type, this directly returns its underlying Values which are writable as well -- for all others this is a new slice (read only). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Int8) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Int8) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Int8) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Int8) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Int8) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Int8) SetFloat1D ¶
func (*Int8) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Int8) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int8) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int8) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Int8) SetString1D ¶
func (*Int8) SetZeros ¶
func (tsr *Int8) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Int8) StringVal1D ¶
func (*Int8) SubSpace ¶
SubSpace returns a new tensor as a subspace of the current one, incorporating the given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for row or column major layouts.
- subdim are the inner, contiguous dimensions (i.e., the last in RowMajor and the first in ColMajor).
- offs are offsets for the outer dimensions (len = NDims - subdim) for the subspace to return.
The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two.
func (*Int8) SubSpaceTry ¶
SubSpaceTry is SubSpace but returns an error message if the subdim and offs do not match the tensor Shape.
func (*Int8) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Shape ¶
Shape manages a tensor's shape information, including strides and dimension names and can compute the flat index into an underlying 1D data storage array based on an n-dimensional index (and vice-versa). This is fully compatible with (and largely taken from) apache/arrow tensors. except that we use plain int instead of int64, because on all relevant platforms int is *already* 64 and using plain int is much easier. Per C / Go / Python conventions (and unlike emergent) by default indexes are ordered from outer to inner left-to-right, so the inner-most is right-most. This is called Row-Major order, and is the default. It is also possible to use Column-Major order, which is used in R, Julia, and MATLAB, and emergent, where the inner-most index is first and outer-most last. In either case, the internal memory is always organized with the inner-most dimension contiguous in memory -- thus there is no underlying difference between the different indexing systems in terms of underlying memory -- just in the order of indexes used to access this memory.
func AddShapes ¶
AddShapes returns a new shape by adding two shapes one after the other. uses Row / Col order of the first shape for resulting shape
func NewShape ¶
NewShape returns a new shape object initialized with params. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func (*Shape) CopyShape ¶
CopyShape copies the shape parameters from another Shape struct. copies the data so it is not accidentally subject to updates.
func (*Shape) DimNames ¶
DimNames returns slice of dimension names This is *not* a copy -- modifications will change the shape.
func (*Shape) Index ¶
Index returns the n-dimensional index from a "flat" 1D array index. Only works for RowMajor or ColMajor organization.
func (*Shape) IsColMajor ¶
IsColMajor returns true if shape is column-major organized: first dimension is column, i.e., inner-most storage dimension. Values *along a row* are contiguous, as you increment along the major inner-most (column) dimension. Importantly: ColMajor and RowMajor both have the *same* actual memory storage arrangement, with values along a row (across columns) contiguous in memory -- the only difference is in the order of the indexes used to access this memory.
func (*Shape) IsContiguous ¶
IsContiguous returns true if shape is either row or column major
func (*Shape) IsEqual ¶
IsEqual returns true if this shape is same as other (does not compare names)
func (*Shape) IsRowMajor ¶
IsRowMajor returns true if shape is row-major organized: first dimension is the row or outer-most storage dimension. Values *along a row* are contiguous, as you increment along the minor, inner-most (column) dimension. Importantly: ColMajor and RowMajor both have the *same* actual memory storage arrangement, with values along a row (across columns) contiguous in memory -- the only difference is in the order of the indexes used to access this memory.
func (*Shape) Len ¶
Len returns the total length of elements in the tensor (i.e., the product of the shape sizes)
func (*Shape) Offset ¶
Offset returns the "flat" 1D array index into an element at the given n-dimensional index No checking is done on the length or size of the index values relative to the shape of the tensor.
func (*Shape) RowCellSize ¶
RowCellSize returns the size of the outer-most Row shape dimension, and the size of all the remaining inner dimensions (the "cell" size) -- e.g., for Tensors that are columns in a data table. Only valid for RowMajor organization.
func (*Shape) SetShape ¶
SetShape sets the shape parameters. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func (*Shape) SetShape64 ¶
SetShape64 sets the shape parameters from int64 slices (e.g., arrow/tensor). If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func (*Shape) Shape64 ¶
Shape64 returns a slice of int64 containing the dimensions sizes. This is a copy -- modifications will not change shape.
func (*Shape) Shapes ¶
Shapes returns the slice of dimension sizes. This is *not* a copy -- modifications will change the shape.
func (*Shape) Strides ¶
Strides returns the slice of strides This is *not* a copy -- modifications will change the shape.
type String ¶
etensor.String is a tensor of strings backed by a []string slice
func NewString ¶
NewString returns a new n-dimensional array of strings If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func NewStringShape ¶
NewStringShape returns a new n-dimensional array of strings from given shape
func (*String) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*String) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Not supported for String -- do not call!
func (*String) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*String) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*String) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*String) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Not supported for String -- do not call!
func (*String) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*String) FloatVal1D ¶
func (*String) SetFloat1D ¶
func (*String) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*String) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*String) SetString1D ¶
func (*String) SetZeros ¶
func (tsr *String) SetZeros()
SetZeros is simple convenience function initialize all values to ""
func (*String) StringVal1D ¶
func (*String) SubSpace ¶
SubSpace returns a new tensor as a subspace of the current one, incorporating the given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for row or column major layouts.
- subdim are the inner, contiguous dimensions (i.e., the last in RowMajor and the first in ColMajor).
- offs are offsets for the outer dimensions (len = NDims - subdim) for the subspace to return.
The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two.
func (*String) SubSpaceTry ¶
SubSpaceTry is SubSpace but returns an error message if the subdim and offs do not match the tensor Shape.
func (*String) T ¶
T is the gonum/mat.Matrix transpose method. Not supported for String -- do not call!
type Tensor ¶
type Tensor interface { mat.Matrix // Len returns the number of elements in the tensor (product of shape dimensions). Len() int // DataType returns the type of data, using arrow.DataType (ID() is the arrow.Type enum value) DataType() Type // ShapeObj returns a pointer to the shape object that fully parameterizes the tensor shape ShapeObj() *Shape // Shapes returns the size in each dimension of the tensor. (Shape is the full Shape struct) Shapes() []int // Strides returns the number of elements to step in each dimension when traversing the tensor. Strides() []int // Shape64 returns the size in each dimension using int64 (arrow compatbile) Shape64() []int64 // Strides64 returns the strides in each dimension using int64 (arrow compatbile) Strides64() []int64 // NumDims returns the number of dimensions of the tensor. NumDims() int // Dim returns the size of the given dimension Dim(i int) int // DimNames returns the string slice of dimension names DimNames() []string // DimName returns the name of the i-th dimension. DimName(i int) string IsContiguous() bool // IsRowMajor returns true if shape is row-major organized: // first dimension is the row or outer-most storage dimension. // Values *along a row* are contiguous, as you increment along // the minor, inner-most (column) dimension. // Importantly: ColMajor and RowMajor both have the *same* // actual memory storage arrangement, with values along a row // (across columns) contiguous in memory -- the only difference // is in the order of the indexes used to access this memory. IsRowMajor() bool // IsColMajor returns true if shape is column-major organized: // first dimension is column, i.e., inner-most storage dimension. // Values *along a row* are contiguous, as you increment along // the major inner-most (column) dimension. // Importantly: ColMajor and RowMajor both have the *same* // actual memory storage arrangement, with values along a row // (across columns) contiguous in memory -- the only difference // is in the order of the indexes used to access this memory. IsColMajor() bool // RowCellSize returns the size of the outer-most Row shape dimension, // and the size of all the remaining inner dimensions (the "cell" size) // e.g., for Tensors that are columns in a data table. // Only valid for RowMajor organization. RowCellSize() (rows, cells int) // Offset returns the flat 1D array / slice index into an element // at the given n-dimensional index. // No checking is done on the length or size of the index values // relative to the shape of the tensor. Offset(i []int) int // IsNull returns true if the given index has been flagged as a Null // (undefined, not present) value IsNull(i []int) bool // IsNull1D returns true if the given 1-dimensional index has been flagged as a Null // (undefined, not present) value IsNull1D(i int) bool // SetNull sets whether given index has a null value or not. // All values are assumed valid (non-Null) until marked otherwise, and calling // this method creates a Null bitslice map if one has not already been set yet. SetNull(i []int, nul bool) // SetNull1D sets whether given 1-dimensional index has a null value or not. // All values are assumed valid (non-Null) until marked otherwise, and calling // this method creates a Null bitslice map if one has not already been set yet. SetNull1D(i int, nul bool) // FloatVal returns the value of given index as a float64 FloatVal(i []int) float64 // SetFloat sets the value of given index as a float64 SetFloat(i []int, val float64) // StringVal returns the value of given index as a string StringVal(i []int) string // SetString sets the value of given index as a string SetString(i []int, val string) // FloatVal1D returns the value of given 1-dimensional index (0-Len()-1) as a float64 FloatVal1D(i int) float64 // SetFloat1D sets the value of given 1-dimensional index (0-Len()-1) as a float64 SetFloat1D(i int, val float64) // Floats returns a []float64 slice of all elements in the tensor. // For Float64 tensor type, this directly returns its underlying Values // which are writable as well -- for all others this is a new slice (read only). // This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc. Floats() []float64 // SetFloats sets tensor values from a []float64 slice (copies values). SetFloats(vals []float64) // StringVal1D returns the value of given 1-dimensional index (0-Len()-1) as a string StringVal1D(i int) string // SetString1D sets the value of given 1-dimensional index (0-Len()-1) as a string SetString1D(i int, val string) // SubSpace returns a new tensor as a subspace of the current one, incorporating the // given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for // row or column major layouts. // * subdim are the inner, contiguous dimensions (i.e., the last in RowMajor // and the first in ColMajor). // * offs are offsets for the outer dimensions (len = NDims - subdim) // for the subspace to return. // The new tensor points to the values of the this tensor (i.e., modifications // will affect both), as its Values slice is a view onto the original (which // is why only inner-most contiguous supsaces are supported). // Use Clone() method to separate the two. SubSpace(subdim int, offs []int) Tensor // SubSpaceTry is SubSpace but returns an error message if the subdim and offs // do not match the tensor Shape. SubSpaceTry(subdim int, offs []int) (Tensor, error) // Range returns the min, max (and associated indexes, -1 = no values) for the tensor. // This is needed for display and is thus in the core api in optimized form // Other math operations can be done using gonum/floats package. Range() (min, max float64, minIdx, maxIdx int) // Agg applies given aggregation function to each element in the tensor // (automatically skips IsNull and NaN elements), using float64 conversions of the values. // init is the initial value for the agg variable. returns final aggregate value Agg(ini float64, fun AggFunc) float64 // Eval applies given function to each element in the tensor (automatically // skips IsNull and NaN elements), using float64 conversions of the values. // Puts the results into given float64 slice, which is ensured to be of the proper length. Eval(res *[]float64, fun EvalFunc) // SetFunc applies given function to each element in the tensor (automatically // skips IsNull and NaN elements), using float64 conversions of the values. // Writes the results back into the same tensor elements. SetFunc(fun EvalFunc) // SetZeros is simple convenience function initialize all values to 0 SetZeros() // Clone clones this tensor, creating a duplicate copy of itself with its // own separate memory representation of all the values, and returns // that as a Tensor (which can be converted into the known type as needed). Clone() Tensor // CopyFrom copies all avail values from other tensor into this tensor, with an // optimized implementation if the other tensor is of the same type, and // otherwise it goes through appropriate standard type. CopyFrom(from Tensor) // CopyCellsFrom copies given range of values from other tensor into this tensor, // using flat 1D indexes: to = starting index in this Tensor to start copying into, // start = starting index on from Tensor to start copying from, and n = number of // values to copy. Uses an optimized implementation if the other tensor is // of the same type, and otherwise it goes through appropriate standard type. CopyCellsFrom(from Tensor, to, start, n int) // SetShape sets the shape parameters of the tensor, and resizes backing storage appropriately. // existing RowMajor or ColMajor stride preference will be used if strides is nil, and // existing names will be preserved if nil SetShape(shape, strides []int, names []string) // AddRows adds n rows (outer-most dimension) to RowMajor organized tensor. // Does nothing for other stride layouts AddRows(n int) // SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor. // Does nothing for other stride layouts SetNumRows(rows int) }
Tensor is the general interface for n-dimensional tensors.
Tensor is automatically a gonum/mat.Matrix, implementing the Dims(), At(), and T() methods which automatically operate on the inner-most two dimensions, assuming default row-major layout. Error messages will be logged if applied to a Tensor with less than 2 dimensions, and care should be taken when using with > 2 dimensions (e.g., will only affect the first 2D subspace within a higher-dimensional space -- typically you'll want to call SubSpace to get a 2D subspace of the higher-dimensional Tensor (SubSpace is not part of interface as it returns the specific type, but is defined for all Tensor types).
type Type ¶
type Type int
Type is a logical type -- the subset supported by etable. This is copied directly from arrow.Type They can be expressed as either a primitive physical type (bytes or bits of some fixed size), a nested type consisting of other data types, or another data type (e.g. a timestamp encoded as an int64)
const ( // Null type having no physical storage NULL Type = Type(arrow.NULL) // Bool is a 1 bit, LSB bit-packed ordering BOOl Type = Type(arrow.BOOL) // UINT8 is an Unsigned 8-bit little-endian integer UINT8 Type = Type(arrow.UINT8) // INT8 is a Signed 8-bit little-endian integer INT8 Type = Type(arrow.INT8) // UINT16 is an Unsigned 16-bit little-endian integer UINT16 Type = Type(arrow.UINT16) // INT16 is a Signed 16-bit little-endian integer INT16 Type = Type(arrow.INT16) // UINT32 is an Unsigned 32-bit little-endian integer UINT32 Type = Type(arrow.UINT32) // INT32 is a Signed 32-bit little-endian integer INT32 Type = Type(arrow.INT32) // UINT64 is an Unsigned 64-bit little-endian integer UINT64 Type = Type(arrow.UINT64) // INT64 is a Signed 64-bit little-endian integer INT64 Type = Type(arrow.INT64) // FLOAT16 is a 2-byte floating point value FLOAT16 Type = Type(arrow.FLOAT16) // FLOAT32 is a 4-byte floating point value FLOAT32 Type = Type(arrow.FLOAT32) // FLOAT64 is an 8-byte floating point value FLOAT64 Type = Type(arrow.FLOAT64) // STRING is a UTF8 variable-length string STRING Type = Type(arrow.STRING) // COMPLEX64 is composed of 4 bytes for the real part and 4 for the imaginary parts COMPLEX64 Type = STRING + 1 // COMPLEX64 is composed of 4 bytes for the real part and 4 for the imaginary parts COMPLEX128 Type = COMPLEX64 + 1 TypeN = COMPLEX128 + 1 )
func (*Type) FromString ¶
func (Type) MarshalJSON ¶
func (*Type) UnmarshalJSON ¶
type Uint16 ¶
Uint16 is an n-dim array of uint16s.
func NewUint16 ¶
NewUint16 returns a new n-dimensional array of uint16s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewUint16Shape ¶
NewUint16Shape returns a new n-dimensional array of uint16s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Uint16) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Uint16) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint16) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Uint16) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Uint16) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Uint16) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint16) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Uint16) FloatVal1D ¶
func (*Uint16) Floats ¶
Floats returns a []float64 slice of all elements in the tensor. For Float64 tensor type, this directly returns its underlying Values which are writable as well -- for all others this is a new slice (read only). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Uint16) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Uint16) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Uint16) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Uint16) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Uint16) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Uint16) SetFloat1D ¶
func (*Uint16) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Uint16) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint16) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint16) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Uint16) SetString1D ¶
func (*Uint16) SetZeros ¶
func (tsr *Uint16) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Uint16) StringVal1D ¶
func (*Uint16) SubSpace ¶
SubSpace returns a new tensor as a subspace of the current one, incorporating the given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for row or column major layouts.
- subdim are the inner, contiguous dimensions (i.e., the last in RowMajor and the first in ColMajor).
- offs are offsets for the outer dimensions (len = NDims - subdim) for the subspace to return.
The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two.
func (*Uint16) SubSpaceTry ¶
SubSpaceTry is SubSpace but returns an error message if the subdim and offs do not match the tensor Shape.
func (*Uint16) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Uint32 ¶
Uint32 is an n-dim array of uint32s.
func NewUint32 ¶
NewUint32 returns a new n-dimensional array of uint32s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewUint32Shape ¶
NewUint32Shape returns a new n-dimensional array of uint32s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Uint32) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Uint32) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint32) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Uint32) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Uint32) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Uint32) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint32) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Uint32) FloatVal1D ¶
func (*Uint32) Floats ¶
Floats returns a []float64 slice of all elements in the tensor. For Float64 tensor type, this directly returns its underlying Values which are writable as well -- for all others this is a new slice (read only). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Uint32) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Uint32) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Uint32) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Uint32) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Uint32) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Uint32) SetFloat1D ¶
func (*Uint32) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Uint32) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint32) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint32) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Uint32) SetString1D ¶
func (*Uint32) SetZeros ¶
func (tsr *Uint32) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Uint32) StringVal1D ¶
func (*Uint32) SubSpace ¶
SubSpace returns a new tensor as a subspace of the current one, incorporating the given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for row or column major layouts.
- subdim are the inner, contiguous dimensions (i.e., the last in RowMajor and the first in ColMajor).
- offs are offsets for the outer dimensions (len = NDims - subdim) for the subspace to return.
The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two.
func (*Uint32) SubSpaceTry ¶
SubSpaceTry is SubSpace but returns an error message if the subdim and offs do not match the tensor Shape.
func (*Uint32) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Uint64 ¶
Uint64 is an n-dim array of uint64s.
func NewUint64 ¶
NewUint64 returns a new n-dimensional array of uint64s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewUint64Shape ¶
NewUint64Shape returns a new n-dimensional array of uint64s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Uint64) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Uint64) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint64) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Uint64) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Uint64) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Uint64) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint64) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Uint64) FloatVal1D ¶
func (*Uint64) Floats ¶
Floats returns a []float64 slice of all elements in the tensor. For Float64 tensor type, this directly returns its underlying Values which are writable as well -- for all others this is a new slice (read only). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Uint64) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Uint64) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Uint64) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Uint64) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Uint64) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Uint64) SetFloat1D ¶
func (*Uint64) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Uint64) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint64) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint64) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Uint64) SetString1D ¶
func (*Uint64) SetZeros ¶
func (tsr *Uint64) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Uint64) StringVal1D ¶
func (*Uint64) SubSpace ¶
SubSpace returns a new tensor as a subspace of the current one, incorporating the given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for row or column major layouts.
- subdim are the inner, contiguous dimensions (i.e., the last in RowMajor and the first in ColMajor).
- offs are offsets for the outer dimensions (len = NDims - subdim) for the subspace to return.
The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two.
func (*Uint64) SubSpaceTry ¶
SubSpaceTry is SubSpace but returns an error message if the subdim and offs do not match the tensor Shape.
func (*Uint64) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Uint8 ¶
Uint8 is an n-dim array of uint8s.
func NewUint8 ¶
NewUint8 returns a new n-dimensional array of uint8s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewUint8Shape ¶
NewUint8Shape returns a new n-dimensional array of uint8s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Uint8) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Uint8) At ¶
At(i, j) is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint8) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Uint8) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Uint8) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Uint8) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint8) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Uint8) FloatVal1D ¶
func (*Uint8) Floats ¶
Floats returns a []float64 slice of all elements in the tensor. For Float64 tensor type, this directly returns its underlying Values which are writable as well -- for all others this is a new slice (read only). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Uint8) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Uint8) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Uint8) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Uint8) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Uint8) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Uint8) SetFloat1D ¶
func (*Uint8) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Uint8) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint8) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint8) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Uint8) SetString1D ¶
func (*Uint8) SetZeros ¶
func (tsr *Uint8) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Uint8) StringVal1D ¶
func (*Uint8) SubSpace ¶
SubSpace returns a new tensor as a subspace of the current one, incorporating the given number of dimensions (0 < subdim < NumDims of this tensor). Only valid for row or column major layouts.
- subdim are the inner, contiguous dimensions (i.e., the last in RowMajor and the first in ColMajor).
- offs are offsets for the outer dimensions (len = NDims - subdim) for the subspace to return.
The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two.
func (*Uint8) SubSpaceTry ¶
SubSpaceTry is SubSpace but returns an error message if the subdim and offs do not match the tensor Shape.
func (*Uint8) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.