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

Function AddTensorColumn

tensor/table/table.go:170–177  ·  view source on GitHub ↗

AddTensorColumn adds a new n-dimensional column to the table, of given type, column name (which must be unique), and dimensionality of each _cell_. An outer-most Row dimension will be added to this dimensionality to create the tensor column.

(dt *Table, name string, cellSizes []int, dimNames ...string)

Source from the content-addressed store, hash-verified

168// An outer-most Row dimension will be added to this dimensionality to create
169// the tensor column.
170func AddTensorColumn[T string | bool | float32 | float64 | int | int32 | byte](dt *Table, name string, cellSizes []int, dimNames ...string) tensor.Tensor {
171 rows := max(1, dt.Rows)
172 sz := append([]int{rows}, cellSizes...)
173 nms := append([]string{"Row"}, dimNames...)
174 tsr := tensor.New[T](sz, nms...)
175 dt.AddColumn(tsr, name)
176 return tsr
177}
178
179// AddColumn adds the given tensor as a column to the table,
180// returning an error and not adding if the name is not unique.

Callers

nothing calls this directly

Calls 1

AddColumnMethod · 0.80

Tested by

no test coverage detected