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

Method CopyShape

tensor/shape.go:50–54  ·  view source on GitHub ↗

CopyShape copies the shape parameters from another Shape struct. copies the data so it is not accidentally subject to updates.

(cp *Shape)

Source from the content-addressed store, hash-verified

48// CopyShape copies the shape parameters from another Shape struct.
49// copies the data so it is not accidentally subject to updates.
50func (sh *Shape) CopyShape(cp *Shape) {
51 sh.Sizes = slices.Clone(cp.Sizes)
52 sh.Strides = slices.Clone(cp.Strides)
53 sh.Names = slices.Clone(cp.Names)
54}
55
56// Len returns the total length of elements in the tensor
57// (i.e., the product of the shape sizes)

Callers 3

NewBitsShapeFunction · 0.80
NewNumberShapeFunction · 0.80
NewStringShapeFunction · 0.80

Calls 1

CloneMethod · 0.65

Tested by

no test coverage detected