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

Function NewString

tensor/string.go:25–30  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

23// NewString returns a new n-dimensional tensor of string values
24// with the given sizes per dimension (shape), and optional dimension names.
25func NewString(sizes []int, names ...string) *String {
26 tsr := &String{}
27 tsr.SetShape(sizes, names...)
28 tsr.Values = make([]string, tsr.Len())
29 return tsr
30}
31
32// NewStringShape returns a new n-dimensional tensor of string values
33// using given shape.

Callers 2

NewFunction · 0.85
NewOfTypeFunction · 0.85

Calls 2

SetShapeMethod · 0.65
LenMethod · 0.65

Tested by

no test coverage detected