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

Class Tensor4

src/framework/audio/deepfilternet2.cpp:402–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402struct Tensor4 {
403 int64_t b = 0;
404 int64_t c = 0;
405 int64_t t = 0;
406 int64_t f = 0;
407 std::vector<float> v;
408
409 Tensor4() = default;
410 Tensor4(int64_t batch, int64_t channels, int64_t frames, int64_t bins)
411 : b(batch), c(channels), t(frames), f(bins), v(static_cast<size_t>(batch * channels * frames * bins), 0.0f) {}
412
413 float & at(int64_t bi, int64_t ci, int64_t ti, int64_t fi) {
414 return v[static_cast<size_t>((((bi * c + ci) * t + ti) * f) + fi)];
415 }
416
417 float at(int64_t bi, int64_t ci, int64_t ti, int64_t fi) const {
418 return v[static_cast<size_t>((((bi * c + ci) * t + ti) * f) + fi)];
419 }
420};
421
422Tensor4 tensor4_from_values(
423 const std::vector<float> & values,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected