MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / reshape_heads

Function reshape_heads

src/models/ace_step/condition_encoder.cpp:55–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55core::TensorValue reshape_heads(
56 core::ModuleBuildContext & ctx,
57 const core::TensorValue & input,
58 int64_t heads,
59 int64_t dim) {
60 auto contiguous = ensure_contiguous(ctx, input);
61 return core::reshape_tensor(
62 ctx,
63 contiguous,
64 core::TensorShape::from_dims({input.shape.dims[0], input.shape.dims[1], heads, dim}));
65}
66
67core::TensorValue repeat_kv_heads(core::ModuleBuildContext & ctx, const core::TensorValue & input, int64_t repeats) {
68 if (repeats == 1) {

Callers 1

encoder_layerFunction · 0.70

Calls 2

reshape_tensorFunction · 0.85
ensure_contiguousFunction · 0.70

Tested by

no test coverage detected