Compartilhar via


TensorPrimitives.ConvertSaturating<TFrom,TTo> Método

Definição

Copia source para destination, convertendo cada valor TFrom em um valor TTo.

public:
generic <typename TFrom, typename TTo>
 where TFrom : System::Numerics::INumberBase<TFrom> where TTo : System::Numerics::INumberBase<TTo> static void ConvertSaturating(ReadOnlySpan<TFrom> source, Span<TTo> destination);
public static void ConvertSaturating<TFrom,TTo> (ReadOnlySpan<TFrom> source, Span<TTo> destination) where TFrom : System.Numerics.INumberBase<TFrom> where TTo : System.Numerics.INumberBase<TTo>;
static member ConvertSaturating : ReadOnlySpan<'From (requires 'From :> System.Numerics.INumberBase<'From>)> * Span<'o (requires 'o :> System.Numerics.INumberBase<'o>)> -> unit (requires 'From :> System.Numerics.INumberBase<'From> and 'o :> System.Numerics.INumberBase<'o>)
Public Shared Sub ConvertSaturating(Of TFrom As INumberBase(Of TFrom), TTo As INumberBase(Of TFrom)) (source As ReadOnlySpan(Of TFrom), destination As Span(Of TTo))

Parâmetros de tipo

TFrom
TTo

Parâmetros

source
ReadOnlySpan<TFrom>

O intervalo de origem do qual copiar valores.

destination
Span<TTo>

O intervalo de destino no qual os valores convertidos devem ser gravados.

Exceções

O destino é muito curto.

Comentários

Esse método computa efetivamente destination[i] = TTo.CreateSaturating(source[i]).

Aplica-se a