Show / Hide Table of Contents

# Class NamedOnnxValue

##### Inheritance

System.Object
NamedOnnxValue
DisposableNamedOnnxValue

##### Inherited Members

System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()

###### Namespace: Microsoft.ML.OnnxRuntime

###### Assembly: cs.temp.dll.dll

##### Syntax

    public class NamedOnnxValue

### Constructors

#### NamedOnnxValue(String, Object)

Constructs an instance of NamedOnnxValue and represents a model input to an inference session. It also represents a modle output when serves as a base for DisposablenamedOnnxvalue

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

### Fields

#### _name

Name of the instance, model input/output

##### Declaration

    protected string _name

##### Field Value

Type | Description
--- | ---
System.String |

#### _value

Managed Tensor, Dictionary or IList

##### Declaration

    protected Object _value

##### Field Value

Type | Description
--- | ---
Object |

### Properties

#### Name

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

### Methods

#### AsDictionary<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
V | Value type

#### AsEnumerable<T>()

Try-get value as an Enumerable<T>.

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

#### CreateFromTensor<T>(String, Tensor<T>)

This is a factory method that instantiates NamedOnnxValue and associated name with an instance of a Tensor`T`

##### Declaration

    public static NamedOnnxValue CreateFromTensor<T>(string name, Tensor<T> value)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | name
Tensor<T> | value | Tensor`T`

##### Returns

Type | Description
--- | ---
NamedOnnxValue |

##### Type Parameters

Name | Description
--- | ---
T |