| 400 | } |
| 401 | |
| 402 | struct 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 | |
| 422 | Tensor4 tensor4_from_values( |
| 423 | const std::vector<float> & values, |
no outgoing calls
no test coverage detected