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

Function open_tensor_source

src/framework/assets/tensor_source.cpp:702–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700 if (index_.header_bytes > total || byte_size > total - index_.header_bytes ||
701 info.data_begin > total - index_.header_bytes - byte_size) {
702 throw std::runtime_error("tensor data range is out of bounds: " + info.name);
703 }
704 const size_t data_offset = index_.header_bytes + info.data_begin;
705 return {bytes_.data() + static_cast<std::ptrdiff_t>(data_offset), byte_size};
706 }
707
708 void discard_data_range(const engine::io::SafeTensorInfo & info) const noexcept {
709 bytes_.discard_range(index_.header_bytes + info.data_begin, info.data_end - info.data_begin);
710 }

Callers 15

load_from_safetensorsMethod · 0.85
load_from_safetensorsMethod · 0.85
load_from_safetensorsMethod · 0.85
load_from_safetensorsMethod · 0.85
load_typed_weightsFunction · 0.85
open_tensor_sourceMethod · 0.85
load_from_directoryMethod · 0.85
load_from_safetensorsMethod · 0.85
load_from_directoryMethod · 0.85
load_from_directoryMethod · 0.85
load_ace_step_assetsFunction · 0.85

Calls

no outgoing calls

Tested by 4

run_caseFunction · 0.68
run_waveform_caseFunction · 0.68
run_caseFunction · 0.68
run_caseFunction · 0.68