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

Method build

src/framework/modules/streaming_conv_modules.cpp:125–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 config_.dilation,
124 config_.use_bias,
125 }).build(ctx, input_4d, {weight_4d, weights.bias});
126 return core::reshape_tensor(
127 ctx,
128 output_4d,
129 core::TensorShape::from_dims({
130 input.shape.dims[0],
131 config_.channels,
132 depthwise_conv1d_output_frames(config_, input.shape.dims[2]),
133 }));
134}
135
136PointwiseConv1dModule::PointwiseConv1dModule(PointwiseConv1dConfig config) : config_(config) {}
137
138core::TensorValue PointwiseConv1dModule::build(
139 core::ModuleBuildContext & ctx,
140 const core::TensorValue & input,
141 const PointwiseConv1dWeights & weights) const {
142 if (config_.quant) {
143 core::validate_rank_between(input, 3, 3, "input");
144 core::validate_shape(
145 input,
146 core::TensorShape::from_dims({input.shape.dims[0], config_.in_channels, input.shape.dims[2]}),
147 "input");
148 core::TensorValue weight = weights.weight;
149 if (weight.shape.rank == 3) {
150 core::validate_shape(
151 weight,
152 core::TensorShape::from_dims({config_.out_channels, config_.in_channels, 1}),
153 "weight");
154 weight = core::reshape_tensor(
155 ctx,
156 weight,
157 core::TensorShape::from_dims({config_.out_channels, config_.in_channels}));
158 } else {
159 core::validate_shape(
160 weight,
161 core::TensorShape::from_dims({config_.out_channels, config_.in_channels}),
162 "weight");
163 }
164 auto x = TransposeModule({{0, 2, 1, 3}, 3}).build(ctx, input);
165 x = LinearModule({config_.in_channels, config_.out_channels, config_.use_bias}).build(ctx, x, {weight, weights.bias});
166 return TransposeModule({{0, 2, 1, 3}, 3}).build(ctx, x);

Callers 3

zeros_like_prefixFunction · 0.45
repeat_first_frameFunction · 0.45

Calls 15

validate_rank_betweenFunction · 0.85
validate_shapeFunction · 0.85
reshape_tensorFunction · 0.85
add_bias_bctFunction · 0.85
Conv1dModuleClass · 0.85
repeat_first_frameFunction · 0.85
ConcatModuleClass · 0.85
SliceModuleClass · 0.85

Tested by

no test coverage detected