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

Function NewStringShape

tensor/string.go:34–39  ·  view source on GitHub ↗

NewStringShape returns a new n-dimensional tensor of string values using given shape.

(shape *Shape)

Source from the content-addressed store, hash-verified

32// NewStringShape returns a new n-dimensional tensor of string values
33// using given shape.
34func NewStringShape(shape *Shape) *String {
35 tsr := &String{}
36 tsr.Shp.CopyShape(shape)
37 tsr.Values = make([]string, tsr.Len())
38 return tsr
39}
40
41// StringToFloat64 converts string value to float64 using strconv,
42// returning 0 if any error

Callers 1

CloneMethod · 0.85

Calls 2

CopyShapeMethod · 0.80
LenMethod · 0.65

Tested by

no test coverage detected