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

Method TensorIndex

tensor/table/table.go:510–519  ·  view source on GitHub ↗

TensorIndex returns the tensor SubSpace for given column, 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 if column is a 1-dimensional tensor or there is any error from the

(column, row int)

Source from the content-addressed store, hash-verified

508// being the row number. Returns nil if column is a 1-dimensional
509// tensor or there is any error from the tensor.Tensor.SubSpace call.
510func (dt *Table) TensorIndex(column, row int) tensor.Tensor {
511 if !dt.IsValidRow(row) {
512 return nil
513 }
514 ct := dt.Columns[column]
515 if ct.NumDims() == 1 {
516 return nil
517 }
518 return ct.SubSpace([]int{row})
519}
520
521// Tensor returns the tensor SubSpace for given column (by name), row index
522// for columns that have higher-dimensional tensors so each row is

Callers 1

MakeRowMethod · 0.80

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 3

IsValidRowMethod · 0.95
NumDimsMethod · 0.65
SubSpaceMethod · 0.65

Tested by

no test coverage detected