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

Function classify_global

src/framework/assets/torch_bin.cpp:133–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131 int64_t storage_offset = 0; // Tensor start inside its storage, in elements
132 int64_t numel = 0; // Storage/Tensor element count
133};
134
135GlobalKind classify_global(const std::string & module, const std::string & name) {
136 if (module == "collections" && name == "OrderedDict") {
137 return GlobalKind::OrderedDict;
138 }
139 if (module == "torch._utils" && name == "_rebuild_tensor_v2") {
140 return GlobalKind::RebuildTensor;
141 }
142 if (module == "torch" && name == "FloatStorage") {
143 return GlobalKind::StorageF32;
144 }
145 if (module == "torch" && name == "HalfStorage") {
146 return GlobalKind::StorageF16;
147 }
148 if (module == "torch" && name == "BFloat16Storage") {
149 return GlobalKind::StorageBF16;
150 }
151 throw std::runtime_error("torch .bin pickle references an unsupported global: " + module + "." + name);
152}
153

Callers 2

op_globalMethod · 0.85
op_stack_globalMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected