Share via


TensorPrimitives.ConvertToSingle Method

Definition

Copies source to destination, converting each half-precision floating-point value to its nearest representable Single value.

public:
 static void ConvertToSingle(ReadOnlySpan<Half> source, Span<float> destination);
public static void ConvertToSingle (ReadOnlySpan<Half> source, Span<float> destination);
static member ConvertToSingle : ReadOnlySpan<Half> * Span<single> -> unit
Public Shared Sub ConvertToSingle (source As ReadOnlySpan(Of Half), destination As Span(Of Single))

Parameters

source
ReadOnlySpan<Half>

The source span from which to copy values.

destination
Span<Single>

The destination span into which the converted values should be written.

Exceptions

Destination is too short.

Remarks

This method effectively computes destination[i] = (float)source[i].

source and destination must not overlap. If they do, behavior is undefined.

Applies to