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

Function shape_from_dims

src/framework/assets/tensor_source.cpp:19–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#include <limits>
18#include <mutex>
19#include <numeric>
20#include <set>
21#include <sstream>
22#include <stdexcept>
23#include <unordered_map>
24#include <unordered_set>
25
26namespace engine::assets {
27namespace {
28
29constexpr int64_t kParallelF32ConvertElements = 1ll << 20;
30constexpr int64_t kF32ConvertChunkElements = 1ll << 16;
31// Quantization chunks are whole ROWS, so this is a budget rounded down to a row
32// count rather than an exact split. A row of a large tensor is a few thousand
33// elements, which puts a chunk in the same size range as the conversions above.
34constexpr int64_t kQuantizeChunkElements = 1ll << 20;
35
36bool tensor_type_override_matches(std::string_view name, std::string_view pattern) {
37 if (pattern.empty()) {
38 return false;

Callers 7

set_backend_tensorMethod · 0.85
require_f32Method · 0.85
require_f32_tensorMethod · 0.85
require_tensorMethod · 0.85
load_tensorMethod · 0.85
load_f32_tensorMethod · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected