Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
(flt *[]float64)
| 142 | // This can be used for all of the gonum/floats methods |
| 143 | // for basic math, gonum/stats, etc. |
| 144 | func (tsr *String) Floats(flt *[]float64) { |
| 145 | *flt = slicesx.SetLength(*flt, len(tsr.Values)) |
| 146 | for i, v := range tsr.Values { |
| 147 | (*flt)[i] = StringToFloat64(v) |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | // SetFloats sets tensor values from a []float64 slice (copies values). |
| 152 | func (tsr *String) SetFloats(flt []float64) { |
nothing calls this directly
no test coverage detected