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

Function NewNumberShape

tensor/number.go:80–85  ·  view source on GitHub ↗

NewNumberShape returns a new n-dimensional tensor of numerical values using given shape.

(shape *Shape)

Source from the content-addressed store, hash-verified

78// NewNumberShape returns a new n-dimensional tensor of numerical values
79// using given shape.
80func NewNumberShape[T num.Number](shape *Shape) *Number[T] {
81 tsr := &Number[T]{}
82 tsr.Shp.CopyShape(shape)
83 tsr.Values = make([]T, tsr.Len())
84 return tsr
85}
86
87func (tsr *Number[T]) IsString() bool {
88 return false

Callers

nothing calls this directly

Calls 2

CopyShapeMethod · 0.80
LenMethod · 0.65

Tested by

no test coverage detected