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

Method RowCellSize

tensor/shape.go:122–130  ·  view source on GitHub ↗

RowCellSize returns the size of the outer-most Row shape dimension, and the size of all the remaining inner dimensions (the "cell" size). Used for Tensors that are columns in a data table.

()

Source from the content-addressed store, hash-verified

120// and the size of all the remaining inner dimensions (the "cell" size).
121// Used for Tensors that are columns in a data table.
122func (sh *Shape) RowCellSize() (rows, cells int) {
123 rows = sh.Sizes[0]
124 if len(sh.Sizes) == 1 {
125 cells = 1
126 } else {
127 cells = sh.Len() / rows
128 }
129 return
130}
131
132// Offset returns the "flat" 1D array index into an element at the given n-dimensional index.
133// No checking is done on the length or size of the index values relative to the shape of the tensor.

Callers

nothing calls this directly

Calls 1

LenMethod · 0.95

Tested by

no test coverage detected