Class NamedOnnxValue
Namespace: Microsoft.ML.OnnxRuntime
Assembly: Microsoft.ML.OnnxRuntime.dll
Syntax
public class NamedOnnxValue : object
Constructors
| Improve this Doc View SourceNamedOnnxValue(String, Object)
Constructs an instance of NamedOnnxValue and represents a model input to an inference session.
Declaration
protected NamedOnnxValue(string name, Object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | input/output name |
Object | value | Object that may be a tensor, Dictionary, IList |
Properties
| Improve this Doc View SourceName
Exposes the name of the of the model input/output
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | name string |
Value
Exposes the underlying managed object
Declaration
public Object Value { get; set; }
Property Value
Type | Description |
---|---|
Object | object |
ValueType
Onnx Value Type if known. In general, NamedOnnxValue is able to contain arbitrary objects. Please, follow the convention described in the class doc.
Declaration
public OnnxValueType ValueType { get; }
Property Value
Type | Description |
---|---|
OnnxValueType |
Methods
| Improve this Doc View SourceAsDictionary<K, V>()
Try-get value as an Dictionary<K,V>.
Declaration
public IDictionary<K, V> AsDictionary<K, V>()
Returns
Type | Description |
---|---|
IDictionary<, ><K, V> | Dictionary object if contained value is a Dictionary. Null otherwise |
Type Parameters
Name | Description |
---|---|
K | Key type currently primitive type only |
V | Value type, currently primitive type only |
AsEnumerable<T>()
Try-get value as an Enumerable<T>. T is usually a NamedOnnxValue instance that may contain Tensors, Sequences, Maps or optional types
Declaration
public IEnumerable<T> AsEnumerable<T>()
Returns
Type | Description |
---|---|
IEnumerable<><T> | Enumerable object if contained value is a Enumerable. Null otherwise |
Type Parameters
Name | Description |
---|---|
T | Type |
AsTensor<T>()
Try-get value as a Tensor<T>.
Declaration
public Tensor<T> AsTensor<T>()
Returns
Type | Description |
---|---|
Tensor<T> | Tensor object if contained value is a Tensor. Null otherwise |
Type Parameters
Name | Description |
---|---|
T | Type |
CreateFromMap<K, V>(String, IDictionary<K, V>)
Declaration
public static NamedOnnxValue CreateFromMap<K, V>(string name, IDictionary<K, V> value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
IDictionary<, ><K, V> | value |
Returns
Type | Description |
---|---|
NamedOnnxValue |
Type Parameters
Name | Description |
---|---|
K | |
V |
CreateFromSequence<T>(String, IEnumerable<T>)
This is a factory method that instantiates NamedOnnxValue. It would contain a sequence of elements
Declaration
public static NamedOnnxValue CreateFromSequence<T>(string name, IEnumerable<T> value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
IEnumerable<><T> | value |
Returns
Type | Description |
---|---|
NamedOnnxValue |
Type Parameters
Name | Description |
---|---|
T |
CreateFromTensor<T>(String, Tensor<T>)
This is a factory method that instantiates NamedOnnxValue
and associated name with an instance of a TensorT
Declaration
public static NamedOnnxValue CreateFromTensor<T>(string name, Tensor<T> value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | name |
Tensor<T> | value | Tensor |
Returns
Type | Description |
---|---|
NamedOnnxValue |
Type Parameters
Name | Description |
---|---|
T |