Data returns the underlying data of the matrix, as a raw one-dimensional slice of values in row-major order.
(m Tensor)
| 232 | // Data returns the underlying data of the matrix, as a raw one-dimensional |
| 233 | // slice of values in row-major order. |
| 234 | func 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. |