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

Method Tensor

tensor/table/table.go:526–538  ·  view source on GitHub ↗

Tensor returns the tensor SubSpace for given column (by name), row index for columns that have higher-dimensional tensors so each row is represented by an n-1 dimensional tensor, with the outer dimension being the row number. Returns nil on any error -- see Try version for error returns.

(column string, row int)

Source from the content-addressed store, hash-verified

524// being the row number. Returns nil on any error -- see Try version for
525// error returns.
526func (dt *Table) Tensor(column string, row int) tensor.Tensor {
527 if !dt.IsValidRow(row) {
528 return nil
529 }
530 ct := dt.ColumnByName(column)
531 if ct == nil {
532 return nil
533 }
534 if ct.NumDims() == 1 {
535 return nil
536 }
537 return ct.SubSpace([]int{row})
538}
539
540// TensorFloat1D returns the float value of a Tensor cell's cell at given
541// 1D offset within cell, for given column (by name), row index

Callers

nothing calls this directly

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 4

IsValidRowMethod · 0.95
ColumnByNameMethod · 0.95
NumDimsMethod · 0.65
SubSpaceMethod · 0.65

Tested by

no test coverage detected