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

Function AddShapes

tensor/shape.go:234–244  ·  view source on GitHub ↗

AddShapes returns a new shape by adding two shapes one after the other.

(shape1, shape2 *Shape)

Source from the content-addressed store, hash-verified

232
233// AddShapes returns a new shape by adding two shapes one after the other.
234func AddShapes(shape1, shape2 *Shape) *Shape {
235 sh1 := shape1.Sizes
236 sh2 := shape2.Sizes
237 nsh := make([]int, len(sh1)+len(sh2))
238 copy(nsh, sh1)
239 copy(nsh[len(sh1):], sh2)
240 nms := make([]string, len(sh1)+len(sh2))
241 copy(nms, shape1.Names)
242 copy(nms[len(sh1):], shape2.Names)
243 return NewShape(nsh, nms...)
244}

Callers

nothing calls this directly

Calls 1

NewShapeFunction · 0.85

Tested by

no test coverage detected