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

Method require_f32

src/framework/assets/torch_bin.cpp:536–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534}
535
536class TorchBinTensorSource final : public TensorSource {
537public:
538 explicit TorchBinTensorSource(std::filesystem::path path)
539 : path_(std::move(path)), bytes_(read_file(path_)) {
540 const auto entries = read_zip_entries(bytes_);
541 std::string prefix;
542 const ZipEntry * pickle = nullptr;
543 for (const auto & [name, entry] : entries) {
544 if (name == "data.pkl" || (name.size() >= 9 && name.compare(name.size() - 9, 9, "/data.pkl") == 0)) {
545 prefix = name.substr(0, name.size() - std::string("data.pkl").size()); // keeps trailing '/'
546 pickle = &entry;
547 break;
548 }
549 }
550 if (pickle == nullptr) {

Callers

nothing calls this directly

Calls 4

decode_f32Function · 0.85
shape_elementsFunction · 0.85
stringFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected