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

Method compute

src/framework/runtime/host_ops.cpp:46–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44} // namespace
45
46FloatHostTensor PCMInput::compute(const std::vector<int16_t> & input, int64_t batch, int64_t samples) const {
47 if (static_cast<int64_t>(input.size()) != checked_product({batch, samples})) {
48 throw std::runtime_error("PCMInput input size mismatch");
49 }
50
51 FloatHostTensor result;
52 result.shape = {batch, samples};
53 result.values.resize(input.size());
54 for (size_t i = 0; i < input.size(); ++i) {
55 result.values[i] = static_cast<float>(input[i]) / 32768.0f;
56 }
57 return result;
58}
59
60FloatHostTensor Resample::compute(
61 const std::vector<float> & input,

Callers

nothing calls this directly

Calls 12

maxFunction · 0.85
stable_softmax_pickFunction · 0.85
SamplerClass · 0.85
copyFunction · 0.85
minFunction · 0.85
assignMethod · 0.80
checked_productFunction · 0.70
sizeMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected