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

Method SetTensor

tensor/tensorcore/tensorgrid.go:208–218  ·  view source on GitHub ↗

SetTensor sets the tensor. Must call Update after this.

(tsr tensor.Tensor)

Source from the content-addressed store, hash-verified

206
207// SetTensor sets the tensor. Must call Update after this.
208func (tg *TensorGrid) SetTensor(tsr tensor.Tensor) *TensorGrid {
209 if _, ok := tsr.(*tensor.String); ok {
210 log.Printf("TensorGrid: String tensors cannot be displayed using TensorGrid\n")
211 return tg
212 }
213 tg.Tensor = tsr
214 if tg.Tensor != nil {
215 tg.Display.FromMeta(tg.Tensor)
216 }
217 return tg
218}
219
220// OpenTensorView pulls up a TensorView of our tensor
221func (tg *TensorGrid) OpenTensorView() {

Callers 1

SetWidgetValueMethod · 0.95

Calls 2

FromMetaMethod · 0.80
PrintfMethod · 0.45

Tested by

no test coverage detected