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

Function reshape_heads

src/models/ace_step/text_encoder.cpp:70–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70core::TensorValue reshape_heads(
71 core::ModuleBuildContext & ctx,
72 const core::TensorValue & input,
73 int64_t heads,
74 int64_t dim) {
75 auto contiguous = ensure_contiguous(ctx, input);
76 return core::reshape_tensor(
77 ctx,
78 contiguous,
79 core::TensorShape::from_dims({input.shape.dims[0], input.shape.dims[1], heads, dim}));
80}
81
82core::TensorValue repeat_kv_heads(core::ModuleBuildContext & ctx, const core::TensorValue & input, int64_t repeats) {
83 if (repeats == 1) {

Callers 1

decoder_layerFunction · 0.70

Calls 2

reshape_tensorFunction · 0.85
ensure_contiguousFunction · 0.70

Tested by

no test coverage detected