Documentation ¶
Overview ¶
Package with host counterparts for the GPU package.
Index ¶
- Constants
- func Array2D(size0, size1 int) ([]float64, [][]float64)
- func Array3D(size0, size1, size2 int) ([]float64, [][][]float64)
- func Array4D(size0, size1, size2, size3 int) ([]float64, [][][][]float64)
- func Array5D(size0, size1, size2, size3, size4 int) ([]float64, [][][][][]float64)
- func ListFloat32ToFloat64(in []float32) (out []float64)
- func ListFloat64ToFloat32(in []float64) (out []float32)
- func Slice2D(list []float64, size []int) [][]float64
- func Slice3D(list []float64, size []int) [][][]float64
- func Slice4D(list []float64, size []int) [][][][]float64
- type Array
- func (a *Array) Component(component int) *Array
- func (t *Array) Init(components int, size3D []int)
- func (t *Array) InitFromList(components int, size3D []int, l []float64)
- func (a *Array) Len() int
- func (a *Array) NComp() int
- func (a *Array) Pin()
- func (a *Array) Rank() int
- func (tens *Array) WriteAscii(out io.Writer)
- func (t *Array) WriteBinary(out io.Writer)
Constants ¶
View Source
const (
T_MAGIC = 0x0A317423 // First 32-bit word of tensor blob. Identifies the format. Little-endian ASCII for "#t1\n"
)
Variables ¶
This section is empty.
Functions ¶
func ListFloat32ToFloat64 ¶
func ListFloat64ToFloat32 ¶
Types ¶
type Array ¶
type Array struct { List []float64 // Underlying contiguous storage Array [][][][]float64 // Array in the usual way Comp [][]float64 // Components as contiguous lists Size [4]int // INTERNAL {components, size0, size1, size2} Size4D []int // {components, size0, size1, size2} Size3D []int // {size0, size1, size2} SizeInElements int64 // The total number of elements in the array SizeInBytes int64 // The total size of the array in bytes sync.RWMutex // mutex for safe concurrent access to this array // contains filtered or unexported fields }
A MuMax Array represents a 3-dimensional array of N-vectors.
func NewArrayFromList ¶
Allocates an returns a new Array
func NewArrayPinned ¶
func (*Array) InitFromList ¶
Initializes a pre-allocated Array struct
func (*Array) WriteAscii ¶
func (*Array) WriteBinary ¶
Click to show internal directories.
Click to hide internal directories.