mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-29 23:06:41 +00:00
Clean up ExecutionProvider in CSharp (#783)
This commit is contained in:
parent
fda1d0dce9
commit
cea2a40bf1
3 changed files with 5 additions and 25 deletions
|
|
@ -137,15 +137,15 @@ namespace Microsoft.ML.OnnxRuntime
|
|||
var inputTensors = new IntPtr[inputs.Count];
|
||||
var pinnedBufferHandles = new System.Buffers.MemoryHandle[inputs.Count];
|
||||
|
||||
int offset = 0;
|
||||
int inputIndex = 0;
|
||||
foreach (var input in inputs)
|
||||
{
|
||||
inputNames[offset] = input.Name;
|
||||
inputNames[inputIndex] = input.Name;
|
||||
|
||||
// create Tensor from the input if feasible, else throw notsupported exception for now
|
||||
input.ToNativeOnnxValue(out inputTensors[offset], out pinnedBufferHandles[offset]);
|
||||
input.ToNativeOnnxValue(out inputTensors[inputIndex], out pinnedBufferHandles[inputIndex]);
|
||||
|
||||
offset++;
|
||||
inputIndex++;
|
||||
}
|
||||
|
||||
string[] outputNamesArray = outputNames.ToArray();
|
||||
|
|
|
|||
|
|
@ -7,17 +7,6 @@ using System.Runtime.InteropServices;
|
|||
|
||||
namespace Microsoft.ML.OnnxRuntime
|
||||
{
|
||||
/// <summary>
|
||||
/// Various providers of ONNX operators
|
||||
/// </summary>
|
||||
public enum ExecutionProvider
|
||||
{
|
||||
Cpu,
|
||||
MklDnn,
|
||||
Cuda
|
||||
//TODO: add more providers gradually
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Holds the options for creating an InferenceSession
|
||||
/// </summary>
|
||||
|
|
@ -56,7 +45,7 @@ namespace Microsoft.ML.OnnxRuntime
|
|||
/// </param>
|
||||
public void EnableSequentialExecution()
|
||||
{
|
||||
NativeMethods.OrtEnableSequentialExecution(_nativePtr);
|
||||
NativeMethods.OrtEnableSequentialExecution(_nativePtr);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -117,15 +117,6 @@ Enable Sequential Execution. By default, it is enabled.
|
|||
DisableSequentialExecution();
|
||||
Disable Sequential Execution and enable Parallel Execution.
|
||||
|
||||
AppendExecutionProvider(ExecutionProvider provider);
|
||||
Appends execution provider to the session. For any operator in the graph the first execution provider that implements the operator will be user. ExecutionProvider is defined as the following enum.
|
||||
|
||||
enum ExecutionProvider
|
||||
{
|
||||
Cpu,
|
||||
MklDnn
|
||||
}
|
||||
|
||||
### NodeMetadata
|
||||
Container of metadata for a model graph node, used for communicating the shape and type of the input and output nodes.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue