MCPcopy
hub / github.com/nlpodyssey/spago / Data

Function Data

mat/matrix.go:234–239  ·  view source on GitHub ↗

Data returns the underlying data of the matrix, as a raw one-dimensional slice of values in row-major order.

(m Tensor)

Source from the content-addressed store, hash-verified

232// Data returns the underlying data of the matrix, as a raw one-dimensional
233// slice of values in row-major order.
234func Data[T float.DType](m Tensor) []T {
235 if d, ok := m.(*Dense[T]); ok {
236 return d.data
237 }
238 return float.SliceValueOf[T](m.Data())
239}
240
241// SetData sets the content of the matrix, copying the given raw
242// data representation as one-dimensional slice.

Callers

nothing calls this directly

Calls 1

DataMethod · 0.65

Tested by

no test coverage detected