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

Function NewBits

tensor/bits.go:29–34  ·  view source on GitHub ↗

NewBits returns a new n-dimensional tensor of bit values with the given sizes per dimension (shape), and optional dimension names.

(sizes []int, names ...string)

Source from the content-addressed store, hash-verified

27// NewBits returns a new n-dimensional tensor of bit values
28// with the given sizes per dimension (shape), and optional dimension names.
29func NewBits(sizes []int, names ...string) *Bits {
30 tsr := &Bits{}
31 tsr.SetShape(sizes, names...)
32 tsr.Values = bitslice.Make(tsr.Len(), 0)
33 return tsr
34}
35
36// NewBitsShape returns a new n-dimensional tensor of bit values
37// using given shape.

Callers 2

NewFunction · 0.85
NewOfTypeFunction · 0.85

Calls 3

SetShapeMethod · 0.95
LenMethod · 0.95
MakeFunction · 0.92

Tested by

no test coverage detected