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

Method SetNumRows

tensor/bits.go:107–113  ·  view source on GitHub ↗

SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.

(rows int)

Source from the content-addressed store, hash-verified

105
106// SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
107func (tsr *Bits) SetNumRows(rows int) {
108 rows = max(1, rows) // must be > 0
109 _, cells := tsr.Shp.RowCellSize()
110 nln := rows * cells
111 tsr.Shp.Sizes[0] = rows
112 tsr.Values.SetLen(nln)
113}
114
115// SubSpace is not possible with Bits
116func (tsr *Bits) SubSpace(offs []int) Tensor {

Callers

nothing calls this directly

Calls 2

SetLenMethod · 0.80
RowCellSizeMethod · 0.65

Tested by

no test coverage detected