载入中...
搜索中...
未找到
OnnxModel.cpp
浏览该文件的文档.
17 return Result<std::unique_ptr<OnnxModel>>::success(std::unique_ptr<OnnxModel>(new OnnxModel(std::move(impl))));
31Result<OnnxGpuResult> OnnxModel::runGpu(std::span<const OnnxNamedTensor> feeds, OnnxCompute& compute,
43 Result<OnnxBuffer> enqueue(const std::string& source, std::span<const OnnxBuffer> inputs, size_t bytes,
57 return Result<OnnxGpuResult>::success({std::move(r.value()), counter.count, compute.transferStats()});
59Result<std::vector<OnnxNamedTensor>> OnnxModel::runInternal(std::span<const OnnxNamedTensor> feeds,
67 requested.empty() ? model.info.outputs : std::vector<std::string>(requested.begin(), requested.end());
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
GPU execution boundary for native ONNX; retains no model and retains compiled resources for the lifet...
Definition OnnxCompute.h:25
virtual void endRun() noexcept
Retire temporary activations/recordings; compiled resources may survive for later calls.
Definition OnnxCompute.h:71
Native ONNX import and CPU/GPU execution using tensor kernels, without ONNX Runtime.
Definition OnnxModel.h:63
Result< std::vector< OnnxNamedTensor > > run(std::span< const OnnxNamedTensor > feeds, std::span< const std::string > requested={}, OnnxRunOptions options={}) const
Execute selected named values, or graph outputs when requested is empty.
Definition OnnxModel.cpp:26
Result< OnnxGpuResult > runGpu(std::span< const OnnxNamedTensor > feeds, OnnxCompute &compute, std::span< const std::string > requested={}, OnnxRunOptions options={}) const
Execute with GPU matrix, convolution, normalization, activation and resampling kernels.
Definition OnnxModel.cpp:31
OnnxModelInfo info() const
Return owning graph diagnostics; importing does not imply full operator support.
Definition OnnxModel.cpp:12
static Result< std::unique_ptr< OnnxModel > > load(std::span< const uint8_t > bytes)
Import bounded in-memory ONNX ModelProto; copies all retained data.
Definition OnnxModel.cpp:13
~OnnxModel()
Destroy model-owned graph and packed initializers; outputs remain valid.
Definition AffineQuant.cpp:9
@ Failed
Definition Container.h:602
Synchronous GPU kernel request; all inputs are borrowed only until dispatch returns.
Definition OnnxCompute.h:12
Owning admission report; unsupported nodes remain inspectable but cannot execute.
Definition OnnxModel.h:48
Definition OnnxModel.cpp:7
Per-call deterministic RNG and optional strict finite-output diagnostic.
Definition OnnxModel.h:37