MCPcopy Create free account
hub / github.com/cogentcore/core / Floats

Method Floats

tensor/bits.go:158–164  ·  view source on GitHub ↗
(flt *[]float64)

Source from the content-addressed store, hash-verified

156}
157
158func (tsr *Bits) Floats(flt *[]float64) {
159 sz := tsr.Len()
160 *flt = slicesx.SetLength(*flt, sz)
161 for j := 0; j < sz; j++ {
162 (*flt)[j] = BoolToFloat64(tsr.Values.Index(j))
163 }
164}
165
166// SetFloats sets tensor values from a []float64 slice (copies values).
167func (tsr *Bits) SetFloats(vals []float64) {

Callers

nothing calls this directly

Calls 4

LenMethod · 0.95
SetLengthFunction · 0.92
BoolToFloat64Function · 0.85
IndexMethod · 0.45

Tested by

no test coverage detected