首页 > 解决方案 > 在 Onnxruntime 中替换 TorchScript Struct IValue

问题描述

将我的 pytorch 模型转换为 onnx 后,我需要使用 onnxruntime 实现模型。在 torch::jit 源代码中有一个初始化为 IValue 的变量,我想用在 onnxruntime 中具有相同功能的结构替换它。有人熟悉 torchscript 和 onnxruntime 吗?代码如下:

torch::jit::IValue subsampling_cache_;
subsampling_cache_ = std::move(torch::jit::IValue());

标签: onnxruntimetorchscript

解决方案


推荐阅读