Clean up ExecutionProvider in CSharp (#783)

This commit is contained in:
Yufeng Li 2019-04-05 22:29:54 -07:00 committed by GitHub
parent fda1d0dce9
commit cea2a40bf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 25 deletions

View file

@ -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();

View file

@ -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>

View file

@ -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.