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

Class Tensor4

src/framework/audio/zipenhancer.cpp:129–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129struct Tensor4 {
130 int64_t b = 0;
131 int64_t c = 0;
132 int64_t t = 0;
133 int64_t f = 0;
134 std::vector<float> v;
135
136 Tensor4() = default;
137 Tensor4(int64_t batch, int64_t channels, int64_t frames, int64_t freq)
138 : b(batch), c(channels), t(frames), f(freq), v(static_cast<size_t>(batch * channels * frames * freq), 0.0f) {}
139
140 float & at(int64_t bi, int64_t ci, int64_t ti, int64_t fi) {
141 return v[static_cast<size_t>((((bi * c) + ci) * t + ti) * f + fi)];
142 }
143
144 float at(int64_t bi, int64_t ci, int64_t ti, int64_t fi) const {
145 return v[static_cast<size_t>((((bi * c) + ci) * t + ti) * f + fi)];
146 }
147};
148
149modules::Conv2dWeights graph_conv2d_weights(const Param & weight, const Param & bias) {
150 modules::Conv2dWeights out;

Callers 1

runMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected