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

Function ensure_backend_addressable_layout

src/framework/core/module.cpp:199–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199TensorValue ensure_backend_addressable_layout(ModuleBuildContext & ctx, const TensorValue & value) {
200 if (!value.valid()) {
201 throw std::runtime_error("Cannot materialize an invalid tensor");
202 }
203 if (ctx.ggml == nullptr) {
204 throw std::runtime_error("ModuleBuildContext.ggml is null");
205 }
206 if (has_backend_addressable_layout(value.tensor)) {
207 return value;
208 }
209 return wrap_tensor(ggml_cont(ctx.ggml, value.tensor), value.shape, value.type);
210}
211
212void validate_shape(const TensorValue & value, const TensorShape & expected, const char * name) {
213 if (!value.valid()) {

Callers 15

buildMethod · 0.85
ensure_contiguousFunction · 0.85
build_unaryFunction · 0.85
buildMethod · 0.85
buildMethod · 0.85
contiguousFunction · 0.85
buildMethod · 0.85
contiguousFunction · 0.85
contiguousFunction · 0.85
ensure_contiguous_layoutFunction · 0.85

Calls 4

wrap_tensorFunction · 0.85
ggml_contFunction · 0.85
validMethod · 0.80

Tested by

no test coverage detected