From b24b41678f392dca42432395feb650dc686865d0 Mon Sep 17 00:00:00 2001
From: Jon Bratseth Arithmetics
There are several expressions that allow you to convert from one data type to another.
-These are often used within a for_each
to convert
-e.g. an array of strings to an array of integers.
These expressions lets you convert from one data type to another.
Description | -|||
---|---|---|---|
embed |
- String | -A tensor of the type of the receiving field | -Invokes an embedder to convert a text to a point in a tensor space.
- Arguments are given space separated, as in |
-
hash |
- String | -Any string | -Converts the input to a hash value (using SipHash). + |
binarize [threshold] |
+ Any tensor | +Any tensor | +
+ + Replaces all values in a tensor by 0 or 1. + This takes an optional argument specifying the threshold a value needs to be larger than to be + replaced by 1 instead of 0. The default threshold is 0. + This is useful to create a suitable input to pack_bits. + + |
+
embed [id] |
+ String | +A tensor | +Invokes an embedder to convert a text to one or more vector embeddings.
+ The type of the output tensor is what is required by the following expression (as supported by the specific embedder).
+ Arguments are given space separated, as in |
+
hash |
+ String | +int or long | +Converts the input to a hash value (using SipHash). The hash will be int or long depending on the target field. |
+
pack_bits |
+ A tensor | +A tensor | +
+ + Packs the values of a binary tensor into bytes with 1 bit per value in big-endian order. + ++ The input tensor must: +
+ The output tensor will have: +
|
to_array |
@@ -541,9 +582,9 @@ random [ <max> ] |
- Returns a random integer value. - Lowest value is 0 and the highest value is determined either by the argument or, - if no argument is given, the execution value. + Returns a random integer value. + Lowest value is 0 and the highest value is determined either by the argument or, + if no argument is given, the execution value. |