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

Function load_weight_norm_conv1d

src/models/heartmula/codec.cpp:100–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 }
99 }
100 return out;
101}
102
103modules::Conv1dWeights load_weight_norm_conv1d(
104 core::BackendWeightStore & store,
105 const assets::TensorSource & source,
106 const std::string & prefix,
107 assets::TensorStorageType storage_type,
108 int64_t out_channels,
109 int64_t in_channels,
110 int64_t kernel_size,
111 bool use_bias = true) {
112 modules::Conv1dWeights weights;
113 const auto shape = core::TensorShape::from_dims({out_channels, in_channels, kernel_size});
114 weights.weight = store.make_from_f32(
115 shape,
116 storage_type,
117 effective_weight_norm_dim0(source, prefix, {out_channels, in_channels, kernel_size}));
118 if (use_bias) {
119 weights.bias = store.load_f32_tensor(source, prefix + ".bias", {out_channels});
120 }
121 return weights;
122}

Callers 2

load_residual_unitFunction · 0.70

Calls 3

make_from_f32Method · 0.80
load_f32_tensorMethod · 0.80

Tested by

no test coverage detected