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

Method UpdateRange

tensor/tensorcore/tensorgrid.go:291–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

289}
290
291func (tg *TensorGrid) UpdateRange() {
292 if !tg.Display.Range.FixMin || !tg.Display.Range.FixMax {
293 min, max, _, _ := tg.Tensor.Range()
294 if !tg.Display.Range.FixMin {
295 nmin := minmax.NiceRoundNumber(min, true) // true = below #
296 tg.Display.Range.Min = nmin
297 }
298 if !tg.Display.Range.FixMax {
299 nmax := minmax.NiceRoundNumber(max, false) // false = above #
300 tg.Display.Range.Max = nmax
301 }
302 }
303}
304
305func (tg *TensorGrid) Render() {
306 if tg.Tensor == nil || tg.Tensor.Len() == 0 {

Callers 2

RenderMethod · 0.95
RenderMethod · 0.45

Calls 2

NiceRoundNumberFunction · 0.92
RangeMethod · 0.65

Tested by

no test coverage detected