Edit

Share via


TensorMarshal.GetReference Method

Definition

Overloads

GetReference<T>(ReadOnlyTensorSpan<T>)

Returns a reference to the element of the readonly tensor span at index 0.

GetReference<T>(TensorSpan<T>)

Returns a reference to the element of the tensor span at index 0.

GetReference<T>(ReadOnlyTensorSpan<T>)

Source:
TensorMarshal.cs

Returns a reference to the element of the readonly tensor span at index 0.

public:
generic <typename T>
 static T& ^ GetReference(System::Numerics::Tensors::ReadOnlyTensorSpan<T> % tensorSpan);
public static ref readonly T GetReference<T>(in System.Numerics.Tensors.ReadOnlyTensorSpan<T> tensorSpan);
static member GetReference : ReadOnlyTensorSpan -> 'T
Public Shared Function GetReference(Of T) (ByRef tensorSpan As ReadOnlyTensorSpan(Of T)) As T

Type Parameters

T

The type of items in the readonly tensor span.

Parameters

tensorSpan
ReadOnlyTensorSpan<T>

The readonly tensor span from which the reference is retrieved.

Returns

T

A readonly reference to the element at index 0.

Remarks

If the readonly tensor span is empty, this method returns a reference to the ___location where the element at index 0 would have been stored. Such a reference may or may not be null. The returned reference can be used for pinning, but it must never be dereferenced.

Applies to

GetReference<T>(TensorSpan<T>)

Source:
TensorMarshal.cs

Returns a reference to the element of the tensor span at index 0.

public:
generic <typename T>
 static T % GetReference(System::Numerics::Tensors::TensorSpan<T> % tensorSpan);
public static ref T GetReference<T>(in System.Numerics.Tensors.TensorSpan<T> tensorSpan);
static member GetReference : TensorSpan -> 'T
Public Shared Function GetReference(Of T) (ByRef tensorSpan As TensorSpan(Of T)) As T

Type Parameters

T

The type of items in the tensor span.

Parameters

tensorSpan
TensorSpan<T>

The tensor span from which the reference is retrieved.

Returns

T

A reference to the element at index 0.

Remarks

If the tensor span is empty, this method returns a reference to the ___location where the element at index 0 would have been stored. Such a reference may or may not be null. The returned reference can be used for pinning, but it must never be dereferenced.

Applies to