TensorPrimitives.ConvertToHalf Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Copies source
to destination
, converting each Single
value to its nearest representable half-precision floating-point value.
public:
static void ConvertToHalf(ReadOnlySpan<float> source, Span<Half> destination);
public static void ConvertToHalf (ReadOnlySpan<float> source, Span<Half> destination);
static member ConvertToHalf : ReadOnlySpan<single> * Span<Half> -> unit
Public Shared Sub ConvertToHalf (source As ReadOnlySpan(Of Single), destination As Span(Of Half))
Parameters
- source
- ReadOnlySpan<Single>
The source span from which to copy values.
Exceptions
Destination is too short.
Remarks
This method effectively computes
.destination
[i] = (Half)source
[i]
source
and destination
must not overlap. If they do, behavior is undefined.
Applies to
Συνεργαστείτε μαζί μας στο GitHub
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.