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

Function NewBitsShape

tensor/bits.go:38–43  ·  view source on GitHub ↗

NewBitsShape returns a new n-dimensional tensor of bit values using given shape.

(shape *Shape)

Source from the content-addressed store, hash-verified

36// NewBitsShape returns a new n-dimensional tensor of bit values
37// using given shape.
38func NewBitsShape(shape *Shape) *Bits {
39 tsr := &Bits{}
40 tsr.Shp.CopyShape(shape)
41 tsr.Values = bitslice.Make(tsr.Len(), 0)
42 return tsr
43}
44
45func Float64ToBool(val float64) bool {
46 bv := true

Callers 1

CloneMethod · 0.85

Calls 3

LenMethod · 0.95
MakeFunction · 0.92
CopyShapeMethod · 0.80

Tested by

no test coverage detected