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

Function build_norm

src/framework/modules/norm_modules.cpp:128–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126 "Applies precomputed 2D batch-normalization eval scale and bias to [batch, channels, height, width] tensors.",
127};
128
129core::TensorValue ensure_f32(
130 core::ModuleBuildContext & ctx,
131 const core::TensorValue & value) {
132 if (value.type == GGML_TYPE_F32) {
133 return value;
134 }
135 return core::wrap_tensor(ggml_cast(ctx.ggml, value.tensor, GGML_TYPE_F32), value.shape, GGML_TYPE_F32);
136}
137
138bool same_shape(const core::TensorShape & lhs, const core::TensorShape & rhs) {
139 if (lhs.rank != rhs.rank) {
140 return false;
141 }
142 for (size_t i = 0; i < lhs.rank; ++i) {
143 if (lhs.dims[i] != rhs.dims[i]) {
144 return false;
145 }

Callers 1

buildMethod · 0.85

Calls 5

validate_rank_betweenFunction · 0.85
validate_last_dimFunction · 0.85
wrap_tensorFunction · 0.85
apply_affineFunction · 0.85

Tested by

no test coverage detected