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

Function timestep_embedding

src/models/heartmula/codec.cpp:732–744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730};
731
732AdaNormParts adaptive_block_parts(
733 core::ModuleBuildContext & ctx,
734 const core::TensorValue & timestep_mod,
735 const core::TensorValue & scale_shift_table,
736 int64_t tokens,
737 int64_t hidden_size) {
738 const int64_t batch = timestep_mod.shape.dims[0];
739 auto scale_shift = core::reshape_tensor(ctx, scale_shift_table, core::TensorShape::from_dims({1, 6, hidden_size}));
740 scale_shift = modules::RepeatModule({core::TensorShape::from_dims({batch, 6, hidden_size})}).build(ctx, scale_shift);
741 auto parts = modules::AddModule{}.build(
742 ctx,
743 core::reshape_tensor(
744 ctx,
745 core::ensure_backend_addressable_layout(ctx, timestep_mod),
746 core::TensorShape::from_dims({batch, 6, hidden_size})),
747 scale_shift);

Callers 1

adaln_embeddingFunction · 0.70

Calls 9

reshape_tensorFunction · 0.85
RepeatModuleClass · 0.85
wrap_tensorFunction · 0.85
ggml_cosFunction · 0.85
ggml_sinFunction · 0.85
ConcatModuleClass · 0.85
scaleFunction · 0.70
buildMethod · 0.45

Tested by

no test coverage detected