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

Method SetFloats

tensor/bits.go:167–172  ·  view source on GitHub ↗

SetFloats sets tensor values from a []float64 slice (copies values).

(vals []float64)

Source from the content-addressed store, hash-verified

165
166// SetFloats sets tensor values from a []float64 slice (copies values).
167func (tsr *Bits) SetFloats(vals []float64) {
168 sz := min(tsr.Len(), len(vals))
169 for j := 0; j < sz; j++ {
170 tsr.Values.Set(j, Float64ToBool(vals[j]))
171 }
172}
173
174func (tsr *Bits) String1D(off int) string {
175 return reflectx.ToString(tsr.Values.Index(off))

Callers

nothing calls this directly

Calls 3

LenMethod · 0.95
Float64ToBoolFunction · 0.85
SetMethod · 0.65

Tested by

no test coverage detected