public DataTensor Predict(
DataTensor inputs
)
Supports the following tensor data types: - Float32 (System.Single) - Int32 (System.Int32) - Bool (System.Boolean converted to byte) 支持以下张量数据类型: - Float32 (System.Single) - Int32 (System.Int32) - Bool (System.Boolean转为byte)
Handles dynamic output shapes automatically when configured 在配置时自动处理动态输出形状
Typical inference workflow: 1. Validate inputs 2. Convert input tensors to ONNX Runtime format 3. Execute session.Run() 4. Process and convert outputs 典型的推理工作流程: 1. 验证输入 2. 将输入张量转换为ONNX Runtime格式 3. 执行session.Run() 4. 处理和转换输出
ArgumentNullException | Thrown when input tensor is null or empty 当输入张量为null或空时抛出 |
InvalidOperationException | Thrown when: - Model is not loaded - Input shape/type mismatch - Output processing fails 以下情况抛出: - 模型未加载 - 输入形状/类型不匹配 - 输出处理失败 |
NotSupportedException | Thrown for unsupported tensor data types 当遇到不支持的张量数据类型时抛出 |