AI: docs fix

This commit is contained in:
mcDandy
2026-10-17 23:26:45 +02:00
parent ade47c8d76
commit 9fda2c1caa
6 changed files with 805 additions and 744 deletions
+6 -6
View File
@@ -191,9 +191,9 @@ You can also get the node from comfy manager under the name of More math.
- `norm(x, [p], [dims])`: p-norm globally or along one or more dimensions; `p` defaults to `2`.
- `normalize(x, [p], [dim], [eps])`: normalize each vector along `dim` (default `-1`); defaults to L2 and clamps the divisor to `eps` (`1e-12`). List input returns a nested list; tensor input returns a tensor.
- `cossim(a, b)` / `cosine_similarity`: cosine similarity.
- `cov(x, y)`: covariance.
- `cov(x, y)`: sample covariance of the flattened inputs.
- `corr(x, y)` / `correlation`: Pearson correlation.
- `entropy(x)`: Shannon entropy.
- `entropy(x)`: Shannon entropy of `softmax(x)` (`x` is treated as logits).
- `flip(x, dims)`: flip selected dimensions; `dims` can be a single dimension, list, or tensor of dimensions, so multiple axes can be flipped at once.
- `swap(tensor, dim, i1, i2)`: swap two indices along dimension `dim`.
@@ -232,8 +232,8 @@ You can also get the node from comfy manager under the name of More math.
- `where(cond, a, b)`: tensor broadcasting for tensor inputs; recursive truthy selection for lists/scalars.
- `histogram(x, bins, min, max)` / `hist`: histogram counts from `flatten()` in the given interval
- `gather(tensor, dim, indices)`: gather values along `dim` using `indices`
- `scatter(tensor, dim, indices)`: scatter values along `dim` using `indices`
- `scatter_add(tensor, dim, indices)`: scatter-add values along `dim` using `indices`
- `scatter(tensor, dim, indices, src)`: scatter values from `src` along `dim` using `indices`
- `scatter_add(tensor, dim, indices, src)`: scatter-add values from `src` along `dim` using `indices`
- `nonzero(x)`: returns coordinate indices for non-zero elements.
- `one_hot(indices, classes)`: converts integer class indices into float32 one-hot vectors; indices must be in `0..classes-1`.
@@ -271,7 +271,7 @@ You can also get the node from comfy manager under the name of More math.
- `solve(A, b)`: solve the square linear system `A*x = b`; prefer this to computing `inv(A) @ b`.
- `matrix_rank(x, [tol])`: numerical rank of each matrix; optional `tol` is the absolute singular-value tolerance.
- `inv(x, [pseudo])`: matrix inverse; `pseudo` defaults to false. A singular or non-square matrix raises an error in ordinary mode. Set `pseudo` to a truthy value (for example, `1`) to compute the Moore–Penrose pseudoinverse, which also supports singular and rectangular matrices.
- `pinv(x)`: permutation inverse for permutation-like values; this is not the matrix pseudoinverse.
- `pinv(x)`: inverse permutation (`result[x[i]] = i`); this is not the matrix pseudoinverse, use `inv(x, 1)` for that.
- `singular_value_decomposition(x,[full_matrices])`/`svd`: singular value decomposition.
- `diagonal_matrix(x,shape,[offset],[dim1],[dim2])` / `diag`: create a diagonal matrix from a vector. The diagonal can be offset from the main diagonal using the `offset` parameter. The `dim1` and `dim2` parameters specify which dimensions to use for the diagonal.
#### 2.6 Mapping / Sampling
@@ -279,7 +279,7 @@ You can also get the node from comfy manager under the name of More math.
- supports up to `3` coordinate inputs,
- uses sampling coordinates derived from the provided coordinate tensors or functions,
- intended for spatial remapping / resampling.
- `get_value(tensor, position)`: read value at an N-D position using flat offset math. Superseeded by tensor[position] indexing.
- `get_value(tensor, position)`: read value at an N-D position using flat offset math. Superseded by tensor[position] indexing.
#### 2.7 Losses / Image Metrics
- `mse(a, b, [reduction])`: mean squared error; reduction is `mean` (default), `sum`, or `none` (`none` returns element-wise values).
+53 -53
View File
@@ -138,51 +138,51 @@ func0:
// Single-argument functions
func1:
/**
sin(x) - applies sinus function to value or each element of value
sin(x) - applies sine function to value or each element of value
*/
SIN LPAREN expr RPAREN # SinFunc
/**
cos(x) - applies cosinus function to value or each element of value
cos(x) - applies cosine function to value or each element of value
*/
| COS LPAREN expr RPAREN # CosFunc
/**
tan(x) - applies tangents function to value or each element of value
tan(x) - applies tangent function to value or each element of value
*/
| TAN LPAREN expr RPAREN # TanFunc
/**
asin(x) - applies arcus sinus function to value or each element of value
asin(x) - applies arcus sine function to value or each element of value
*/
| ASIN LPAREN expr RPAREN # AsinFunc
/**
acos(x) - applies arcus cosinus function to value or each element of value
acos(x) - applies arcus cosine function to value or each element of value
*/
| ACOS LPAREN expr RPAREN # AcosFunc
/**
atan(x) - applies arcus tangents function to value or each element of value
atan(x) - applies arcus tangent function to value or each element of value
*/
| ATAN LPAREN expr RPAREN # AtanFunc
/**
sinh(x) - applies hyperbolic sinus function to value or each element of value
sinh(x) - applies hyperbolic sine function to value or each element of value
*/
| SINH LPAREN expr RPAREN # SinhFunc
/**
cosh(x) - applies hyperbolic cosinus function to value or each element of value
cosh(x) - applies hyperbolic cosine function to value or each element of value
*/
| COSH LPAREN expr RPAREN # CoshFunc
/**
tanh(x) - applies hyperbolic tangents function to value or each element of value
tanh(x) - applies hyperbolic tangent function to value or each element of value
*/
| TANH LPAREN expr RPAREN # TanhFunc
/**
asinh(x) - applies hyperbolic arcus sinus function to value or each element of value
asinh(x) - applies hyperbolic arcus sine function to value or each element of value
*/
| ASINH LPAREN expr RPAREN # AsinhFunc
/**
acosh(x) - applies hyperbolic arcus cosinus function to value or each element of value
acosh(x) - applies hyperbolic arcus cosine function to value or each element of value
*/
| ACOSH LPAREN expr RPAREN # AcoshFunc
/**
atanh(x) - applies hyperbolic arcus tangents function to value or each element of value
atanh(x) - applies hyperbolic arcus tangent function to value or each element of value
*/
| ATANH LPAREN expr RPAREN # AtanhFunc
/**
@@ -190,7 +190,7 @@ func1:
*/
| ABS LPAREN expr RPAREN # AbsFunc
/**
sqrt(x) - applies sqere root per element. Negative numbers return NaN (not a number)
sqrt(x) - applies square root per element. Negative numbers return NaN (not a number)
*/
| SQRT LPAREN expr RPAREN # SqrtFunc
/**
@@ -318,7 +318,7 @@ func1:
*/
| PRINT_SHAPE LPAREN expr RPAREN # PrintShapeFunc
/**
pinv(x) - computes the permutative inverse of a list x (list must have uniqe elements) -- TODO: CHECK --
pinv(x) - computes the inverse permutation of x: where x[i] == j the result has result[j] == i. Not the matrix pseudoinverse; use inv(x, 1) for that
*/
| PINV LPAREN expr RPAREN # PinvFunc
/**
@@ -350,7 +350,7 @@ func1:
*/
| PROD LPAREN expr (COMMA expr)? RPAREN # ProdFunc
/**
sort(x, [desc], [dim]) - returns a sorted version of x (If input is tensor, it sorts the last dimension)
sort(x, [descending], [dim]) - returns x sorted ascending, or descending when descending is truthy. Tensors are sorted along dim (default: last dimension); lists use Python sorting
*/
| SORT LPAREN expr (COMMA expr (COMMA expr)?)? RPAREN # SortFunc
/**
@@ -362,7 +362,7 @@ func1:
*/
| ALL LPAREN expr RPAREN # AllFunc
/**
edge(x, [matrix_size]) - detects edges in x. Matrix size denotes the size of edge detection matrix.
edge(x, [kernel_size]) - detects edges in x with a Sobel filter. kernel_size must be odd and at least 3 (default 3).
*/
| EDGE LPAREN expr (COMMA expr)? RPAREN # EdgeFunc
/**
@@ -422,7 +422,7 @@ func1:
*/
| GET LPAREN expr RPAREN # GetFunc
/**
argsort(x, [desc], [dim]) - returns the indices that would sort x. desc defaults to ascending and dim defaults to the last dimension.
argsort(x, [descending], [dim]) - returns the indices that would sort x. descending defaults to false and dim defaults to the last dimension.
*/
| ARGSORT LPAREN expr (COMMA expr (COMMA expr)?)? RPAREN # ArgsortFunc
/**
@@ -434,11 +434,11 @@ func1:
*/
| ARGMAX LPAREN expr (COMMA expr (COMMA expr)?)? RPAREN # ArgmaxFunc
/**
softmax(x, [axis]) - applies the softmax function to x (sum of slice == 1.0 and max value <= 1.0). axis defaults to last.
softmax(x, [dim]) - applies the softmax function to x (each slice sums to 1.0). dim defaults to the last dimension.
*/
| SOFTMAX LPAREN expr (COMMA expr)? RPAREN # SoftmaxFunc
/**
softmin(x, [axis]) - applies the softmin function to x (same as softmax(-x,[axis])). axis defaults to last.
softmin(x, [dim]) - applies the softmin function to x (same as softmax(-x, [dim])). dim defaults to the last dimension.
*/
| SOFTMIN LPAREN expr (COMMA expr)? RPAREN # SoftminFunc
/**
@@ -454,7 +454,7 @@ func1:
*/
| ERFINV LPAREN expr RPAREN # ErfinvFunc
/**
unique(x) - returns the unique elements (sorted, flatened)
unique(x) - returns the sorted unique elements of x (tensors are flattened first)
*/
| UNIQUE LPAREN expr RPAREN # UniqueFunc
/**
@@ -494,7 +494,7 @@ func1:
*/
| TRIM LPAREN expr RPAREN # TrimFunc
/**
entropy(x) - computes shanon entropy
entropy(x) - computes the Shannon entropy (in nats) of softmax(x), i.e. x is treated as logits over all of its elements
*/
| ENTROPY LPAREN expr RPAREN # EntropyFunc
/**
@@ -502,19 +502,19 @@ func1:
*/
| SFFT LPAREN expr RPAREN # SfftFunc
/**
dilate(x, [kernel]) - applies dilation to x. kernel is optional.
dilate(x, [kernel_size]) - applies morphological dilation to x with a square kernel (default size 3).
*/
| DILATE LPAREN expr (COMMA expr)? RPAREN # DilateFunc
/**
erode(x, [kernel]) - applies erosion to x. kernel is size of used matrix.
erode(x, [kernel_size]) - applies morphological erosion to x with a square kernel (default size 3).
*/
| ERODE LPAREN expr (COMMA expr)? RPAREN # ErodeFunc
/**
morph_open(x, [kernel]) - applies morphological opening to x. kernel is size of used matrix.
morph_open(x, [kernel_size]) - applies morphological opening (erosion then dilation) to x with a square kernel (default size 3).
*/
| MORPH_OPEN LPAREN expr (COMMA expr)? RPAREN # MorphOpenFunc
/**
morph_close(x, [kernel]) - applies morphological closing to x. kernel is size of used matrix.
morph_close(x, [kernel_size]) - applies morphological closing (dilation then erosion) to x with a square kernel (default size 3).
*/
| MORPH_CLOSE LPAREN expr (COMMA expr)? RPAREN # MorphCloseFunc
/**
@@ -530,7 +530,7 @@ func1:
*/
| FLOW_MAG LPAREN expr RPAREN # FlowMagFunc
/**
flow_angle(x) - computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)
flow_angle(x) - computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)
*/
| FLOW_ANG LPAREN expr RPAREN # FlowAngFunc
/**
@@ -538,7 +538,7 @@ func1:
*/
| AS_NESTED LPAREN expr RPAREN # AsNestedFunc
/**
svd(x, [full_matrices]) - computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)
svd(x, [full_matrices]) - computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)
*/
| SVD LPAREN expr (COMMA expr)? RPAREN # SvdFunc;
@@ -648,15 +648,15 @@ func2:
*/
| DET LPAREN expr RPAREN # DetFunc
/**
flip(x, dims) - reverses the order of elements along the specified dimensions. Works also for text and list with dims=0
flip(x, dims) - reverses the order of elements along the specified dimensions. Text is reversed as a whole
*/
| FLIP LPAREN expr COMMA expr RPAREN # FlipFunc
/**
cov(x, y) - computes the covariance matrix of x and y
cov(x, y) - computes the sample covariance of the flattened x and y (which must have the same number of elements)
*/
| COV LPAREN expr COMMA expr RPAREN # CovFunc
/**
correlation(x, y) - computes the correlation between x and y
correlation(x, y) - computes the Pearson correlation coefficient between x and y
*/
| CORR LPAREN expr COMMA expr RPAREN # CorrFunc
/**
@@ -676,11 +676,11 @@ func2:
*/
| GAUSSIAN LPAREN expr COMMA expr (COMMA expr)? RPAREN # GaussianFunc
/**
topk_indices(x, k, [dim]) - returns the indices of the k largest elements along dim; dim defaults to the last
topk_indices(x, k, [dim]) - returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)
*/
| TOPK_IND LPAREN expr COMMA expr (COMMA expr)? RPAREN # TopkIndFunc
/**
botk_indices(x, k, [dim]) - returns the indices of the k smallest elements along dim; dim defaults to the last
botk_indices(x, k, [dim]) - returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)
*/
| BOTK_IND LPAREN expr COMMA expr (COMMA expr)? RPAREN # BotkIndFunc
/**
@@ -765,7 +765,7 @@ func2:
| FLOW_APPLY LPAREN expr COMMA expr RPAREN # FlowApplyFunc
/**
rife(image1, image2, [tiling_size], [iterations], [multi_scale]) - computes the optical flow field ([H, W, 2]) between image1 and image2 using a RAFT-based model
- tiling_size: chuncks image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution
- tiling_size: splits the image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution
- iterations: how many times to run the flow model. Default 12
- multi_scale: also use low resolution of base image for giant movements. Default false
*/
@@ -787,7 +787,7 @@ func2:
*/
| SPLIT LPAREN expr (COMMA expr)? RPAREN # SplitFunc
/**
join(x, [separator]) - joins strings in list using separator. Defalut separator is "". If you want to join tensors use concatinate(...)
join(x, [separator]) - joins the items of list x as text using separator (default ""). Use concatenate(...) to join tensors
*/
| JOIN LPAREN expr (COMMA expr)? RPAREN # JoinFunc
/**
@@ -803,23 +803,23 @@ func2:
*/
| REPLACE LPAREN expr COMMA expr COMMA expr RPAREN # ReplaceFunc
/**
int_to_rgb(val) - converts an integer to an RGB color. If input is tensor it stacks the resulting R, G and B tensors using last dimension. If It is list, List of lists is returned and if value, 3 long list is returned.
int_to_rgb(val) - unpacks 0xRRGGBB integers into 0-1 RGB colors. Tensors get R, G, B stacked in a new last dimension, lists return a list of colors and a number returns a 3-item list
*/
| INT_TO_RGB LPAREN expr RPAREN # Int_to_rgbFunc
/**
rgb_to_int(r, [g, b]) - converts RGB components to an integer It uses last dimension of tensor (or list) as R,G,B if one value. Othervise uses whole thing as channel.
rgb_to_int(rgb) / rgb_to_int(r, g, b) - packs 0-1 RGB components into 0xRRGGBB integers. With one argument the last dimension (or a 3-item list) holds R, G, B; with three, each argument is one channel
*/
| RGB_TO_INT LPAREN expr ( COMMA expr COMMA expr)? RPAREN # Rgb_to_intFunc
/**
interpolate_linear(x, y) - performs linear interpolation on X. Assumes that dim 0 is batch and dim 1 = channel
interpolate_linear(x, scale) - resizes x [N, C, ...] with (bi/tri)linear interpolation. A number scales every spatial dimension; a list is the target spatial size
*/
| INTERPOLATE_LINEAR LPAREN expr COMMA expr RPAREN # InterpolateLinearFunc
/**
interpolate_area(x, y) - performs area interpolation X. Assumes that dim 0 is batch and dim 1 = channel
interpolate_area(x, scale) - resizes x [N, C, ...] with area interpolation. A number scales every spatial dimension; a list is the target spatial size
*/
| INTERPOLATE_AREA LPAREN expr COMMA expr RPAREN # InterpolateAreaFunc
/**
interpolate_nearest_exact(x, y) - performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel
interpolate_nearest_exact(x, scale) - resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size
*/
| INTERPOLATE_NEAREST LPAREN expr COMMA expr RPAREN # InterpolateNearestExactFunc
/**
@@ -870,7 +870,7 @@ func3:
*/
| SMOOTHERSTEP LPAREN expr COMMA expr COMMA expr RPAREN # SmootherstepFunc
/**
crop(x, start, size) - crops tensor x. Take size and begin at start. start should be the low corner. The result is at most size (if size is bigger then rest of tensor).
crop(x, start, size) - crops the region of x beginning at start (the low corner). The result always has shape size; parts outside x are zero-filled. On text, returns at most size characters
*/
| CROP LPAREN expr COMMA expr COMMA expr RPAREN # CropFunc
/**
@@ -890,23 +890,23 @@ func3:
*/
| LINSPACE LPAREN expr COMMA expr COMMA expr RPAREN # LinspaceFunc
/**
roll(x, shifts, [axis]) - rolls tensor x along axis
roll(x, shifts, [dim]) - circularly shifts tensor x along dim (default 0)
*/
| ROLL LPAREN expr COMMA expr (COMMA expr)? RPAREN # RollFunc
/**
rgb_to_oklab(r, [g], [b]) - converts RGB to OKLab. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.
rgb_to_oklab(rgb) / rgb_to_oklab(r, g, b) - converts 0-1 sRGB to OKLab. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result
*/
| RGB_TO_OKLAB LPAREN expr (COMMA expr COMMA expr)? RPAREN # RgbToOklabFunc
/**
rgb_to_cielab(r, [g], [b]) - converts RGB to CIELAB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.
rgb_to_cielab(rgb) / rgb_to_cielab(r, g, b) - converts 0-1 sRGB to CIELAB (D65) divided by 100, so L is 0-1. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result
*/
| RGB_TO_CIELAB LPAREN expr (COMMA expr COMMA expr)? RPAREN # RgbToCielabFunc
/**
rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees]) - converts RGB to HSV. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting. If degrees is specified and nonzero it returns hue as 0-360 instead of 0-1
rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees]) - converts RGB to HSV. With one color argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is 0-360 instead of 0-1
*/
| RGB_TO_HSV LPAREN expr (COMMA expr COMMA expr)? (COMMA expr)? RPAREN # RgbToHsvFunc
/**
hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees]) - converts HSV to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.
hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees]) - converts HSV to RGB. With one color argument its last dimension holds H, S, V; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is read as 0-360 instead of 0-1
*/
| HSV_TO_RGB LPAREN expr (COMMA expr COMMA expr)? (COMMA expr)? RPAREN # HsvToRgbFunc
/**
@@ -914,19 +914,19 @@ func3:
*/
| WHERE LPAREN expr COMMA expr COMMA expr RPAREN # WhereFunc
/**
oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b) - converts OKLab to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.
oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b) - converts OKLab to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result
*/
| OKLAB_TO_RGB LPAREN expr (COMMA expr COMMA expr)? RPAREN # OklabToRgbFunc
/**
cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b) - converts CIELAB to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.
cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b) - converts CIELAB divided by 100 (as returned by rgb_to_cielab) to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result
*/
| CIELAB_TO_RGB LPAREN expr (COMMA expr COMMA expr)? RPAREN # CielabToRgbFunc
/**
text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline]) - renders text to an 2D tensor
text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline]) - renders text to a 2D tensor with values 0-1
*/
| TEXT_IMAGE LPAREN expr COMMA expr COMMA expr (COMMA expr)? (COMMA expr)? (COMMA expr)? (COMMA expr)? (COMMA expr)? (COMMA expr)? RPAREN # TextImageFunc
/**
coords(shape, dim, [dtype]) - generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor.
coords(shape, dim, [dtype_template]) - generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).
*/
| COORDS LPAREN expr COMMA expr (COMMA expr)? RPAREN # CoordsFunc
/**
@@ -948,7 +948,7 @@ func4:
*/
SWAP LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # SwapFunc
/**
nan_to_num(x, nan, pos_inf, neg_inf) - null value replacement - inspired by NVL
nan_to_num(x, nan, pos_inf, neg_inf) - replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)
*/
| NVL LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # NvlFunc
/**
@@ -960,7 +960,7 @@ func4:
*/
| DIST LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # DistFunc
/**
histogram(x, bins, min, max) - computes histogram
histogram(x, bins, min, max) - counts the elements of flatten(x) in bins equal-width bins over [min, max]
*/
| HISTOGRAM LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # HistogramFunc;
@@ -1005,11 +1005,11 @@ funcN:
*/
| MAP LPAREN expr COMMA expr (COMMA expr (COMMA expr)?)? RPAREN # MapFunc
/**
ezconvolution(tensor, [kernel_sizes...], kernel) - applies convolution with kernel. Attempts to correctly convolve over size dimensions.
ezconvolution(tensor, size_x, kernel) / ezconvolution(tensor, size_x, size_y, kernel) / ezconvolution(tensor, size_x, size_y, size_z, kernel) - convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates
*/
| EZCONV LPAREN expr (COMMA expr)+ RPAREN # EzConvFunc
/**
convolution(tensor, [kernel_sizes...], kernel) - applies convolution with kernel. Expects [batch,channel, ...]
convolution(tensor, size_x, kernel) / convolution(tensor, size_x, size_y, kernel) / convolution(tensor, size_x, size_y, size_z, kernel) - convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates
*/
| CONV LPAREN expr (COMMA expr)+ RPAREN # ConvFunc
/**
+50 -36
View File
@@ -319,43 +319,35 @@ function ConvertTo-FunctionSignature {
# Parses a doc-comment first line such as:
# "sum(x, [dims]) - computes the sum of elements of x, ..."
# "rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees]) - converts ..."
# into the signature text, arg-count bounds, display arg names (from the
# first signature) and the trailing description text.
# into the signature text, the display arg names of every call form, the
# arg-count bounds covering all forms, and the trailing description text.
param([Parameter(Mandatory)][string]$Line)
$sigMatch = [regex]::Match($Line, '^[a-zA-Z_][a-zA-Z0-9_]*\((?<args>.*?)\)')
if (-not $sigMatch.Success) { return $null }
$rest = $Line.Substring($sigMatch.Index + $sigMatch.Length)
$spec1 = Split-ArgSpec -ArgsText $sigMatch.Groups['args'].Value
# Some functions document two call forms separated by " / "; fold the
# second form's bounds in so min/max cover both (e.g. rgb_to_hsv).
$altMatch = [regex]::Match($rest, '^\s*/\s*[a-zA-Z_][a-zA-Z0-9_]*\((?<args>.*?)\)')
$spec2 = $null
if ($altMatch.Success) {
$spec2 = Split-ArgSpec -ArgsText $altMatch.Groups['args'].Value
$rest = $rest.Substring($altMatch.Index + $altMatch.Length)
$formPattern = [regex]'^\s*/?\s*[a-zA-Z_][a-zA-Z0-9_]*\((?<args>.*?)\)'
$rest = $Line
$forms = New-Object System.Collections.Generic.List[object]
$min = $null
$max = 0
$variadic = $false
while (($m = $formPattern.Match($rest)).Success -and ($forms.Count -eq 0 -or $m.Value.TrimStart().StartsWith('/'))) {
$spec = Split-ArgSpec -ArgsText $m.Groups['args'].Value
$forms.Add($spec.Display)
if ($null -eq $min -or $spec.Min -lt $min) { $min = $spec.Min }
if ($spec.Max -gt $max) { $max = $spec.Max }
if ($spec.Variadic) { $variadic = $true }
$rest = $rest.Substring($m.Length)
}
if ($forms.Count -eq 0) { return $null }
$signature = $Line.Substring(0, $Line.Length - $rest.Length).Trim()
$descMatch = [regex]::Match($rest, '^\s*-\s*(?<desc>.*)$')
$desc = if ($descMatch.Success) { $descMatch.Groups['desc'].Value.Trim() } else { $rest.Trim() }
$min = $spec1.Min
$variadic = $spec1.Variadic
$max = $spec1.Max
if ($spec2) {
if ($spec2.Min -lt $min) { $min = $spec2.Min }
if ($spec2.Variadic) { $variadic = $true }
if ($spec2.Max -gt $max) { $max = $spec2.Max }
}
[pscustomobject]@{
Signature = $signature
MinArgs = $min
MaxArgs = if ($variadic) { $null } else { $max }
ArgNames = $spec1.Display
Forms = $forms.ToArray()
Description = $desc
}
}
@@ -407,22 +399,32 @@ if ($undocumented.Count -gt 0) {
Write-Warning "No parsable doc comment found for function token(s): $($undocumented -join ', '). They will get placeholder metadata."
}
# The grammar production is authoritative for argument counts; the doc
# comment only describes them, so report where the two disagree.
# The grammar production bounds what parses; the doc comment may be stricter
# (e.g. conv accepts any count in the grammar but 3..5 in the visitor). Use the
# narrower range, and report docs that allow calls the grammar rejects.
$arityByToken = Get-ProductionArities -FuncSection $sections.FuncSection
function Format-Arity { param($Min, $Max) "$Min..$(if ($null -eq $Max) { 'n' } else { $Max })" }
foreach ($token in $functionTokens) {
$sig = $sigByToken[$token]
$arity = $arityByToken[$token]
if ($sig -and $arity -and ($sig.MinArgs -ne $arity.MinArgs -or $sig.MaxArgs -ne $arity.MaxArgs)) {
Write-Warning "Doc comment for $token ('$($sig.Signature)') documents $(Format-Arity $sig.MinArgs $sig.MaxArgs) args, grammar accepts $(Format-Arity $arity.MinArgs $arity.MaxArgs)."
}
function Test-ArityWithin {
param($Inner, $Outer)
$Inner.MinArgs -ge $Outer.MinArgs -and ($null -eq $Outer.MaxArgs -or ($null -ne $Inner.MaxArgs -and $Inner.MaxArgs -le $Outer.MaxArgs))
}
$FUNCTION_META = [ordered]@{}
foreach ($token in $functionTokens) {
$sig = $sigByToken[$token]
$arity = $arityByToken[$token]
if ($sig -and $arity) {
if (Test-ArityWithin $sig $arity) {
$arity = $sig
} else {
Write-Warning "Doc comment for $token ('$($sig.Signature)') documents $(Format-Arity $sig.MinArgs $sig.MaxArgs) args, grammar accepts $(Format-Arity $arity.MinArgs $arity.MaxArgs)."
}
}
# Assigned outside an if-expression so PowerShell doesn't unroll the nested arrays.
$forms = [object[]]@(, [string[]]@())
if ($sig) { $forms = $sig.Forms }
$words = $functionTokenToWords[$token]
foreach ($alias in $words) {
# Show the signature under the spelling being completed (e.g. conv vs convolution).
@@ -431,7 +433,7 @@ foreach ($token in $functionTokens) {
MinArgs = if ($arity) { $arity.MinArgs } else { 0 }
MaxArgs = if ($arity) { $arity.MaxArgs } else { $null }
Signature = $signature
Args = if ($sig) { @($sig.ArgNames) } else { @() }
Forms = $forms
Description = if ($sig) { $sig.Description } else { '' }
Details = if ($sig) { $detailsByToken[$token] } else { '' }
Aliases = @($words | Where-Object { $_ -ne $alias })
@@ -477,6 +479,18 @@ function ConvertTo-PyList {
return '[' + (@($Values | ForEach-Object { ConvertTo-PyString $_ }) -join ', ') + ']'
}
function ConvertTo-JsForms {
param([object[]]$Forms)
$parts = foreach ($form in $Forms) { ConvertTo-JsArray $form }
return '[' + (@($parts) -join ', ') + ']'
}
function ConvertTo-PyForms {
param([object[]]$Forms)
$parts = foreach ($form in $Forms) { ConvertTo-PyList $form }
return '[' + (@($parts) -join ', ') + ']'
}
function Write-JsSymbols {
param(
[string]$Path,
@@ -505,7 +519,7 @@ function Write-JsSymbols {
foreach ($name in @($FunctionMeta.psbase.Keys)) {
$meta = $FunctionMeta[$name]
$maxArgsJs = if ($null -eq $meta.MaxArgs) { 'null' } else { $meta.MaxArgs }
[void]$sb.AppendLine(" $(ConvertTo-JsString $name): { minArgs: $($meta.MinArgs), maxArgs: $maxArgsJs, signature: $(ConvertTo-JsString $meta.Signature), args: $(ConvertTo-JsArray $meta.Args), description: $(ConvertTo-JsString $meta.Description), details: $(ConvertTo-JsString $meta.Details), aliases: $(ConvertTo-JsArray $meta.Aliases) },")
[void]$sb.AppendLine(" $(ConvertTo-JsString $name): { minArgs: $($meta.MinArgs), maxArgs: $maxArgsJs, signature: $(ConvertTo-JsString $meta.Signature), forms: $(ConvertTo-JsForms $meta.Forms), description: $(ConvertTo-JsString $meta.Description), details: $(ConvertTo-JsString $meta.Details), aliases: $(ConvertTo-JsArray $meta.Aliases) },")
}
[void]$sb.AppendLine('};')
@@ -537,7 +551,7 @@ function Write-PySymbols {
foreach ($name in @($FunctionMeta.psbase.Keys)) {
$meta = $FunctionMeta[$name]
$maxArgsPy = if ($null -eq $meta.MaxArgs) { 'None' } else { $meta.MaxArgs }
[void]$sb.AppendLine(" $(ConvertTo-PyString $name): {'min_args': $($meta.MinArgs), 'max_args': $maxArgsPy, 'signature': $(ConvertTo-PyString $meta.Signature), 'args': $(ConvertTo-PyList $meta.Args), 'description': $(ConvertTo-PyString $meta.Description), 'details': $(ConvertTo-PyString $meta.Details), 'aliases': $(ConvertTo-PyList $meta.Aliases)},")
[void]$sb.AppendLine(" $(ConvertTo-PyString $name): {'min_args': $($meta.MinArgs), 'max_args': $maxArgsPy, 'signature': $(ConvertTo-PyString $meta.Signature), 'forms': $(ConvertTo-PyForms $meta.Forms), 'description': $(ConvertTo-PyString $meta.Description), 'details': $(ConvertTo-PyString $meta.Details), 'aliases': $(ConvertTo-PyList $meta.Aliases)},")
}
[void]$sb.AppendLine('}')
+322 -322
View File
@@ -10,326 +10,326 @@ INBUILT_FUNCTIONS = {
}
INBUILT_FUNCTION_META = {
'sin': {'min_args': 1, 'max_args': 1, 'signature': 'sin(x)', 'args': ['x'], 'description': 'applies sinus function to value or each element of value', 'details': '', 'aliases': []},
'cos': {'min_args': 1, 'max_args': 1, 'signature': 'cos(x)', 'args': ['x'], 'description': 'applies cosinus function to value or each element of value', 'details': '', 'aliases': []},
'tan': {'min_args': 1, 'max_args': 1, 'signature': 'tan(x)', 'args': ['x'], 'description': 'applies tangents function to value or each element of value', 'details': '', 'aliases': []},
'asin': {'min_args': 1, 'max_args': 1, 'signature': 'asin(x)', 'args': ['x'], 'description': 'applies arcus sinus function to value or each element of value', 'details': '', 'aliases': []},
'acos': {'min_args': 1, 'max_args': 1, 'signature': 'acos(x)', 'args': ['x'], 'description': 'applies arcus cosinus function to value or each element of value', 'details': '', 'aliases': []},
'atan': {'min_args': 1, 'max_args': 1, 'signature': 'atan(x)', 'args': ['x'], 'description': 'applies arcus tangents function to value or each element of value', 'details': '', 'aliases': []},
'atan2': {'min_args': 2, 'max_args': 2, 'signature': 'atan2(y, x)', 'args': ['y', 'x'], 'description': 'computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant', 'details': '', 'aliases': []},
'sinh': {'min_args': 1, 'max_args': 1, 'signature': 'sinh(x)', 'args': ['x'], 'description': 'applies hyperbolic sinus function to value or each element of value', 'details': '', 'aliases': []},
'cosh': {'min_args': 1, 'max_args': 1, 'signature': 'cosh(x)', 'args': ['x'], 'description': 'applies hyperbolic cosinus function to value or each element of value', 'details': '', 'aliases': []},
'tanh': {'min_args': 1, 'max_args': 1, 'signature': 'tanh(x)', 'args': ['x'], 'description': 'applies hyperbolic tangents function to value or each element of value', 'details': '', 'aliases': []},
'asinh': {'min_args': 1, 'max_args': 1, 'signature': 'asinh(x)', 'args': ['x'], 'description': 'applies hyperbolic arcus sinus function to value or each element of value', 'details': '', 'aliases': []},
'acosh': {'min_args': 1, 'max_args': 1, 'signature': 'acosh(x)', 'args': ['x'], 'description': 'applies hyperbolic arcus cosinus function to value or each element of value', 'details': '', 'aliases': []},
'atanh': {'min_args': 1, 'max_args': 1, 'signature': 'atanh(x)', 'args': ['x'], 'description': 'applies hyperbolic arcus tangents function to value or each element of value', 'details': '', 'aliases': []},
'abs': {'min_args': 1, 'max_args': 1, 'signature': 'abs(x)', 'args': ['x'], 'description': 'applies per element absolute value function. Same as |x| for numbers.', 'details': '', 'aliases': []},
'sqrt': {'min_args': 1, 'max_args': 1, 'signature': 'sqrt(x)', 'args': ['x'], 'description': 'applies sqere root per element. Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
'ln': {'min_args': 1, 'max_args': 1, 'signature': 'ln(x)', 'args': ['x'], 'description': 'applies natural logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
'log': {'min_args': 1, 'max_args': 1, 'signature': 'log(x)', 'args': ['x'], 'description': 'applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
'log2': {'min_args': 1, 'max_args': 1, 'signature': 'log2(x)', 'args': ['x'], 'description': 'applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
'exp': {'min_args': 1, 'max_args': 1, 'signature': 'exp(x)', 'args': ['x'], 'description': 'applies e^x to value (per element)', 'details': '', 'aliases': []},
'log1p': {'min_args': 1, 'max_args': 1, 'signature': 'log1p(x)', 'args': ['x'], 'description': 'applies ln(1+x) accurately for values near zero', 'details': '', 'aliases': []},
'expm1': {'min_args': 1, 'max_args': 1, 'signature': 'expm1(x)', 'args': ['x'], 'description': 'applies exp(x)-1 accurately for values near zero', 'details': '', 'aliases': []},
'sinc': {'min_args': 1, 'max_args': 1, 'signature': 'sinc(x)', 'args': ['x'], 'description': 'computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1', 'details': '', 'aliases': []},
'cbrt': {'min_args': 1, 'max_args': 1, 'signature': 'cbrt(x)', 'args': ['x'], 'description': 'computes the real cube root of each value, including negative values', 'details': '', 'aliases': []},
'reciprocal': {'min_args': 1, 'max_args': 1, 'signature': 'reciprocal(x)', 'args': ['x'], 'description': 'computes 1/x element-wise', 'details': '', 'aliases': []},
'logaddexp': {'min_args': 2, 'max_args': 2, 'signature': 'logaddexp(x, y)', 'args': ['x', 'y'], 'description': 'computes log(exp(x) + exp(y)) element-wise using a numerically stable method', 'details': '', 'aliases': []},
'logsumexp': {'min_args': 1, 'max_args': 2, 'signature': 'logsumexp(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions', 'details': '', 'aliases': []},
'norm': {'min_args': 1, 'max_args': 3, 'signature': 'norm(x, [p], [dims])', 'args': ['x', '[p]', '[dims]'], 'description': 'computes the p-norm globally or along one or more dimensions (default p=2)', 'details': '', 'aliases': []},
'normalize': {'min_args': 1, 'max_args': 4, 'signature': 'normalize(x, [p], [dim], [eps])', 'args': ['x', '[p]', '[dim]', '[eps]'], 'description': 'normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)', 'details': '', 'aliases': []},
'group_norm': {'min_args': 2, 'max_args': 5, 'signature': 'group_norm(x, groups, [weight], [bias], [eps])', 'args': ['x', 'groups', '[weight]', '[bias]', '[eps]'], 'description': 'applies channel-first GroupNorm to [N, C, ...] input', 'details': '', 'aliases': []},
'outer': {'min_args': 2, 'max_args': 2, 'signature': 'outer(x, y)', 'args': ['x', 'y'], 'description': 'computes the outer product of flattened x and y', 'details': '', 'aliases': []},
'trace': {'min_args': 1, 'max_args': 1, 'signature': 'trace(x)', 'args': ['x'], 'description': 'sums the main diagonal of each square matrix in x', 'details': '', 'aliases': []},
'det': {'min_args': 1, 'max_args': 1, 'signature': 'det(x)', 'args': ['x'], 'description': 'computes the determinant of each square matrix in x', 'details': '', 'aliases': []},
'rfft': {'min_args': 1, 'max_args': 2, 'signature': 'rfft(x, [dim])', 'args': ['x', '[dim]'], 'description': 'computes the one-dimensional real-input FFT along dim (default: last dimension)', 'details': '', 'aliases': []},
'irfft': {'min_args': 1, 'max_args': 3, 'signature': 'irfft(x, [n], [dim])', 'args': ['x', '[n]', '[dim]'], 'description': 'computes the inverse one-dimensional real FFT along dim (default: last dimension)', 'details': '', 'aliases': []},
'isnan': {'min_args': 1, 'max_args': 1, 'signature': 'isnan(x)', 'args': ['x'], 'description': 'returns 1.0 for NaN values and 0.0 otherwise', 'details': '', 'aliases': []},
'isinf': {'min_args': 1, 'max_args': 1, 'signature': 'isinf(x)', 'args': ['x'], 'description': 'returns 1.0 for infinite values and 0.0 otherwise', 'details': '', 'aliases': []},
'isfinite': {'min_args': 1, 'max_args': 1, 'signature': 'isfinite(x)', 'args': ['x'], 'description': 'returns 1.0 for finite values and 0.0 otherwise', 'details': '', 'aliases': []},
'smin': {'min_args': 1, 'max_args': None, 'signature': 'smin(x, ...)', 'args': ['x', '...'], 'description': 'computes the minimum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smin(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.', 'details': '', 'aliases': []},
'smax': {'min_args': 1, 'max_args': None, 'signature': 'smax(x, ...)', 'args': ['x', '...'], 'description': 'computes the maximum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smax(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.', 'details': '', 'aliases': []},
'tmin': {'min_args': 2, 'max_args': 2, 'signature': 'tmin(x, y)', 'args': ['x', 'y'], 'description': 'elementwise minimum of tensor or list. min(x,y) when inputs are floats', 'details': '', 'aliases': []},
'tmax': {'min_args': 2, 'max_args': 2, 'signature': 'tmax(x,y)', 'args': ['x', 'y'], 'description': 'elementwise maximum of tensor or list. max(x,y) when inputs are floats', 'details': '', 'aliases': []},
'tnorm': {'min_args': 1, 'max_args': 2, 'signature': 'tnorm(x, [dim])', 'args': ['x', '[dim]'], 'description': 'normalises tensor or list by multiplication such that sum(x^2)==1.0 for each slice. Defaults to the last dimension; dim selects a different slicing dimension.', 'details': '', 'aliases': []},
'snorm': {'min_args': 1, 'max_args': 2, 'signature': 'snorm(x,[dim])', 'args': ['x', '[dim]'], 'description': 'frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.', 'details': '', 'aliases': []},
'floor': {'min_args': 1, 'max_args': 1, 'signature': 'floor(x)', 'args': ['x'], 'description': 'returns the largest integer less than or equal to x', 'details': '', 'aliases': []},
'ceil': {'min_args': 1, 'max_args': 1, 'signature': 'ceil(x)', 'args': ['x'], 'description': 'returns the smallest integer greater than or equal to x', 'details': '', 'aliases': []},
'round': {'min_args': 1, 'max_args': 1, 'signature': 'round(x)', 'args': ['x'], 'description': 'rounds x to the nearest integer', 'details': '', 'aliases': []},
'gamma': {'min_args': 1, 'max_args': 1, 'signature': 'gamma(x)', 'args': ['x'], 'description': 'computes the gamma function (per element)', 'details': '', 'aliases': []},
'pow': {'min_args': 2, 'max_args': 2, 'signature': 'pow(x, y)', 'args': ['x', 'y'], 'description': 'computes x raised to the power of y', 'details': '', 'aliases': []},
'sigm': {'min_args': 1, 'max_args': 1, 'signature': 'sigm(x)', 'args': ['x'], 'description': 'applies the sigmoid function: 1 / (1 + exp(-x))', 'details': '', 'aliases': []},
'clamp': {'min_args': 3, 'max_args': 3, 'signature': 'clamp(x, min, max)', 'args': ['x', 'min', 'max'], 'description': 'clamps x between min and max per element', 'details': '', 'aliases': []},
'fft': {'min_args': 1, 'max_args': 1, 'signature': 'fft(x)', 'args': ['x'], 'description': 'computes fast Fourier transform of x', 'details': '', 'aliases': []},
'ifft': {'min_args': 1, 'max_args': 2, 'signature': 'ifft(x, [shape])', 'args': ['x', '[shape]'], 'description': 'inverse fast Fourier transform of x. shape (defaults to the node\'s tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.', 'details': '', 'aliases': []},
'angle': {'min_args': 1, 'max_args': 1, 'signature': 'angle(x)', 'args': ['x'], 'description': 'returns the angle of a complex number or vector', 'details': '', 'aliases': []},
'print': {'min_args': 1, 'max_args': 1, 'signature': 'print(x)', 'args': ['x'], 'description': 'prints the value of x to the console while passing output unchanged', 'details': '', 'aliases': []},
'print_shape': {'min_args': 1, 'max_args': 1, 'signature': 'print_shape(x)', 'args': ['x'], 'description': 'prints the shape of the tensor x', 'details': '', 'aliases': ['pshp']},
'pshp': {'min_args': 1, 'max_args': 1, 'signature': 'pshp(x)', 'args': ['x'], 'description': 'prints the shape of the tensor x', 'details': '', 'aliases': ['print_shape']},
'nvl': {'min_args': 4, 'max_args': 4, 'signature': 'nvl(x, nan, pos_inf, neg_inf)', 'args': ['x', 'nan', 'pos_inf', 'neg_inf'], 'description': 'null value replacement - inspired by NVL', 'details': '', 'aliases': ['nan_to_num']},
'nan_to_num': {'min_args': 4, 'max_args': 4, 'signature': 'nan_to_num(x, nan, pos_inf, neg_inf)', 'args': ['x', 'nan', 'pos_inf', 'neg_inf'], 'description': 'null value replacement - inspired by NVL', 'details': '', 'aliases': ['nvl']},
'lerp': {'min_args': 3, 'max_args': 3, 'signature': 'lerp(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'linear interpolation between a and b by t per element. t can be float or tensor.', 'details': '', 'aliases': []},
'slerp': {'min_args': 3, 'max_args': 4, 'signature': 'slerp(a, b, t, [dim])', 'args': ['a', 'b', 't', '[dim]'], 'description': 'interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.', 'details': '', 'aliases': []},
'step': {'min_args': 2, 'max_args': 2, 'signature': 'step(x, edge)', 'args': ['x', 'edge'], 'description': 'returns 0 if x < edge, else 1', 'details': '', 'aliases': []},
'smoothstep': {'min_args': 3, 'max_args': 3, 'signature': 'smoothstep(x, edge0, edge1)', 'args': ['x', 'edge0', 'edge1'], 'description': 'smooth interpolation between edge0 and edge1', 'details': '', 'aliases': []},
'fract': {'min_args': 1, 'max_args': 1, 'signature': 'fract(x)', 'args': ['x'], 'description': 'returns the fractional part of x: x - floor(x)', 'details': '', 'aliases': []},
'relu': {'min_args': 1, 'max_args': 1, 'signature': 'relu(x)', 'args': ['x'], 'description': 'applies rectified linear unit function: max(0, x)', 'details': '', 'aliases': []},
'softsign': {'min_args': 1, 'max_args': 1, 'signature': 'softsign(x)', 'args': ['x'], 'description': 'applies x / (1 + abs(x)) element-wise', 'details': '', 'aliases': []},
'leaky_relu': {'min_args': 1, 'max_args': 2, 'signature': 'leaky_relu(x, [negative_slope])', 'args': ['x', '[negative_slope]'], 'description': 'applies leaky ReLU element-wise; negative_slope defaults to 0.01', 'details': '', 'aliases': []},
'softplus': {'min_args': 1, 'max_args': 1, 'signature': 'softplus(x)', 'args': ['x'], 'description': 'applies the softplus function: ln(1 + exp(x))', 'details': '', 'aliases': []},
'gelu': {'min_args': 1, 'max_args': 1, 'signature': 'gelu(x)', 'args': ['x'], 'description': 'applies the Gaussian Error Linear Unit (GELU) activation function', 'details': '', 'aliases': []},
'silu': {'min_args': 1, 'max_args': 1, 'signature': 'silu(x)', 'args': ['x'], 'description': 'applies the Sigmoid Linear Unit activation element-wise', 'details': '', 'aliases': []},
'sign': {'min_args': 1, 'max_args': 1, 'signature': 'sign(x)', 'args': ['x'], 'description': 'returns the sign of x: -1, 0, or 1', 'details': '', 'aliases': []},
'degrees': {'min_args': 1, 'max_args': 1, 'signature': 'degrees(x)', 'args': ['x'], 'description': 'converts radians to degrees (per element)', 'details': '', 'aliases': []},
'radians': {'min_args': 1, 'max_args': 1, 'signature': 'radians(x)', 'args': ['x'], 'description': 'converts degrees to radians (per element)', 'details': '', 'aliases': []},
'logical_not': {'min_args': 1, 'max_args': 1, 'signature': 'logical_not(x)', 'args': ['x'], 'description': 'returns 1.0 where x is zero and 0.0 otherwise', 'details': '', 'aliases': []},
'logical_and': {'min_args': 2, 'max_args': 2, 'signature': 'logical_and(x, y)', 'args': ['x', 'y'], 'description': 'returns 1.0 if both values are non-zero, else 0.0', 'details': '', 'aliases': []},
'logical_or': {'min_args': 2, 'max_args': 2, 'signature': 'logical_or(x, y)', 'args': ['x', 'y'], 'description': 'returns 1.0 if either value is non-zero, else 0.0', 'details': '', 'aliases': []},
'hypot': {'min_args': 2, 'max_args': 2, 'signature': 'hypot(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise Euclidean distance from the origin', 'details': '', 'aliases': []},
'map': {'min_args': 2, 'max_args': 4, 'signature': 'map(tensor, coord1, [coord2], [coord3])', 'args': ['tensor', 'coord1', '[coord2]', '[coord3]'], 'description': 'samples/remaps input tensor using coordinates', 'details': '', 'aliases': []},
'ezconvolution': {'min_args': 2, 'max_args': None, 'signature': 'ezconvolution(tensor, [kernel_sizes...], kernel)', 'args': ['tensor', '[kernel_sizes...]', 'kernel'], 'description': 'applies convolution with kernel. Attempts to correctly convolve over size dimensions.', 'details': '', 'aliases': ['ezconv']},
'ezconv': {'min_args': 2, 'max_args': None, 'signature': 'ezconv(tensor, [kernel_sizes...], kernel)', 'args': ['tensor', '[kernel_sizes...]', 'kernel'], 'description': 'applies convolution with kernel. Attempts to correctly convolve over size dimensions.', 'details': '', 'aliases': ['ezconvolution']},
'convolution': {'min_args': 2, 'max_args': None, 'signature': 'convolution(tensor, [kernel_sizes...], kernel)', 'args': ['tensor', '[kernel_sizes...]', 'kernel'], 'description': 'applies convolution with kernel. Expects [batch,channel, ...]', 'details': '', 'aliases': ['conv']},
'conv': {'min_args': 2, 'max_args': None, 'signature': 'conv(tensor, [kernel_sizes...], kernel)', 'args': ['tensor', '[kernel_sizes...]', 'kernel'], 'description': 'applies convolution with kernel. Expects [batch,channel, ...]', 'details': '', 'aliases': ['convolution']},
'swap': {'min_args': 4, 'max_args': 4, 'signature': 'swap(x, dim, idx1, idx2)', 'args': ['x', 'dim', 'idx1', 'idx2'], 'description': 'swaps elements along dim between idx1 and idx2', 'details': '', 'aliases': []},
'transpose': {'min_args': 3, 'max_args': 3, 'signature': 'transpose(x, dim0, dim1) / transpose(x, dim0, dim1)', 'args': ['x', 'dim0', 'dim1'], 'description': 'swaps two tensor dimensions', 'details': '', 'aliases': ['swapaxes']},
'swapaxes': {'min_args': 3, 'max_args': 3, 'signature': 'swapaxes(x, dim0, dim1) / swapaxes(x, dim0, dim1)', 'args': ['x', 'dim0', 'dim1'], 'description': 'swaps two tensor dimensions', 'details': '', 'aliases': ['transpose']},
'permute': {'min_args': 2, 'max_args': 2, 'signature': 'permute(x, dims)', 'args': ['x', 'dims'], 'description': 'permutes the dimensions of tensor x according to dims', 'details': '', 'aliases': ['perm']},
'perm': {'min_args': 2, 'max_args': 2, 'signature': 'perm(x, dims)', 'args': ['x', 'dims'], 'description': 'permutes the dimensions of tensor x according to dims', 'details': '', 'aliases': ['permute']},
'reshape': {'min_args': 2, 'max_args': 2, 'signature': 'reshape(x, shape)', 'args': ['x', 'shape'], 'description': 'reshapes tensor x to the specified shape', 'details': '', 'aliases': ['rshp']},
'rshp': {'min_args': 2, 'max_args': 2, 'signature': 'rshp(x, shape)', 'args': ['x', 'shape'], 'description': 'reshapes tensor x to the specified shape', 'details': '', 'aliases': ['reshape']},
'range': {'min_args': 3, 'max_args': 3, 'signature': 'range(start, stop, step)', 'args': ['start', 'stop', 'step'], 'description': 'creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.', 'details': '', 'aliases': []},
'linspace': {'min_args': 3, 'max_args': 3, 'signature': 'linspace(start, stop, num)', 'args': ['start', 'stop', 'num'], 'description': 'creates num linearly spaced values from start to stop (inclusive). Use range if you want to control the step between values.', 'details': '', 'aliases': []},
'logspace': {'min_args': 4, 'max_args': 4, 'signature': 'logspace(start, stop, num, base)', 'args': ['start', 'stop', 'num', 'base'], 'description': 'creates logarithmically spaced values', 'details': '', 'aliases': []},
'topk': {'min_args': 2, 'max_args': 3, 'signature': 'topk(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.', 'details': '', 'aliases': []},
'botk': {'min_args': 2, 'max_args': 3, 'signature': 'botk(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.', 'details': '', 'aliases': []},
'pinv': {'min_args': 1, 'max_args': 1, 'signature': 'pinv(x)', 'args': ['x'], 'description': 'computes the permutative inverse of a list x (list must have uniqe elements) -- TODO: CHECK --', 'details': '', 'aliases': []},
'inv': {'min_args': 1, 'max_args': 2, 'signature': 'inv(x, [pseudo])', 'args': ['x', '[pseudo]'], 'description': 'computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead', 'details': '', 'aliases': []},
'sum': {'min_args': 1, 'max_args': 2, 'signature': 'sum(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes the sum of elements of x, optionally along one or more dimensions', 'details': '', 'aliases': []},
'mean': {'min_args': 1, 'max_args': 2, 'signature': 'mean(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes the arithmetic mean of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
'std': {'min_args': 1, 'max_args': 2, 'signature': 'std(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes the sample standard deviation of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
'var': {'min_args': 1, 'max_args': 2, 'signature': 'var(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes the sample variance of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
'prod': {'min_args': 1, 'max_args': 2, 'signature': 'prod(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes the product of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
'isclose': {'min_args': 2, 'max_args': 4, 'signature': 'isclose(a, b, [rtol], [atol])', 'args': ['a', 'b', '[rtol]', '[atol]'], 'description': 'elementwise approximate equality test', 'details': '', 'aliases': []},
'allclose': {'min_args': 2, 'max_args': 4, 'signature': 'allclose(a, b, [rtol], [atol])', 'args': ['a', 'b', '[rtol]', '[atol]'], 'description': 'returns 1.0 if all elements are approximately equal, else 0.0', 'details': '', 'aliases': []},
'quartile': {'min_args': 2, 'max_args': 3, 'signature': 'quartile(x, q, [dim])', 'args': ['x', 'q', '[dim]'], 'description': 'computes the q-th quartile globally or along dim', 'details': '', 'aliases': ['quartil']},
'quartil': {'min_args': 2, 'max_args': 3, 'signature': 'quartil(x, q, [dim])', 'args': ['x', 'q', '[dim]'], 'description': 'computes the q-th quartile globally or along dim', 'details': '', 'aliases': ['quartile']},
'percentile': {'min_args': 2, 'max_args': 3, 'signature': 'percentile(x, p, [dim])', 'args': ['x', 'p', '[dim]'], 'description': 'computes the p-th percentile globally or along dim', 'details': '', 'aliases': ['prcnt']},
'prcnt': {'min_args': 2, 'max_args': 3, 'signature': 'prcnt(x, p, [dim])', 'args': ['x', 'p', '[dim]'], 'description': 'computes the p-th percentile globally or along dim', 'details': '', 'aliases': ['percentile']},
'quantile': {'min_args': 2, 'max_args': 3, 'signature': 'quantile(x, q, [dim])', 'args': ['x', 'q', '[dim]'], 'description': 'computes the q-th quantile globally or along dim', 'details': '', 'aliases': []},
'dot': {'min_args': 2, 'max_args': 2, 'signature': 'dot(x, y)', 'args': ['x', 'y'], 'description': 'computes the dot product of x and y after flattening both to 1D. Use cross(x, y) if you need a per-vector product with the last dimension kept.', 'details': '', 'aliases': []},
'moment': {'min_args': 3, 'max_args': 3, 'signature': 'moment(x, a, k)', 'args': ['x', 'a', 'k'], 'description': 'computes the k-th moment of x around a', 'details': '', 'aliases': []},
'erf': {'min_args': 1, 'max_args': 1, 'signature': 'erf(x)', 'args': ['x'], 'description': 'computes the error function (torch.erf)', 'details': '', 'aliases': []},
'erfc': {'min_args': 1, 'max_args': 1, 'signature': 'erfc(x)', 'args': ['x'], 'description': 'computes the complementary error function (torch.special.erfc)', 'details': '', 'aliases': []},
'erfinv': {'min_args': 1, 'max_args': 1, 'signature': 'erfinv(x)', 'args': ['x'], 'description': 'computes the inverse error function (torch.erfinv)', 'details': '', 'aliases': []},
'any': {'min_args': 1, 'max_args': 1, 'signature': 'any(x)', 'args': ['x'], 'description': 'returns 1 if any element of x is non-zero otherwise 0', 'details': '', 'aliases': []},
'all': {'min_args': 1, 'max_args': 1, 'signature': 'all(x)', 'args': ['x'], 'description': 'returns 1 if all elements of x are non-zero otherwise 0', 'details': '', 'aliases': []},
'edge': {'min_args': 1, 'max_args': 2, 'signature': 'edge(x, [matrix_size])', 'args': ['x', '[matrix_size]'], 'description': 'detects edges in x. Matrix size denotes the size of edge detection matrix.', 'details': '', 'aliases': []},
'blur': {'min_args': 2, 'max_args': 3, 'signature': 'blur(x, sigma, [reshape])', 'args': ['x', 'sigma', '[reshape]'], 'description': 'applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.', 'details': '', 'aliases': ['gaussian']},
'gaussian': {'min_args': 2, 'max_args': 3, 'signature': 'gaussian(x, sigma, [reshape])', 'args': ['x', 'sigma', '[reshape]'], 'description': 'applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.', 'details': '', 'aliases': ['blur']},
'median': {'min_args': 1, 'max_args': 2, 'signature': 'median(x, [dim])', 'args': ['x', '[dim]'], 'description': 'computes the median globally or along one dimension', 'details': '', 'aliases': []},
'mode': {'min_args': 1, 'max_args': 2, 'signature': 'mode(x, [dim])', 'args': ['x', '[dim]'], 'description': 'computes the mode globally or along one dimension', 'details': '', 'aliases': []},
'cumsum': {'min_args': 1, 'max_args': 2, 'signature': 'cumsum(x, [dim])', 'args': ['x', '[dim]'], 'description': 'computes the cumulative sum, defaulting to the first dimension.', 'details': '', 'aliases': []},
'cumprod': {'min_args': 1, 'max_args': 1, 'signature': 'cumprod(x)', 'args': ['x'], 'description': 'computes the cumulative product over first dimension.', 'details': '', 'aliases': []},
'topk_ind': {'min_args': 2, 'max_args': 3, 'signature': 'topk_ind(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the indices of the k largest elements along dim; dim defaults to the last', 'details': '', 'aliases': ['topk_indices']},
'topk_indices': {'min_args': 2, 'max_args': 3, 'signature': 'topk_indices(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the indices of the k largest elements along dim; dim defaults to the last', 'details': '', 'aliases': ['topk_ind']},
'botk_ind': {'min_args': 2, 'max_args': 3, 'signature': 'botk_ind(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the indices of the k smallest elements along dim; dim defaults to the last', 'details': '', 'aliases': ['botk_indices']},
'botk_indices': {'min_args': 2, 'max_args': 3, 'signature': 'botk_indices(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the indices of the k smallest elements along dim; dim defaults to the last', 'details': '', 'aliases': ['botk_ind']},
'cubic_ease': {'min_args': 3, 'max_args': 3, 'signature': 'cubic_ease(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'cubic ease between a and b', 'details': '', 'aliases': ['cubic']},
'cubic': {'min_args': 3, 'max_args': 3, 'signature': 'cubic(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'cubic ease between a and b', 'details': '', 'aliases': ['cubic_ease']},
'elastic_ease': {'min_args': 3, 'max_args': 3, 'signature': 'elastic_ease(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'elastic ease between a and b', 'details': '', 'aliases': ['elastic']},
'elastic': {'min_args': 3, 'max_args': 3, 'signature': 'elastic(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'elastic ease between a and b', 'details': '', 'aliases': ['elastic_ease']},
'sine_ease': {'min_args': 3, 'max_args': 3, 'signature': 'sine_ease(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'sine easing between a and b', 'details': '', 'aliases': ['sine']},
'sine': {'min_args': 3, 'max_args': 3, 'signature': 'sine(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'sine easing between a and b', 'details': '', 'aliases': ['sine_ease']},
'smootherstep': {'min_args': 3, 'max_args': 3, 'signature': 'smootherstep(x, edge0, edge1)', 'args': ['x', 'edge0', 'edge1'], 'description': 'smoother interpolation between edge0 and edge1', 'details': '', 'aliases': []},
'dist': {'min_args': 4, 'max_args': 4, 'signature': 'dist(x1, y1, x2, y2)', 'args': ['x1', 'y1', 'x2', 'y2'], 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)', 'details': '', 'aliases': ['distance']},
'distance': {'min_args': 4, 'max_args': 4, 'signature': 'distance(x1, y1, x2, y2)', 'args': ['x1', 'y1', 'x2', 'y2'], 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)', 'details': '', 'aliases': ['dist']},
'remap': {'min_args': 5, 'max_args': 5, 'signature': 'remap(v, i_min, i_max, o_min, o_max)', 'args': ['v', 'i_min', 'i_max', 'o_min', 'o_max'], 'description': 'remaps values from input range to output range', 'details': '', 'aliases': []},
'cossim': {'min_args': 2, 'max_args': 2, 'signature': 'cossim(x, y)', 'args': ['x', 'y'], 'description': 'computes the cosine similarity between x and y.', 'details': '', 'aliases': ['cosine_similarity']},
'cosine_similarity': {'min_args': 2, 'max_args': 2, 'signature': 'cosine_similarity(x, y)', 'args': ['x', 'y'], 'description': 'computes the cosine similarity between x and y.', 'details': '', 'aliases': ['cossim']},
'count': {'min_args': 1, 'max_args': 1, 'signature': 'count(x)', 'args': ['x'], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['cnt', 'length']},
'cnt': {'min_args': 1, 'max_args': 1, 'signature': 'cnt(x)', 'args': ['x'], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['count', 'length']},
'length': {'min_args': 1, 'max_args': 1, 'signature': 'length(x)', 'args': ['x'], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['count', 'cnt']},
'keys': {'min_args': 1, 'max_args': 1, 'signature': 'keys(x)', 'args': ['x'], 'description': 'returns a list of dictionary keys in insertion order', 'details': '', 'aliases': []},
'enable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'enable_tracking(d)', 'args': ['d'], 'description': 'enables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_on']},
'track_on': {'min_args': 1, 'max_args': 1, 'signature': 'track_on(d)', 'args': ['d'], 'description': 'enables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['enable_tracking']},
'disable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'disable_tracking(d)', 'args': ['d'], 'description': 'disables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_off']},
'track_off': {'min_args': 1, 'max_args': 1, 'signature': 'track_off(d)', 'args': ['d'], 'description': 'disables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['disable_tracking']},
'reset_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'reset_tracking(d)', 'args': ['d'], 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_reset']},
'track_reset': {'min_args': 1, 'max_args': 1, 'signature': 'track_reset(d)', 'args': ['d'], 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['reset_tracking']},
'get_changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_changed_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d', 'details': '', 'aliases': ['changed_keys']},
'changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'changed_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d', 'details': '', 'aliases': ['get_changed_keys']},
'get_added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_added_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d', 'details': '', 'aliases': ['added_keys']},
'added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'added_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d', 'details': '', 'aliases': ['get_added_keys']},
'get_removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_removed_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were removed from ChangeTrackingDict d', 'details': '', 'aliases': ['removed_keys']},
'removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'removed_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were removed from ChangeTrackingDict d', 'details': '', 'aliases': ['get_removed_keys']},
'get_unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_unchanged_keys(d)', 'args': ['d'], 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d', 'details': '', 'aliases': ['unchanged_keys']},
'unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'unchanged_keys(d)', 'args': ['d'], 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d', 'details': '', 'aliases': ['get_unchanged_keys']},
'repeat': {'min_args': 2, 'max_args': 3, 'signature': 'repeat(x, count, [dims])', 'args': ['x', 'count', '[dims]'], 'description': 'repeats tensor elements; count may be scalar or per-dim list', 'details': '', 'aliases': []},
'flatten': {'min_args': 1, 'max_args': 1, 'signature': 'flatten(x)', 'args': ['x'], 'description': 'flattens tensor into a 1D tensor', 'details': '', 'aliases': []},
'append': {'min_args': 2, 'max_args': 2, 'signature': 'append(x, y)', 'args': ['x', 'y'], 'description': 'appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)', 'details': '', 'aliases': []},
'get_value': {'min_args': 2, 'max_args': 2, 'signature': 'get_value(tensor, position)', 'args': ['tensor', 'position'], 'description': 'reads the value at an N-D position of tensor. Superseded by tensor[position] indexing', 'details': '', 'aliases': []},
'flow_apply': {'min_args': 2, 'max_args': 2, 'signature': 'flow_apply(image, flow)', 'args': ['image', 'flow'], 'description': 'applies optical flow to an image', 'details': '', 'aliases': []},
'batch_shuffle': {'min_args': 2, 'max_args': 2, 'signature': 'batch_shuffle(x, indices)', 'args': ['x', 'indices'], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['shuffle', 'select']},
'shuffle': {'min_args': 2, 'max_args': 2, 'signature': 'shuffle(x, indices)', 'args': ['x', 'indices'], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['batch_shuffle', 'select']},
'select': {'min_args': 2, 'max_args': 2, 'signature': 'select(x, indices)', 'args': ['x', 'indices'], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['batch_shuffle', 'shuffle']},
'motion_mask': {'min_args': 1, 'max_args': 1, 'signature': 'motion_mask(x)', 'args': ['x'], 'description': 'generates a motion mask from optical flow', 'details': '', 'aliases': []},
'flow_to_image': {'min_args': 1, 'max_args': 1, 'signature': 'flow_to_image(x)', 'args': ['x'], 'description': 'converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta.', 'details': '', 'aliases': []},
'flow_mag': {'min_args': 1, 'max_args': 1, 'signature': 'flow_mag(x)', 'args': ['x'], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'aliases': ['flow_magnitude']},
'flow_magnitude': {'min_args': 1, 'max_args': 1, 'signature': 'flow_magnitude(x)', 'args': ['x'], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'aliases': ['flow_mag']},
'flow_ang': {'min_args': 1, 'max_args': 1, 'signature': 'flow_ang(x)', 'args': ['x'], 'description': 'computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)', 'details': '', 'aliases': ['flow_angle']},
'flow_angle': {'min_args': 1, 'max_args': 1, 'signature': 'flow_angle(x)', 'args': ['x'], 'description': 'computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)', 'details': '', 'aliases': ['flow_ang']},
'where': {'min_args': 3, 'max_args': 3, 'signature': 'where(condition, x, y)', 'args': ['condition', 'x', 'y'], 'description': 'returns x if condition is true, else y. Runs per element.', 'details': '', 'aliases': []},
'histogram': {'min_args': 4, 'max_args': 4, 'signature': 'histogram(x, bins, min, max)', 'args': ['x', 'bins', 'min', 'max'], 'description': 'computes histogram', 'details': '', 'aliases': ['hist']},
'hist': {'min_args': 4, 'max_args': 4, 'signature': 'hist(x, bins, min, max)', 'args': ['x', 'bins', 'min', 'max'], 'description': 'computes histogram', 'details': '', 'aliases': ['histogram']},
'overlay': {'min_args': 3, 'max_args': 4, 'signature': 'overlay(base, overlay, offset, [opacity])', 'args': ['base', 'overlay', 'offset', '[opacity]'], 'description': 'overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.', 'details': '', 'aliases': []},
'pad': {'min_args': 2, 'max_args': 2, 'signature': 'pad(x, padding)', 'args': ['x', 'padding'], 'description': 'pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)', 'details': '', 'aliases': []},
'cross': {'min_args': 2, 'max_args': 2, 'signature': 'cross(x, y)', 'args': ['x', 'y'], 'description': 'computes the cross product of x and y. Last dimension must be 3', 'details': '', 'aliases': []},
'matmul': {'min_args': 2, 'max_args': 2, 'signature': 'matmul(x, y)', 'args': ['x', 'y'], 'description': 'computes the matrix multiplication of x and y', 'details': '', 'aliases': []},
'solve': {'min_args': 2, 'max_args': 2, 'signature': 'solve(A, b)', 'args': ['A', 'b'], 'description': 'solves the square linear system A*x=b without explicitly forming A inverse', 'details': '', 'aliases': []},
'matrix_rank': {'min_args': 1, 'max_args': 2, 'signature': 'matrix_rank(x, [tol])', 'args': ['x', '[tol]'], 'description': 'computes the numerical rank of each matrix using optional absolute tolerance tol', 'details': '', 'aliases': []},
'rife': {'min_args': 2, 'max_args': 5, 'signature': 'rife(image1, image2, [tiling_size], [iterations], [multi_scale])', 'args': ['image1', 'image2', '[tiling_size]', '[iterations]', '[multi_scale]'], 'description': 'computes the optical flow field ([H, W, 2]) between image1 and image2 using a RAFT-based model', 'details': '- tiling_size: chuncks image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution\n- iterations: how many times to run the flow model. Default 12\n- multi_scale: also use low resolution of base image for giant movements. Default false', 'aliases': []},
'bnot': {'min_args': 1, 'max_args': 1, 'signature': 'bnot(x)', 'args': ['x'], 'description': 'computes the bitwise NOT', 'details': '', 'aliases': ['bitwise_not']},
'bitwise_not': {'min_args': 1, 'max_args': 1, 'signature': 'bitwise_not(x)', 'args': ['x'], 'description': 'computes the bitwise NOT', 'details': '', 'aliases': ['bnot']},
'bitcount': {'min_args': 1, 'max_args': 1, 'signature': 'bitcount(x)', 'args': ['x'], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['popcount', 'popcnt']},
'popcount': {'min_args': 1, 'max_args': 1, 'signature': 'popcount(x)', 'args': ['x'], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['bitcount', 'popcnt']},
'popcnt': {'min_args': 1, 'max_args': 1, 'signature': 'popcnt(x)', 'args': ['x'], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['bitcount', 'popcount']},
'shape': {'min_args': 1, 'max_args': 1, 'signature': 'shape(x)', 'args': ['x'], 'description': 'returns the shape of tensor as a list', 'details': '', 'aliases': []},
'band': {'min_args': 2, 'max_args': 2, 'signature': 'band(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise AND of x and y', 'details': '', 'aliases': ['bitwise_and']},
'bitwise_and': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_and(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise AND of x and y', 'details': '', 'aliases': ['band']},
'bxor': {'min_args': 2, 'max_args': 2, 'signature': 'bxor(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise XOR of x and y', 'details': '', 'aliases': ['bitwise_xor']},
'bitwise_xor': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_xor(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise XOR of x and y', 'details': '', 'aliases': ['bxor']},
'bor': {'min_args': 2, 'max_args': 2, 'signature': 'bor(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise OR of x and y', 'details': '', 'aliases': ['bitwise_or']},
'bitwise_or': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_or(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise OR of x and y', 'details': '', 'aliases': ['bor']},
'tensor': {'min_args': 1, 'max_args': 3, 'signature': 'tensor(shape, [value], [dtype_template])', 'args': ['shape', '[value]', '[dtype_template]'], 'description': 'creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32', 'details': '', 'aliases': []},
'zeros': {'min_args': 1, 'max_args': 2, 'signature': 'zeros(shape, [dtype_template])', 'args': ['shape', '[dtype_template]'], 'description': 'creates a zero-filled tensor on the current device', 'details': '', 'aliases': []},
'ones': {'min_args': 1, 'max_args': 2, 'signature': 'ones(shape, [dtype_template])', 'args': ['shape', '[dtype_template]'], 'description': 'creates a one-filled tensor on the current device', 'details': '', 'aliases': []},
'eye': {'min_args': 1, 'max_args': 2, 'signature': 'eye(n, [dtype_template])', 'args': ['n', '[dtype_template]'], 'description': 'creates an n-by-n identity matrix', 'details': '', 'aliases': []},
'one_hot': {'min_args': 2, 'max_args': 2, 'signature': 'one_hot(indices, classes)', 'args': ['indices', 'classes'], 'description': 'converts integer class indices to float32 one-hot vectors', 'details': '', 'aliases': []},
'mse': {'min_args': 2, 'max_args': 3, 'signature': 'mse(a, b, [reduction])', 'args': ['a', 'b', '[reduction]'], 'description': 'mean squared error; reduction is mean (default), sum, or none', 'details': '', 'aliases': []},
'mae': {'min_args': 2, 'max_args': 3, 'signature': 'mae(a, b, [reduction])', 'args': ['a', 'b', '[reduction]'], 'description': 'mean absolute error; reduction is mean (default), sum, or none', 'details': '', 'aliases': []},
'psnr': {'min_args': 2, 'max_args': 3, 'signature': 'psnr(a, b, [data_range])', 'args': ['a', 'b', '[data_range]'], 'description': 'peak signal-to-noise ratio in dB; data_range defaults to 1', 'details': '', 'aliases': []},
'weighted_mean': {'min_args': 2, 'max_args': 3, 'signature': 'weighted_mean(x, weights, [dims])', 'args': ['x', 'weights', '[dims]'], 'description': 'computes the weighted mean globally or along one or more dimensions', 'details': '', 'aliases': []},
'huber_loss': {'min_args': 2, 'max_args': 4, 'signature': 'huber_loss(prediction, target, [delta], [reduction])', 'args': ['prediction', 'target', '[delta]', '[reduction]'], 'description': 'computes Huber loss; delta defaults to 1 and reduction to mean', 'details': '', 'aliases': []},
'cross_entropy': {'min_args': 2, 'max_args': 4, 'signature': 'cross_entropy(logits, target, [dim], [reduction])', 'args': ['logits', 'target', '[dim]', '[reduction]'], 'description': 'computes cross-entropy from class logits and class indices or target probabilities', 'details': '', 'aliases': []},
'add_key': {'min_args': 3, 'max_args': 3, 'signature': 'add_key(dict, key, value)', 'args': ['dict', 'key', 'value'], 'description': 'adds or replaces a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': []},
'remove_key': {'min_args': 2, 'max_args': 2, 'signature': 'remove_key(dict, key)', 'args': ['dict', 'key'], 'description': 'removes a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': ['rm_key']},
'rm_key': {'min_args': 2, 'max_args': 2, 'signature': 'rm_key(dict, key)', 'args': ['dict', 'key'], 'description': 'removes a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': ['remove_key']},
'stack_push': {'min_args': 2, 'max_args': 2, 'signature': 'stack_push(slot, val)', 'args': ['slot', 'val'], 'description': 'pushes val onto the end of slot stack', 'details': '', 'aliases': []},
'stack_pop': {'min_args': 1, 'max_args': 1, 'signature': 'stack_pop(slot)', 'args': ['slot'], 'description': 'removes and returns the last element of slot stack', 'details': '', 'aliases': []},
'stack_clear': {'min_args': 1, 'max_args': 1, 'signature': 'stack_clear(slot)', 'args': ['slot'], 'description': 'clears the contents of slot stack', 'details': '', 'aliases': []},
'stack_has': {'min_args': 1, 'max_args': 1, 'signature': 'stack_has(slot)', 'args': ['slot'], 'description': 'returns 1.0 if slot exists in stack and is not empty else returns 0.0', 'details': '', 'aliases': []},
'stack_get': {'min_args': 1, 'max_args': 1, 'signature': 'stack_get(slot)', 'args': ['slot'], 'description': 'returns the last pushed value in slot without popping it', 'details': '', 'aliases': []},
'cat': {'min_args': 2, 'max_args': None, 'signature': 'cat(x, ..., dim)', 'args': ['x', '...', 'dim'], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['concat', 'concatenate']},
'concat': {'min_args': 2, 'max_args': None, 'signature': 'concat(x, ..., dim)', 'args': ['x', '...', 'dim'], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['cat', 'concatenate']},
'concatenate': {'min_args': 2, 'max_args': None, 'signature': 'concatenate(x, ..., dim)', 'args': ['x', '...', 'dim'], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['cat', 'concat']},
'stack': {'min_args': 1, 'max_args': 2, 'signature': 'stack(tensors, [dim])', 'args': ['tensors', '[dim]'], 'description': 'stacks a list of tensors along a new dimension', 'details': '', 'aliases': []},
'nonzero': {'min_args': 1, 'max_args': 1, 'signature': 'nonzero(x)', 'args': ['x'], 'description': 'returns an N-by-rank tensor of coordinates for nonzero elements', 'details': '', 'aliases': []},
'int': {'min_args': 1, 'max_args': 1, 'signature': 'int(x)', 'args': ['x'], 'description': 'casts x to integer', 'details': '', 'aliases': []},
'float': {'min_args': 1, 'max_args': 1, 'signature': 'float(x)', 'args': ['x'], 'description': 'casts x to float', 'details': '', 'aliases': []},
'upper': {'min_args': 1, 'max_args': 1, 'signature': 'upper(x)', 'args': ['x'], 'description': 'converts string to uppercase', 'details': '', 'aliases': []},
'lower': {'min_args': 1, 'max_args': 1, 'signature': 'lower(x)', 'args': ['x'], 'description': 'converts string to lowercase', 'details': '', 'aliases': []},
'trim': {'min_args': 1, 'max_args': 1, 'signature': 'trim(x)', 'args': ['x'], 'description': 'removes leading and trailing whitespace from string', 'details': '', 'aliases': []},
'split': {'min_args': 1, 'max_args': 2, 'signature': 'split(x, [delimiter])', 'args': ['x', '[delimiter]'], 'description': 'splits string to list of strings based on delimiter. Default is space.', 'details': '', 'aliases': []},
'join': {'min_args': 1, 'max_args': 2, 'signature': 'join(x, [separator])', 'args': ['x', '[separator]'], 'description': 'joins strings in list using separator. Defalut separator is "". If you want to join tensors use concatinate(...)', 'details': '', 'aliases': []},
'substring': {'min_args': 2, 'max_args': 3, 'signature': 'substring(s, start, [length])', 'args': ['s', 'start', '[length]'], 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'aliases': ['substr']},
'substr': {'min_args': 2, 'max_args': 3, 'signature': 'substr(s, start, [length])', 'args': ['s', 'start', '[length]'], 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'aliases': ['substring']},
'find': {'min_args': 2, 'max_args': 2, 'signature': 'find(s, sub)', 'args': ['s', 'sub'], 'description': 'returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings.', 'details': '', 'aliases': []},
'replace': {'min_args': 3, 'max_args': 3, 'signature': 'replace(s, old, new)', 'args': ['s', 'old', 'new'], 'description': 'replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.', 'details': '', 'aliases': []},
'dilate': {'min_args': 1, 'max_args': 2, 'signature': 'dilate(x, [kernel])', 'args': ['x', '[kernel]'], 'description': 'applies dilation to x. kernel is optional.', 'details': '', 'aliases': []},
'erode': {'min_args': 1, 'max_args': 2, 'signature': 'erode(x, [kernel])', 'args': ['x', '[kernel]'], 'description': 'applies erosion to x. kernel is size of used matrix.', 'details': '', 'aliases': []},
'morph_open': {'min_args': 1, 'max_args': 2, 'signature': 'morph_open(x, [kernel])', 'args': ['x', '[kernel]'], 'description': 'applies morphological opening to x. kernel is size of used matrix.', 'details': '', 'aliases': []},
'morph_close': {'min_args': 1, 'max_args': 2, 'signature': 'morph_close(x, [kernel])', 'args': ['x', '[kernel]'], 'description': 'applies morphological closing to x. kernel is size of used matrix.', 'details': '', 'aliases': []},
'rgb_to_oklab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_oklab(r, [g], [b])', 'args': ['r', '[g]', '[b]'], 'description': 'converts RGB to OKLab. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.', 'details': '', 'aliases': []},
'rgb_to_cielab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_cielab(r, [g], [b])', 'args': ['r', '[g]', '[b]'], 'description': 'converts RGB to CIELAB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.', 'details': '', 'aliases': []},
'oklab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)', 'args': ['oklab'], 'description': 'converts OKLab to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.', 'details': '', 'aliases': []},
'cielab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)', 'args': ['cielab'], 'description': 'converts CIELAB to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.', 'details': '', 'aliases': []},
'rgb_to_hsv': {'min_args': 1, 'max_args': 4, 'signature': 'rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees])', 'args': ['rgb', '[degrees]'], 'description': 'converts RGB to HSV. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting. If degrees is specified and nonzero it returns hue as 0-360 instead of 0-1', 'details': '', 'aliases': []},
'hsv_to_rgb': {'min_args': 1, 'max_args': 4, 'signature': 'hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees])', 'args': ['hsv', '[degrees]'], 'description': 'converts HSV to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.', 'details': '', 'aliases': []},
'int_to_rgb': {'min_args': 1, 'max_args': 1, 'signature': 'int_to_rgb(val)', 'args': ['val'], 'description': 'converts an integer to an RGB color. If input is tensor it stacks the resulting R, G and B tensors using last dimension. If It is list, List of lists is returned and if value, 3 long list is returned.', 'details': '', 'aliases': []},
'rgb_to_int': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_int(r, [g, b])', 'args': ['r', '[g', 'b]'], 'description': 'converts RGB components to an integer It uses last dimension of tensor (or list) as R,G,B if one value. Othervise uses whole thing as channel.', 'details': '', 'aliases': []},
'interpolate_linear': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_linear(x, y)', 'args': ['x', 'y'], 'description': 'performs linear interpolation on X. Assumes that dim 0 is batch and dim 1 = channel', 'details': '', 'aliases': []},
'interpolate_area': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_area(x, y)', 'args': ['x', 'y'], 'description': 'performs area interpolation X. Assumes that dim 0 is batch and dim 1 = channel', 'details': '', 'aliases': []},
'interpolate_nearest': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_nearest(x, y)', 'args': ['x', 'y'], 'description': 'performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel', 'details': '', 'aliases': ['interpolate_nearest_exact']},
'interpolate_nearest_exact': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_nearest_exact(x, y)', 'args': ['x', 'y'], 'description': 'performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel', 'details': '', 'aliases': ['interpolate_nearest']},
'text_image': {'min_args': 3, 'max_args': 9, 'signature': 'text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline])', 'args': ['text', 'font', 'size', '[max_width]', '[weight]', '[rotation_angle]', '[line_spacing]', '[italic]', '[underline]'], 'description': 'renders text to an 2D tensor', 'details': '', 'aliases': []},
'as_nested_tensor': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested_tensor(x)', 'args': ['x'], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'aliases': ['as_nested']},
'as_nested': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested(x)', 'args': ['x'], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'aliases': ['as_nested_tensor']},
'svd': {'min_args': 1, 'max_args': 2, 'signature': 'svd(x, [full_matrices])', 'args': ['x', '[full_matrices]'], 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)', 'details': '', 'aliases': ['singular_value_decomposition']},
'singular_value_decomposition': {'min_args': 1, 'max_args': 2, 'signature': 'singular_value_decomposition(x, [full_matrices])', 'args': ['x', '[full_matrices]'], 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)', 'details': '', 'aliases': ['svd']},
'diagonal_matrix': {'min_args': 2, 'max_args': 5, 'signature': 'diagonal_matrix(x, shape, [offset], [dim1], [dim2])', 'args': ['x', 'shape', '[offset]', '[dim1]', '[dim2]'], 'description': 'creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.', 'details': '', 'aliases': ['diag']},
'diag': {'min_args': 2, 'max_args': 5, 'signature': 'diag(x, shape, [offset], [dim1], [dim2])', 'args': ['x', 'shape', '[offset]', '[dim1]', '[dim2]'], 'description': 'creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.', 'details': '', 'aliases': ['diagonal_matrix']},
'timestamp': {'min_args': 0, 'max_args': 0, 'signature': 'timestamp()', 'args': [], 'description': 'returns the current system timestamp', 'details': '', 'aliases': ['now']},
'now': {'min_args': 0, 'max_args': 0, 'signature': 'now()', 'args': [], 'description': 'returns the current system timestamp', 'details': '', 'aliases': ['timestamp']},
'sort': {'min_args': 1, 'max_args': 3, 'signature': 'sort(x, [desc], [dim])', 'args': ['x', '[desc]', '[dim]'], 'description': 'returns a sorted version of x (If input is tensor, it sorts the last dimension)', 'details': '', 'aliases': []},
'argsort': {'min_args': 1, 'max_args': 3, 'signature': 'argsort(x, [desc], [dim])', 'args': ['x', '[desc]', '[dim]'], 'description': 'returns the indices that would sort x. desc defaults to ascending and dim defaults to the last dimension.', 'details': '', 'aliases': []},
'argmin': {'min_args': 1, 'max_args': 3, 'signature': 'argmin(x, [as_position], [dim])', 'args': ['x', '[as_position]', '[dim]'], 'description': 'returns the minimum index globally or along dim; as_position returns global coordinates', 'details': '', 'aliases': []},
'argmax': {'min_args': 1, 'max_args': 3, 'signature': 'argmax(x, [as_position], [dim])', 'args': ['x', '[as_position]', '[dim]'], 'description': 'returns the maximum index globally or along dim; as_position returns global coordinates', 'details': '', 'aliases': []},
'softmax': {'min_args': 1, 'max_args': 2, 'signature': 'softmax(x, [axis])', 'args': ['x', '[axis]'], 'description': 'applies the softmax function to x (sum of slice == 1.0 and max value <= 1.0). axis defaults to last.', 'details': '', 'aliases': []},
'softmin': {'min_args': 1, 'max_args': 2, 'signature': 'softmin(x, [axis])', 'args': ['x', '[axis]'], 'description': 'applies the softmin function to x (same as softmax(-x,[axis])). axis defaults to last.', 'details': '', 'aliases': []},
'unique': {'min_args': 1, 'max_args': 1, 'signature': 'unique(x)', 'args': ['x'], 'description': 'returns the unique elements (sorted, flatened)', 'details': '', 'aliases': []},
'flip': {'min_args': 2, 'max_args': 2, 'signature': 'flip(x, dims)', 'args': ['x', 'dims'], 'description': 'reverses the order of elements along the specified dimensions. Works also for text and list with dims=0', 'details': '', 'aliases': []},
'startswith': {'min_args': 2, 'max_args': 2, 'signature': 'startswith(text, prefix)', 'args': ['text', 'prefix'], 'description': 'returns 1 if text starts with prefix, else 0', 'details': '', 'aliases': []},
'endswith': {'min_args': 2, 'max_args': 2, 'signature': 'endswith(text, suffix)', 'args': ['text', 'suffix'], 'description': 'returns 1 if text ends with suffix, else 0', 'details': '', 'aliases': []},
'squeeze': {'min_args': 1, 'max_args': 2, 'signature': 'squeeze(x, [dim])', 'args': ['x', '[dim]'], 'description': 'removes size-1 dimensions from tensor x, optionally at dim', 'details': '', 'aliases': []},
'unsqueeze': {'min_args': 2, 'max_args': 2, 'signature': 'unsqueeze(x, dim)', 'args': ['x', 'dim'], 'description': 'inserts a size-1 dimension into tensor x at dim', 'details': '', 'aliases': []},
'roll': {'min_args': 2, 'max_args': 3, 'signature': 'roll(x, shifts, [axis])', 'args': ['x', 'shifts', '[axis]'], 'description': 'rolls tensor x along axis', 'details': '', 'aliases': []},
'cov': {'min_args': 2, 'max_args': 2, 'signature': 'cov(x, y)', 'args': ['x', 'y'], 'description': 'computes the covariance matrix of x and y', 'details': '', 'aliases': []},
'corr': {'min_args': 2, 'max_args': 2, 'signature': 'corr(x, y)', 'args': ['x', 'y'], 'description': 'computes the correlation between x and y', 'details': '', 'aliases': ['correlation']},
'correlation': {'min_args': 2, 'max_args': 2, 'signature': 'correlation(x, y)', 'args': ['x', 'y'], 'description': 'computes the correlation between x and y', 'details': '', 'aliases': ['corr']},
'entropy': {'min_args': 1, 'max_args': 1, 'signature': 'entropy(x)', 'args': ['x'], 'description': 'computes shanon entropy', 'details': '', 'aliases': []},
'crop': {'min_args': 3, 'max_args': 3, 'signature': 'crop(x, start, size)', 'args': ['x', 'start', 'size'], 'description': 'crops tensor x. Take size and begin at start. start should be the low corner. The result is at most size (if size is bigger then rest of tensor).', 'details': '', 'aliases': []},
'coords': {'min_args': 2, 'max_args': 3, 'signature': 'coords(shape, dim, [dtype])', 'args': ['shape', 'dim', '[dtype]'], 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor.', 'details': '', 'aliases': ['coordinates']},
'coordinates': {'min_args': 2, 'max_args': 3, 'signature': 'coordinates(shape, dim, [dtype])', 'args': ['shape', 'dim', '[dtype]'], 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor.', 'details': '', 'aliases': ['coords']},
'gather': {'min_args': 3, 'max_args': 3, 'signature': 'gather(x, dim, idx)', 'args': ['x', 'dim', 'idx'], 'description': 'gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.', 'details': '', 'aliases': []},
'scatter': {'min_args': 4, 'max_args': 4, 'signature': 'scatter(x, dim, idx, src)', 'args': ['x', 'dim', 'idx', 'src'], 'description': 'scatters elements from src into x along dim using the indices specified in idx. The output tensor has the same shape as x.', 'details': '', 'aliases': []},
'scatter_add': {'min_args': 4, 'max_args': 4, 'signature': 'scatter_add(x, dim, idx, src)', 'args': ['x', 'dim', 'idx', 'src'], 'description': 'scatters elements from src into x along dim using the indices specified in idx, adding to existing values. The output tensor has the same shape as x.', 'details': '', 'aliases': []},
'noise': {'min_args': 1, 'max_args': 2, 'signature': 'noise(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['randn', 'random_normal']},
'randn': {'min_args': 1, 'max_args': 2, 'signature': 'randn(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['noise', 'random_normal']},
'random_normal': {'min_args': 1, 'max_args': 2, 'signature': 'random_normal(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['noise', 'randn']},
'pink_noise': {'min_args': 1, 'max_args': 2, 'signature': 'pink_noise(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates deterministic pink noise (approximately 1/f power spectrum), normalised per row', 'details': '', 'aliases': ['pink']},
'pink': {'min_args': 1, 'max_args': 2, 'signature': 'pink(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates deterministic pink noise (approximately 1/f power spectrum), normalised per row', 'details': '', 'aliases': ['pink_noise']},
'brown_noise': {'min_args': 1, 'max_args': 2, 'signature': 'brown_noise(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row', 'details': '', 'aliases': ['brown']},
'brown': {'min_args': 1, 'max_args': 2, 'signature': 'brown(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row', 'details': '', 'aliases': ['brown_noise']},
'rand': {'min_args': 1, 'max_args': 2, 'signature': 'rand(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['randu', 'random_uniform']},
'randu': {'min_args': 1, 'max_args': 2, 'signature': 'randu(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['rand', 'random_uniform']},
'random_uniform': {'min_args': 1, 'max_args': 2, 'signature': 'random_uniform(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['rand', 'randu']},
'randc': {'min_args': 3, 'max_args': 4, 'signature': 'randc(seed, median, sigma, [shape])', 'args': ['seed', 'median', 'sigma', '[shape]'], 'description': 'generates Cauchy distributed random values.', 'details': '', 'aliases': ['random_cauchy']},
'random_cauchy': {'min_args': 3, 'max_args': 4, 'signature': 'random_cauchy(seed, median, sigma, [shape])', 'args': ['seed', 'median', 'sigma', '[shape]'], 'description': 'generates Cauchy distributed random values.', 'details': '', 'aliases': ['randc']},
'rande': {'min_args': 2, 'max_args': 3, 'signature': 'rande(seed, lambda, [shape])', 'args': ['seed', 'lambda', '[shape]'], 'description': 'generates exponentially distributed random values', 'details': '', 'aliases': ['random_exponential']},
'random_exponential': {'min_args': 2, 'max_args': 3, 'signature': 'random_exponential(seed, lambda, [shape])', 'args': ['seed', 'lambda', '[shape]'], 'description': 'generates exponentially distributed random values', 'details': '', 'aliases': ['rande']},
'randln': {'min_args': 3, 'max_args': 4, 'signature': 'randln(seed, mean, std, [shape])', 'args': ['seed', 'mean', 'std', '[shape]'], 'description': 'generates log-normally distributed random values.', 'details': '', 'aliases': ['random_log_normal']},
'random_log_normal': {'min_args': 3, 'max_args': 4, 'signature': 'random_log_normal(seed, mean, std, [shape])', 'args': ['seed', 'mean', 'std', '[shape]'], 'description': 'generates log-normally distributed random values.', 'details': '', 'aliases': ['randln']},
'randb': {'min_args': 2, 'max_args': 3, 'signature': 'randb(seed, probability, [shape])', 'args': ['seed', 'probability', '[shape]'], 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor', 'details': '', 'aliases': ['random_bernoulli']},
'random_bernoulli': {'min_args': 2, 'max_args': 3, 'signature': 'random_bernoulli(seed, probability, [shape])', 'args': ['seed', 'probability', '[shape]'], 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor', 'details': '', 'aliases': ['randb']},
'randp': {'min_args': 2, 'max_args': 3, 'signature': 'randp(seed, lambda, [shape])', 'args': ['seed', 'lambda', '[shape]'], 'description': 'generates Poisson distributed random values.', 'details': '', 'aliases': ['random_poisson']},
'random_poisson': {'min_args': 2, 'max_args': 3, 'signature': 'random_poisson(seed, lambda, [shape])', 'args': ['seed', 'lambda', '[shape]'], 'description': 'generates Poisson distributed random values.', 'details': '', 'aliases': ['randp']},
'randg': {'min_args': 3, 'max_args': 4, 'signature': 'randg(seed, shape_param, scale, [shape])', 'args': ['seed', 'shape_param', 'scale', '[shape]'], 'description': 'generates Gamma distributed random values.', 'details': '', 'aliases': ['random_gamma']},
'random_gamma': {'min_args': 3, 'max_args': 4, 'signature': 'random_gamma(seed, shape_param, scale, [shape])', 'args': ['seed', 'shape_param', 'scale', '[shape]'], 'description': 'generates Gamma distributed random values.', 'details': '', 'aliases': ['randg']},
'randbeta': {'min_args': 3, 'max_args': 4, 'signature': 'randbeta(seed, alpha, beta, [shape])', 'args': ['seed', 'alpha', 'beta', '[shape]'], 'description': 'generates Beta distributed random values', 'details': '', 'aliases': ['random_beta']},
'random_beta': {'min_args': 3, 'max_args': 4, 'signature': 'random_beta(seed, alpha, beta, [shape])', 'args': ['seed', 'alpha', 'beta', '[shape]'], 'description': 'generates Beta distributed random values', 'details': '', 'aliases': ['randbeta']},
'randl': {'min_args': 3, 'max_args': 4, 'signature': 'randl(seed, loc, scale, [shape])', 'args': ['seed', 'loc', 'scale', '[shape]'], 'description': 'generates Laplace distributed random values', 'details': '', 'aliases': ['random_laplace']},
'random_laplace': {'min_args': 3, 'max_args': 4, 'signature': 'random_laplace(seed, loc, scale, [shape])', 'args': ['seed', 'loc', 'scale', '[shape]'], 'description': 'generates Laplace distributed random values', 'details': '', 'aliases': ['randl']},
'randgumbel': {'min_args': 3, 'max_args': 4, 'signature': 'randgumbel(seed, loc, scale, [shape])', 'args': ['seed', 'loc', 'scale', '[shape]'], 'description': 'generates Gumbel distributed random values', 'details': '', 'aliases': ['random_gumbel']},
'random_gumbel': {'min_args': 3, 'max_args': 4, 'signature': 'random_gumbel(seed, loc, scale, [shape])', 'args': ['seed', 'loc', 'scale', '[shape]'], 'description': 'generates Gumbel distributed random values', 'details': '', 'aliases': ['randgumbel']},
'randw': {'min_args': 3, 'max_args': 4, 'signature': 'randw(seed, scale, concentration, [shape])', 'args': ['seed', 'scale', 'concentration', '[shape]'], 'description': 'generates Weibull distributed random values', 'details': '', 'aliases': ['random_weibull']},
'random_weibull': {'min_args': 3, 'max_args': 4, 'signature': 'random_weibull(seed, scale, concentration, [shape])', 'args': ['seed', 'scale', 'concentration', '[shape]'], 'description': 'generates Weibull distributed random values', 'details': '', 'aliases': ['randw']},
'randchi2': {'min_args': 2, 'max_args': 3, 'signature': 'randchi2(seed, df, [shape])', 'args': ['seed', 'df', '[shape]'], 'description': 'generates Chi-squared distributed random values', 'details': '', 'aliases': ['random_chi2']},
'random_chi2': {'min_args': 2, 'max_args': 3, 'signature': 'random_chi2(seed, df, [shape])', 'args': ['seed', 'df', '[shape]'], 'description': 'generates Chi-squared distributed random values', 'details': '', 'aliases': ['randchi2']},
'randt': {'min_args': 2, 'max_args': 3, 'signature': 'randt(seed, df, [shape])', 'args': ['seed', 'df', '[shape]'], 'description': 'generates Student-t distributed random values', 'details': '', 'aliases': ['random_studentt']},
'random_studentt': {'min_args': 2, 'max_args': 3, 'signature': 'random_studentt(seed, df, [shape])', 'args': ['seed', 'df', '[shape]'], 'description': 'generates Student-t distributed random values', 'details': '', 'aliases': ['randt']},
'perlin': {'min_args': 2, 'max_args': 5, 'signature': 'perlin(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates Perlin noise', 'details': '', 'aliases': ['perlin_noise']},
'perlin_noise': {'min_args': 2, 'max_args': 5, 'signature': 'perlin_noise(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates Perlin noise', 'details': '', 'aliases': ['perlin']},
'cellular': {'min_args': 2, 'max_args': 5, 'signature': 'cellular(seed, scale, [jitter], [offset], [shape])', 'args': ['seed', 'scale', '[jitter]', '[offset]', '[shape]'], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['voronoi', 'worley', 'cellular_noise', 'voronoi_noise']},
'voronoi': {'min_args': 2, 'max_args': 5, 'signature': 'voronoi(seed, scale, [jitter], [offset], [shape])', 'args': ['seed', 'scale', '[jitter]', '[offset]', '[shape]'], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'worley', 'cellular_noise', 'voronoi_noise']},
'worley': {'min_args': 2, 'max_args': 5, 'signature': 'worley(seed, scale, [jitter], [offset], [shape])', 'args': ['seed', 'scale', '[jitter]', '[offset]', '[shape]'], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'voronoi', 'cellular_noise', 'voronoi_noise']},
'cellular_noise': {'min_args': 2, 'max_args': 5, 'signature': 'cellular_noise(seed, scale, [jitter], [offset], [shape])', 'args': ['seed', 'scale', '[jitter]', '[offset]', '[shape]'], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'voronoi', 'worley', 'voronoi_noise']},
'voronoi_noise': {'min_args': 2, 'max_args': 5, 'signature': 'voronoi_noise(seed, scale, [jitter], [offset], [shape])', 'args': ['seed', 'scale', '[jitter]', '[offset]', '[shape]'], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'voronoi', 'worley', 'cellular_noise']},
'plasma': {'min_args': 2, 'max_args': 5, 'signature': 'plasma(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4', 'details': '', 'aliases': ['turbulence', 'plasma_noise']},
'turbulence': {'min_args': 2, 'max_args': 5, 'signature': 'turbulence(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4', 'details': '', 'aliases': ['plasma', 'plasma_noise']},
'plasma_noise': {'min_args': 2, 'max_args': 5, 'signature': 'plasma_noise(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4', 'details': '', 'aliases': ['plasma', 'turbulence']},
'ridged': {'min_args': 2, 'max_args': 5, 'signature': 'ridged(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates ridged multi-fractal noise', 'details': '', 'aliases': ['ridged_noise']},
'ridged_noise': {'min_args': 2, 'max_args': 5, 'signature': 'ridged_noise(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates ridged multi-fractal noise', 'details': '', 'aliases': ['ridged']},
'domain_warp': {'min_args': 4, 'max_args': 8, 'signature': 'domain_warp(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])', 'args': ['seed', 'scale', 'warp_scale', 'warp_strength', '[octaves]', '[warp_octaves]', '[offset]', '[shape]'], 'description': 'generates domain warped noise', 'details': '', 'aliases': ['domain_warp_noise']},
'domain_warp_noise': {'min_args': 4, 'max_args': 8, 'signature': 'domain_warp_noise(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])', 'args': ['seed', 'scale', 'warp_scale', 'warp_strength', '[octaves]', '[warp_octaves]', '[offset]', '[shape]'], 'description': 'generates domain warped noise', 'details': '', 'aliases': ['domain_warp']},
'sin': {'min_args': 1, 'max_args': 1, 'signature': 'sin(x)', 'forms': [['x']], 'description': 'applies sine function to value or each element of value', 'details': '', 'aliases': []},
'cos': {'min_args': 1, 'max_args': 1, 'signature': 'cos(x)', 'forms': [['x']], 'description': 'applies cosine function to value or each element of value', 'details': '', 'aliases': []},
'tan': {'min_args': 1, 'max_args': 1, 'signature': 'tan(x)', 'forms': [['x']], 'description': 'applies tangent function to value or each element of value', 'details': '', 'aliases': []},
'asin': {'min_args': 1, 'max_args': 1, 'signature': 'asin(x)', 'forms': [['x']], 'description': 'applies arcus sine function to value or each element of value', 'details': '', 'aliases': []},
'acos': {'min_args': 1, 'max_args': 1, 'signature': 'acos(x)', 'forms': [['x']], 'description': 'applies arcus cosine function to value or each element of value', 'details': '', 'aliases': []},
'atan': {'min_args': 1, 'max_args': 1, 'signature': 'atan(x)', 'forms': [['x']], 'description': 'applies arcus tangent function to value or each element of value', 'details': '', 'aliases': []},
'atan2': {'min_args': 2, 'max_args': 2, 'signature': 'atan2(y, x)', 'forms': [['y', 'x']], 'description': 'computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant', 'details': '', 'aliases': []},
'sinh': {'min_args': 1, 'max_args': 1, 'signature': 'sinh(x)', 'forms': [['x']], 'description': 'applies hyperbolic sine function to value or each element of value', 'details': '', 'aliases': []},
'cosh': {'min_args': 1, 'max_args': 1, 'signature': 'cosh(x)', 'forms': [['x']], 'description': 'applies hyperbolic cosine function to value or each element of value', 'details': '', 'aliases': []},
'tanh': {'min_args': 1, 'max_args': 1, 'signature': 'tanh(x)', 'forms': [['x']], 'description': 'applies hyperbolic tangent function to value or each element of value', 'details': '', 'aliases': []},
'asinh': {'min_args': 1, 'max_args': 1, 'signature': 'asinh(x)', 'forms': [['x']], 'description': 'applies hyperbolic arcus sine function to value or each element of value', 'details': '', 'aliases': []},
'acosh': {'min_args': 1, 'max_args': 1, 'signature': 'acosh(x)', 'forms': [['x']], 'description': 'applies hyperbolic arcus cosine function to value or each element of value', 'details': '', 'aliases': []},
'atanh': {'min_args': 1, 'max_args': 1, 'signature': 'atanh(x)', 'forms': [['x']], 'description': 'applies hyperbolic arcus tangent function to value or each element of value', 'details': '', 'aliases': []},
'abs': {'min_args': 1, 'max_args': 1, 'signature': 'abs(x)', 'forms': [['x']], 'description': 'applies per element absolute value function. Same as |x| for numbers.', 'details': '', 'aliases': []},
'sqrt': {'min_args': 1, 'max_args': 1, 'signature': 'sqrt(x)', 'forms': [['x']], 'description': 'applies square root per element. Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
'ln': {'min_args': 1, 'max_args': 1, 'signature': 'ln(x)', 'forms': [['x']], 'description': 'applies natural logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
'log': {'min_args': 1, 'max_args': 1, 'signature': 'log(x)', 'forms': [['x']], 'description': 'applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
'log2': {'min_args': 1, 'max_args': 1, 'signature': 'log2(x)', 'forms': [['x']], 'description': 'applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
'exp': {'min_args': 1, 'max_args': 1, 'signature': 'exp(x)', 'forms': [['x']], 'description': 'applies e^x to value (per element)', 'details': '', 'aliases': []},
'log1p': {'min_args': 1, 'max_args': 1, 'signature': 'log1p(x)', 'forms': [['x']], 'description': 'applies ln(1+x) accurately for values near zero', 'details': '', 'aliases': []},
'expm1': {'min_args': 1, 'max_args': 1, 'signature': 'expm1(x)', 'forms': [['x']], 'description': 'applies exp(x)-1 accurately for values near zero', 'details': '', 'aliases': []},
'sinc': {'min_args': 1, 'max_args': 1, 'signature': 'sinc(x)', 'forms': [['x']], 'description': 'computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1', 'details': '', 'aliases': []},
'cbrt': {'min_args': 1, 'max_args': 1, 'signature': 'cbrt(x)', 'forms': [['x']], 'description': 'computes the real cube root of each value, including negative values', 'details': '', 'aliases': []},
'reciprocal': {'min_args': 1, 'max_args': 1, 'signature': 'reciprocal(x)', 'forms': [['x']], 'description': 'computes 1/x element-wise', 'details': '', 'aliases': []},
'logaddexp': {'min_args': 2, 'max_args': 2, 'signature': 'logaddexp(x, y)', 'forms': [['x', 'y']], 'description': 'computes log(exp(x) + exp(y)) element-wise using a numerically stable method', 'details': '', 'aliases': []},
'logsumexp': {'min_args': 1, 'max_args': 2, 'signature': 'logsumexp(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions', 'details': '', 'aliases': []},
'norm': {'min_args': 1, 'max_args': 3, 'signature': 'norm(x, [p], [dims])', 'forms': [['x', '[p]', '[dims]']], 'description': 'computes the p-norm globally or along one or more dimensions (default p=2)', 'details': '', 'aliases': []},
'normalize': {'min_args': 1, 'max_args': 4, 'signature': 'normalize(x, [p], [dim], [eps])', 'forms': [['x', '[p]', '[dim]', '[eps]']], 'description': 'normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)', 'details': '', 'aliases': []},
'group_norm': {'min_args': 2, 'max_args': 5, 'signature': 'group_norm(x, groups, [weight], [bias], [eps])', 'forms': [['x', 'groups', '[weight]', '[bias]', '[eps]']], 'description': 'applies channel-first GroupNorm to [N, C, ...] input', 'details': '', 'aliases': []},
'outer': {'min_args': 2, 'max_args': 2, 'signature': 'outer(x, y)', 'forms': [['x', 'y']], 'description': 'computes the outer product of flattened x and y', 'details': '', 'aliases': []},
'trace': {'min_args': 1, 'max_args': 1, 'signature': 'trace(x)', 'forms': [['x']], 'description': 'sums the main diagonal of each square matrix in x', 'details': '', 'aliases': []},
'det': {'min_args': 1, 'max_args': 1, 'signature': 'det(x)', 'forms': [['x']], 'description': 'computes the determinant of each square matrix in x', 'details': '', 'aliases': []},
'rfft': {'min_args': 1, 'max_args': 2, 'signature': 'rfft(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the one-dimensional real-input FFT along dim (default: last dimension)', 'details': '', 'aliases': []},
'irfft': {'min_args': 1, 'max_args': 3, 'signature': 'irfft(x, [n], [dim])', 'forms': [['x', '[n]', '[dim]']], 'description': 'computes the inverse one-dimensional real FFT along dim (default: last dimension)', 'details': '', 'aliases': []},
'isnan': {'min_args': 1, 'max_args': 1, 'signature': 'isnan(x)', 'forms': [['x']], 'description': 'returns 1.0 for NaN values and 0.0 otherwise', 'details': '', 'aliases': []},
'isinf': {'min_args': 1, 'max_args': 1, 'signature': 'isinf(x)', 'forms': [['x']], 'description': 'returns 1.0 for infinite values and 0.0 otherwise', 'details': '', 'aliases': []},
'isfinite': {'min_args': 1, 'max_args': 1, 'signature': 'isfinite(x)', 'forms': [['x']], 'description': 'returns 1.0 for finite values and 0.0 otherwise', 'details': '', 'aliases': []},
'smin': {'min_args': 1, 'max_args': None, 'signature': 'smin(x, ...)', 'forms': [['x', '...']], 'description': 'computes the minimum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smin(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.', 'details': '', 'aliases': []},
'smax': {'min_args': 1, 'max_args': None, 'signature': 'smax(x, ...)', 'forms': [['x', '...']], 'description': 'computes the maximum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smax(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.', 'details': '', 'aliases': []},
'tmin': {'min_args': 2, 'max_args': 2, 'signature': 'tmin(x, y)', 'forms': [['x', 'y']], 'description': 'elementwise minimum of tensor or list. min(x,y) when inputs are floats', 'details': '', 'aliases': []},
'tmax': {'min_args': 2, 'max_args': 2, 'signature': 'tmax(x,y)', 'forms': [['x', 'y']], 'description': 'elementwise maximum of tensor or list. max(x,y) when inputs are floats', 'details': '', 'aliases': []},
'tnorm': {'min_args': 1, 'max_args': 2, 'signature': 'tnorm(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'normalises tensor or list by multiplication such that sum(x^2)==1.0 for each slice. Defaults to the last dimension; dim selects a different slicing dimension.', 'details': '', 'aliases': []},
'snorm': {'min_args': 1, 'max_args': 2, 'signature': 'snorm(x,[dim])', 'forms': [['x', '[dim]']], 'description': 'frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.', 'details': '', 'aliases': []},
'floor': {'min_args': 1, 'max_args': 1, 'signature': 'floor(x)', 'forms': [['x']], 'description': 'returns the largest integer less than or equal to x', 'details': '', 'aliases': []},
'ceil': {'min_args': 1, 'max_args': 1, 'signature': 'ceil(x)', 'forms': [['x']], 'description': 'returns the smallest integer greater than or equal to x', 'details': '', 'aliases': []},
'round': {'min_args': 1, 'max_args': 1, 'signature': 'round(x)', 'forms': [['x']], 'description': 'rounds x to the nearest integer', 'details': '', 'aliases': []},
'gamma': {'min_args': 1, 'max_args': 1, 'signature': 'gamma(x)', 'forms': [['x']], 'description': 'computes the gamma function (per element)', 'details': '', 'aliases': []},
'pow': {'min_args': 2, 'max_args': 2, 'signature': 'pow(x, y)', 'forms': [['x', 'y']], 'description': 'computes x raised to the power of y', 'details': '', 'aliases': []},
'sigm': {'min_args': 1, 'max_args': 1, 'signature': 'sigm(x)', 'forms': [['x']], 'description': 'applies the sigmoid function: 1 / (1 + exp(-x))', 'details': '', 'aliases': []},
'clamp': {'min_args': 3, 'max_args': 3, 'signature': 'clamp(x, min, max)', 'forms': [['x', 'min', 'max']], 'description': 'clamps x between min and max per element', 'details': '', 'aliases': []},
'fft': {'min_args': 1, 'max_args': 1, 'signature': 'fft(x)', 'forms': [['x']], 'description': 'computes fast Fourier transform of x', 'details': '', 'aliases': []},
'ifft': {'min_args': 1, 'max_args': 2, 'signature': 'ifft(x, [shape])', 'forms': [['x', '[shape]']], 'description': 'inverse fast Fourier transform of x. shape (defaults to the node\'s tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.', 'details': '', 'aliases': []},
'angle': {'min_args': 1, 'max_args': 1, 'signature': 'angle(x)', 'forms': [['x']], 'description': 'returns the angle of a complex number or vector', 'details': '', 'aliases': []},
'print': {'min_args': 1, 'max_args': 1, 'signature': 'print(x)', 'forms': [['x']], 'description': 'prints the value of x to the console while passing output unchanged', 'details': '', 'aliases': []},
'print_shape': {'min_args': 1, 'max_args': 1, 'signature': 'print_shape(x)', 'forms': [['x']], 'description': 'prints the shape of the tensor x', 'details': '', 'aliases': ['pshp']},
'pshp': {'min_args': 1, 'max_args': 1, 'signature': 'pshp(x)', 'forms': [['x']], 'description': 'prints the shape of the tensor x', 'details': '', 'aliases': ['print_shape']},
'nvl': {'min_args': 4, 'max_args': 4, 'signature': 'nvl(x, nan, pos_inf, neg_inf)', 'forms': [['x', 'nan', 'pos_inf', 'neg_inf']], 'description': 'replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)', 'details': '', 'aliases': ['nan_to_num']},
'nan_to_num': {'min_args': 4, 'max_args': 4, 'signature': 'nan_to_num(x, nan, pos_inf, neg_inf)', 'forms': [['x', 'nan', 'pos_inf', 'neg_inf']], 'description': 'replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)', 'details': '', 'aliases': ['nvl']},
'lerp': {'min_args': 3, 'max_args': 3, 'signature': 'lerp(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'linear interpolation between a and b by t per element. t can be float or tensor.', 'details': '', 'aliases': []},
'slerp': {'min_args': 3, 'max_args': 4, 'signature': 'slerp(a, b, t, [dim])', 'forms': [['a', 'b', 't', '[dim]']], 'description': 'interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.', 'details': '', 'aliases': []},
'step': {'min_args': 2, 'max_args': 2, 'signature': 'step(x, edge)', 'forms': [['x', 'edge']], 'description': 'returns 0 if x < edge, else 1', 'details': '', 'aliases': []},
'smoothstep': {'min_args': 3, 'max_args': 3, 'signature': 'smoothstep(x, edge0, edge1)', 'forms': [['x', 'edge0', 'edge1']], 'description': 'smooth interpolation between edge0 and edge1', 'details': '', 'aliases': []},
'fract': {'min_args': 1, 'max_args': 1, 'signature': 'fract(x)', 'forms': [['x']], 'description': 'returns the fractional part of x: x - floor(x)', 'details': '', 'aliases': []},
'relu': {'min_args': 1, 'max_args': 1, 'signature': 'relu(x)', 'forms': [['x']], 'description': 'applies rectified linear unit function: max(0, x)', 'details': '', 'aliases': []},
'softsign': {'min_args': 1, 'max_args': 1, 'signature': 'softsign(x)', 'forms': [['x']], 'description': 'applies x / (1 + abs(x)) element-wise', 'details': '', 'aliases': []},
'leaky_relu': {'min_args': 1, 'max_args': 2, 'signature': 'leaky_relu(x, [negative_slope])', 'forms': [['x', '[negative_slope]']], 'description': 'applies leaky ReLU element-wise; negative_slope defaults to 0.01', 'details': '', 'aliases': []},
'softplus': {'min_args': 1, 'max_args': 1, 'signature': 'softplus(x)', 'forms': [['x']], 'description': 'applies the softplus function: ln(1 + exp(x))', 'details': '', 'aliases': []},
'gelu': {'min_args': 1, 'max_args': 1, 'signature': 'gelu(x)', 'forms': [['x']], 'description': 'applies the Gaussian Error Linear Unit (GELU) activation function', 'details': '', 'aliases': []},
'silu': {'min_args': 1, 'max_args': 1, 'signature': 'silu(x)', 'forms': [['x']], 'description': 'applies the Sigmoid Linear Unit activation element-wise', 'details': '', 'aliases': []},
'sign': {'min_args': 1, 'max_args': 1, 'signature': 'sign(x)', 'forms': [['x']], 'description': 'returns the sign of x: -1, 0, or 1', 'details': '', 'aliases': []},
'degrees': {'min_args': 1, 'max_args': 1, 'signature': 'degrees(x)', 'forms': [['x']], 'description': 'converts radians to degrees (per element)', 'details': '', 'aliases': []},
'radians': {'min_args': 1, 'max_args': 1, 'signature': 'radians(x)', 'forms': [['x']], 'description': 'converts degrees to radians (per element)', 'details': '', 'aliases': []},
'logical_not': {'min_args': 1, 'max_args': 1, 'signature': 'logical_not(x)', 'forms': [['x']], 'description': 'returns 1.0 where x is zero and 0.0 otherwise', 'details': '', 'aliases': []},
'logical_and': {'min_args': 2, 'max_args': 2, 'signature': 'logical_and(x, y)', 'forms': [['x', 'y']], 'description': 'returns 1.0 if both values are non-zero, else 0.0', 'details': '', 'aliases': []},
'logical_or': {'min_args': 2, 'max_args': 2, 'signature': 'logical_or(x, y)', 'forms': [['x', 'y']], 'description': 'returns 1.0 if either value is non-zero, else 0.0', 'details': '', 'aliases': []},
'hypot': {'min_args': 2, 'max_args': 2, 'signature': 'hypot(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise Euclidean distance from the origin', 'details': '', 'aliases': []},
'map': {'min_args': 2, 'max_args': 4, 'signature': 'map(tensor, coord1, [coord2], [coord3])', 'forms': [['tensor', 'coord1', '[coord2]', '[coord3]']], 'description': 'samples/remaps input tensor using coordinates', 'details': '', 'aliases': []},
'ezconvolution': {'min_args': 3, 'max_args': 5, 'signature': 'ezconvolution(tensor, size_x, kernel) / ezconvolution(tensor, size_x, size_y, kernel) / ezconvolution(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'aliases': ['ezconv']},
'ezconv': {'min_args': 3, 'max_args': 5, 'signature': 'ezconv(tensor, size_x, kernel) / ezconv(tensor, size_x, size_y, kernel) / ezconv(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'aliases': ['ezconvolution']},
'convolution': {'min_args': 3, 'max_args': 5, 'signature': 'convolution(tensor, size_x, kernel) / convolution(tensor, size_x, size_y, kernel) / convolution(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'aliases': ['conv']},
'conv': {'min_args': 3, 'max_args': 5, 'signature': 'conv(tensor, size_x, kernel) / conv(tensor, size_x, size_y, kernel) / conv(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'aliases': ['convolution']},
'swap': {'min_args': 4, 'max_args': 4, 'signature': 'swap(x, dim, idx1, idx2)', 'forms': [['x', 'dim', 'idx1', 'idx2']], 'description': 'swaps elements along dim between idx1 and idx2', 'details': '', 'aliases': []},
'transpose': {'min_args': 3, 'max_args': 3, 'signature': 'transpose(x, dim0, dim1) / transpose(x, dim0, dim1)', 'forms': [['x', 'dim0', 'dim1'], ['x', 'dim0', 'dim1']], 'description': 'swaps two tensor dimensions', 'details': '', 'aliases': ['swapaxes']},
'swapaxes': {'min_args': 3, 'max_args': 3, 'signature': 'swapaxes(x, dim0, dim1) / swapaxes(x, dim0, dim1)', 'forms': [['x', 'dim0', 'dim1'], ['x', 'dim0', 'dim1']], 'description': 'swaps two tensor dimensions', 'details': '', 'aliases': ['transpose']},
'permute': {'min_args': 2, 'max_args': 2, 'signature': 'permute(x, dims)', 'forms': [['x', 'dims']], 'description': 'permutes the dimensions of tensor x according to dims', 'details': '', 'aliases': ['perm']},
'perm': {'min_args': 2, 'max_args': 2, 'signature': 'perm(x, dims)', 'forms': [['x', 'dims']], 'description': 'permutes the dimensions of tensor x according to dims', 'details': '', 'aliases': ['permute']},
'reshape': {'min_args': 2, 'max_args': 2, 'signature': 'reshape(x, shape)', 'forms': [['x', 'shape']], 'description': 'reshapes tensor x to the specified shape', 'details': '', 'aliases': ['rshp']},
'rshp': {'min_args': 2, 'max_args': 2, 'signature': 'rshp(x, shape)', 'forms': [['x', 'shape']], 'description': 'reshapes tensor x to the specified shape', 'details': '', 'aliases': ['reshape']},
'range': {'min_args': 3, 'max_args': 3, 'signature': 'range(start, stop, step)', 'forms': [['start', 'stop', 'step']], 'description': 'creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.', 'details': '', 'aliases': []},
'linspace': {'min_args': 3, 'max_args': 3, 'signature': 'linspace(start, stop, num)', 'forms': [['start', 'stop', 'num']], 'description': 'creates num linearly spaced values from start to stop (inclusive). Use range if you want to control the step between values.', 'details': '', 'aliases': []},
'logspace': {'min_args': 4, 'max_args': 4, 'signature': 'logspace(start, stop, num, base)', 'forms': [['start', 'stop', 'num', 'base']], 'description': 'creates logarithmically spaced values', 'details': '', 'aliases': []},
'topk': {'min_args': 2, 'max_args': 3, 'signature': 'topk(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.', 'details': '', 'aliases': []},
'botk': {'min_args': 2, 'max_args': 3, 'signature': 'botk(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.', 'details': '', 'aliases': []},
'pinv': {'min_args': 1, 'max_args': 1, 'signature': 'pinv(x)', 'forms': [['x']], 'description': 'computes the inverse permutation of x: where x[i] == j the result has result[j] == i. Not the matrix pseudoinverse; use inv(x, 1) for that', 'details': '', 'aliases': []},
'inv': {'min_args': 1, 'max_args': 2, 'signature': 'inv(x, [pseudo])', 'forms': [['x', '[pseudo]']], 'description': 'computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead', 'details': '', 'aliases': []},
'sum': {'min_args': 1, 'max_args': 2, 'signature': 'sum(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the sum of elements of x, optionally along one or more dimensions', 'details': '', 'aliases': []},
'mean': {'min_args': 1, 'max_args': 2, 'signature': 'mean(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the arithmetic mean of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
'std': {'min_args': 1, 'max_args': 2, 'signature': 'std(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the sample standard deviation of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
'var': {'min_args': 1, 'max_args': 2, 'signature': 'var(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the sample variance of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
'prod': {'min_args': 1, 'max_args': 2, 'signature': 'prod(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the product of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
'isclose': {'min_args': 2, 'max_args': 4, 'signature': 'isclose(a, b, [rtol], [atol])', 'forms': [['a', 'b', '[rtol]', '[atol]']], 'description': 'elementwise approximate equality test', 'details': '', 'aliases': []},
'allclose': {'min_args': 2, 'max_args': 4, 'signature': 'allclose(a, b, [rtol], [atol])', 'forms': [['a', 'b', '[rtol]', '[atol]']], 'description': 'returns 1.0 if all elements are approximately equal, else 0.0', 'details': '', 'aliases': []},
'quartile': {'min_args': 2, 'max_args': 3, 'signature': 'quartile(x, q, [dim])', 'forms': [['x', 'q', '[dim]']], 'description': 'computes the q-th quartile globally or along dim', 'details': '', 'aliases': ['quartil']},
'quartil': {'min_args': 2, 'max_args': 3, 'signature': 'quartil(x, q, [dim])', 'forms': [['x', 'q', '[dim]']], 'description': 'computes the q-th quartile globally or along dim', 'details': '', 'aliases': ['quartile']},
'percentile': {'min_args': 2, 'max_args': 3, 'signature': 'percentile(x, p, [dim])', 'forms': [['x', 'p', '[dim]']], 'description': 'computes the p-th percentile globally or along dim', 'details': '', 'aliases': ['prcnt']},
'prcnt': {'min_args': 2, 'max_args': 3, 'signature': 'prcnt(x, p, [dim])', 'forms': [['x', 'p', '[dim]']], 'description': 'computes the p-th percentile globally or along dim', 'details': '', 'aliases': ['percentile']},
'quantile': {'min_args': 2, 'max_args': 3, 'signature': 'quantile(x, q, [dim])', 'forms': [['x', 'q', '[dim]']], 'description': 'computes the q-th quantile globally or along dim', 'details': '', 'aliases': []},
'dot': {'min_args': 2, 'max_args': 2, 'signature': 'dot(x, y)', 'forms': [['x', 'y']], 'description': 'computes the dot product of x and y after flattening both to 1D. Use cross(x, y) if you need a per-vector product with the last dimension kept.', 'details': '', 'aliases': []},
'moment': {'min_args': 3, 'max_args': 3, 'signature': 'moment(x, a, k)', 'forms': [['x', 'a', 'k']], 'description': 'computes the k-th moment of x around a', 'details': '', 'aliases': []},
'erf': {'min_args': 1, 'max_args': 1, 'signature': 'erf(x)', 'forms': [['x']], 'description': 'computes the error function (torch.erf)', 'details': '', 'aliases': []},
'erfc': {'min_args': 1, 'max_args': 1, 'signature': 'erfc(x)', 'forms': [['x']], 'description': 'computes the complementary error function (torch.special.erfc)', 'details': '', 'aliases': []},
'erfinv': {'min_args': 1, 'max_args': 1, 'signature': 'erfinv(x)', 'forms': [['x']], 'description': 'computes the inverse error function (torch.erfinv)', 'details': '', 'aliases': []},
'any': {'min_args': 1, 'max_args': 1, 'signature': 'any(x)', 'forms': [['x']], 'description': 'returns 1 if any element of x is non-zero otherwise 0', 'details': '', 'aliases': []},
'all': {'min_args': 1, 'max_args': 1, 'signature': 'all(x)', 'forms': [['x']], 'description': 'returns 1 if all elements of x are non-zero otherwise 0', 'details': '', 'aliases': []},
'edge': {'min_args': 1, 'max_args': 2, 'signature': 'edge(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'detects edges in x with a Sobel filter. kernel_size must be odd and at least 3 (default 3).', 'details': '', 'aliases': []},
'blur': {'min_args': 2, 'max_args': 3, 'signature': 'blur(x, sigma, [reshape])', 'forms': [['x', 'sigma', '[reshape]']], 'description': 'applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.', 'details': '', 'aliases': ['gaussian']},
'gaussian': {'min_args': 2, 'max_args': 3, 'signature': 'gaussian(x, sigma, [reshape])', 'forms': [['x', 'sigma', '[reshape]']], 'description': 'applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.', 'details': '', 'aliases': ['blur']},
'median': {'min_args': 1, 'max_args': 2, 'signature': 'median(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the median globally or along one dimension', 'details': '', 'aliases': []},
'mode': {'min_args': 1, 'max_args': 2, 'signature': 'mode(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the mode globally or along one dimension', 'details': '', 'aliases': []},
'cumsum': {'min_args': 1, 'max_args': 2, 'signature': 'cumsum(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the cumulative sum, defaulting to the first dimension.', 'details': '', 'aliases': []},
'cumprod': {'min_args': 1, 'max_args': 1, 'signature': 'cumprod(x)', 'forms': [['x']], 'description': 'computes the cumulative product over first dimension.', 'details': '', 'aliases': []},
'topk_ind': {'min_args': 2, 'max_args': 3, 'signature': 'topk_ind(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'aliases': ['topk_indices']},
'topk_indices': {'min_args': 2, 'max_args': 3, 'signature': 'topk_indices(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'aliases': ['topk_ind']},
'botk_ind': {'min_args': 2, 'max_args': 3, 'signature': 'botk_ind(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'aliases': ['botk_indices']},
'botk_indices': {'min_args': 2, 'max_args': 3, 'signature': 'botk_indices(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'aliases': ['botk_ind']},
'cubic_ease': {'min_args': 3, 'max_args': 3, 'signature': 'cubic_ease(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'cubic ease between a and b', 'details': '', 'aliases': ['cubic']},
'cubic': {'min_args': 3, 'max_args': 3, 'signature': 'cubic(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'cubic ease between a and b', 'details': '', 'aliases': ['cubic_ease']},
'elastic_ease': {'min_args': 3, 'max_args': 3, 'signature': 'elastic_ease(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'elastic ease between a and b', 'details': '', 'aliases': ['elastic']},
'elastic': {'min_args': 3, 'max_args': 3, 'signature': 'elastic(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'elastic ease between a and b', 'details': '', 'aliases': ['elastic_ease']},
'sine_ease': {'min_args': 3, 'max_args': 3, 'signature': 'sine_ease(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'sine easing between a and b', 'details': '', 'aliases': ['sine']},
'sine': {'min_args': 3, 'max_args': 3, 'signature': 'sine(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'sine easing between a and b', 'details': '', 'aliases': ['sine_ease']},
'smootherstep': {'min_args': 3, 'max_args': 3, 'signature': 'smootherstep(x, edge0, edge1)', 'forms': [['x', 'edge0', 'edge1']], 'description': 'smoother interpolation between edge0 and edge1', 'details': '', 'aliases': []},
'dist': {'min_args': 4, 'max_args': 4, 'signature': 'dist(x1, y1, x2, y2)', 'forms': [['x1', 'y1', 'x2', 'y2']], 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)', 'details': '', 'aliases': ['distance']},
'distance': {'min_args': 4, 'max_args': 4, 'signature': 'distance(x1, y1, x2, y2)', 'forms': [['x1', 'y1', 'x2', 'y2']], 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)', 'details': '', 'aliases': ['dist']},
'remap': {'min_args': 5, 'max_args': 5, 'signature': 'remap(v, i_min, i_max, o_min, o_max)', 'forms': [['v', 'i_min', 'i_max', 'o_min', 'o_max']], 'description': 'remaps values from input range to output range', 'details': '', 'aliases': []},
'cossim': {'min_args': 2, 'max_args': 2, 'signature': 'cossim(x, y)', 'forms': [['x', 'y']], 'description': 'computes the cosine similarity between x and y.', 'details': '', 'aliases': ['cosine_similarity']},
'cosine_similarity': {'min_args': 2, 'max_args': 2, 'signature': 'cosine_similarity(x, y)', 'forms': [['x', 'y']], 'description': 'computes the cosine similarity between x and y.', 'details': '', 'aliases': ['cossim']},
'count': {'min_args': 1, 'max_args': 1, 'signature': 'count(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['cnt', 'length']},
'cnt': {'min_args': 1, 'max_args': 1, 'signature': 'cnt(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['count', 'length']},
'length': {'min_args': 1, 'max_args': 1, 'signature': 'length(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['count', 'cnt']},
'keys': {'min_args': 1, 'max_args': 1, 'signature': 'keys(x)', 'forms': [['x']], 'description': 'returns a list of dictionary keys in insertion order', 'details': '', 'aliases': []},
'enable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'enable_tracking(d)', 'forms': [['d']], 'description': 'enables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_on']},
'track_on': {'min_args': 1, 'max_args': 1, 'signature': 'track_on(d)', 'forms': [['d']], 'description': 'enables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['enable_tracking']},
'disable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'disable_tracking(d)', 'forms': [['d']], 'description': 'disables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_off']},
'track_off': {'min_args': 1, 'max_args': 1, 'signature': 'track_off(d)', 'forms': [['d']], 'description': 'disables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['disable_tracking']},
'reset_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'reset_tracking(d)', 'forms': [['d']], 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_reset']},
'track_reset': {'min_args': 1, 'max_args': 1, 'signature': 'track_reset(d)', 'forms': [['d']], 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['reset_tracking']},
'get_changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_changed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d', 'details': '', 'aliases': ['changed_keys']},
'changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'changed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d', 'details': '', 'aliases': ['get_changed_keys']},
'get_added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_added_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d', 'details': '', 'aliases': ['added_keys']},
'added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'added_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d', 'details': '', 'aliases': ['get_added_keys']},
'get_removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_removed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were removed from ChangeTrackingDict d', 'details': '', 'aliases': ['removed_keys']},
'removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'removed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were removed from ChangeTrackingDict d', 'details': '', 'aliases': ['get_removed_keys']},
'get_unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_unchanged_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d', 'details': '', 'aliases': ['unchanged_keys']},
'unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'unchanged_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d', 'details': '', 'aliases': ['get_unchanged_keys']},
'repeat': {'min_args': 2, 'max_args': 3, 'signature': 'repeat(x, count, [dims])', 'forms': [['x', 'count', '[dims]']], 'description': 'repeats tensor elements; count may be scalar or per-dim list', 'details': '', 'aliases': []},
'flatten': {'min_args': 1, 'max_args': 1, 'signature': 'flatten(x)', 'forms': [['x']], 'description': 'flattens tensor into a 1D tensor', 'details': '', 'aliases': []},
'append': {'min_args': 2, 'max_args': 2, 'signature': 'append(x, y)', 'forms': [['x', 'y']], 'description': 'appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)', 'details': '', 'aliases': []},
'get_value': {'min_args': 2, 'max_args': 2, 'signature': 'get_value(tensor, position)', 'forms': [['tensor', 'position']], 'description': 'reads the value at an N-D position of tensor. Superseded by tensor[position] indexing', 'details': '', 'aliases': []},
'flow_apply': {'min_args': 2, 'max_args': 2, 'signature': 'flow_apply(image, flow)', 'forms': [['image', 'flow']], 'description': 'applies optical flow to an image', 'details': '', 'aliases': []},
'batch_shuffle': {'min_args': 2, 'max_args': 2, 'signature': 'batch_shuffle(x, indices)', 'forms': [['x', 'indices']], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['shuffle', 'select']},
'shuffle': {'min_args': 2, 'max_args': 2, 'signature': 'shuffle(x, indices)', 'forms': [['x', 'indices']], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['batch_shuffle', 'select']},
'select': {'min_args': 2, 'max_args': 2, 'signature': 'select(x, indices)', 'forms': [['x', 'indices']], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['batch_shuffle', 'shuffle']},
'motion_mask': {'min_args': 1, 'max_args': 1, 'signature': 'motion_mask(x)', 'forms': [['x']], 'description': 'generates a motion mask from optical flow', 'details': '', 'aliases': []},
'flow_to_image': {'min_args': 1, 'max_args': 1, 'signature': 'flow_to_image(x)', 'forms': [['x']], 'description': 'converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta.', 'details': '', 'aliases': []},
'flow_mag': {'min_args': 1, 'max_args': 1, 'signature': 'flow_mag(x)', 'forms': [['x']], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'aliases': ['flow_magnitude']},
'flow_magnitude': {'min_args': 1, 'max_args': 1, 'signature': 'flow_magnitude(x)', 'forms': [['x']], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'aliases': ['flow_mag']},
'flow_ang': {'min_args': 1, 'max_args': 1, 'signature': 'flow_ang(x)', 'forms': [['x']], 'description': 'computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)', 'details': '', 'aliases': ['flow_angle']},
'flow_angle': {'min_args': 1, 'max_args': 1, 'signature': 'flow_angle(x)', 'forms': [['x']], 'description': 'computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)', 'details': '', 'aliases': ['flow_ang']},
'where': {'min_args': 3, 'max_args': 3, 'signature': 'where(condition, x, y)', 'forms': [['condition', 'x', 'y']], 'description': 'returns x if condition is true, else y. Runs per element.', 'details': '', 'aliases': []},
'histogram': {'min_args': 4, 'max_args': 4, 'signature': 'histogram(x, bins, min, max)', 'forms': [['x', 'bins', 'min', 'max']], 'description': 'counts the elements of flatten(x) in bins equal-width bins over [min, max]', 'details': '', 'aliases': ['hist']},
'hist': {'min_args': 4, 'max_args': 4, 'signature': 'hist(x, bins, min, max)', 'forms': [['x', 'bins', 'min', 'max']], 'description': 'counts the elements of flatten(x) in bins equal-width bins over [min, max]', 'details': '', 'aliases': ['histogram']},
'overlay': {'min_args': 3, 'max_args': 4, 'signature': 'overlay(base, overlay, offset, [opacity])', 'forms': [['base', 'overlay', 'offset', '[opacity]']], 'description': 'overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.', 'details': '', 'aliases': []},
'pad': {'min_args': 2, 'max_args': 2, 'signature': 'pad(x, padding)', 'forms': [['x', 'padding']], 'description': 'pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)', 'details': '', 'aliases': []},
'cross': {'min_args': 2, 'max_args': 2, 'signature': 'cross(x, y)', 'forms': [['x', 'y']], 'description': 'computes the cross product of x and y. Last dimension must be 3', 'details': '', 'aliases': []},
'matmul': {'min_args': 2, 'max_args': 2, 'signature': 'matmul(x, y)', 'forms': [['x', 'y']], 'description': 'computes the matrix multiplication of x and y', 'details': '', 'aliases': []},
'solve': {'min_args': 2, 'max_args': 2, 'signature': 'solve(A, b)', 'forms': [['A', 'b']], 'description': 'solves the square linear system A*x=b without explicitly forming A inverse', 'details': '', 'aliases': []},
'matrix_rank': {'min_args': 1, 'max_args': 2, 'signature': 'matrix_rank(x, [tol])', 'forms': [['x', '[tol]']], 'description': 'computes the numerical rank of each matrix using optional absolute tolerance tol', 'details': '', 'aliases': []},
'rife': {'min_args': 2, 'max_args': 5, 'signature': 'rife(image1, image2, [tiling_size], [iterations], [multi_scale])', 'forms': [['image1', 'image2', '[tiling_size]', '[iterations]', '[multi_scale]']], 'description': 'computes the optical flow field ([H, W, 2]) between image1 and image2 using a RAFT-based model', 'details': '- tiling_size: splits the image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution\n- iterations: how many times to run the flow model. Default 12\n- multi_scale: also use low resolution of base image for giant movements. Default false', 'aliases': []},
'bnot': {'min_args': 1, 'max_args': 1, 'signature': 'bnot(x)', 'forms': [['x']], 'description': 'computes the bitwise NOT', 'details': '', 'aliases': ['bitwise_not']},
'bitwise_not': {'min_args': 1, 'max_args': 1, 'signature': 'bitwise_not(x)', 'forms': [['x']], 'description': 'computes the bitwise NOT', 'details': '', 'aliases': ['bnot']},
'bitcount': {'min_args': 1, 'max_args': 1, 'signature': 'bitcount(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['popcount', 'popcnt']},
'popcount': {'min_args': 1, 'max_args': 1, 'signature': 'popcount(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['bitcount', 'popcnt']},
'popcnt': {'min_args': 1, 'max_args': 1, 'signature': 'popcnt(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['bitcount', 'popcount']},
'shape': {'min_args': 1, 'max_args': 1, 'signature': 'shape(x)', 'forms': [['x']], 'description': 'returns the shape of tensor as a list', 'details': '', 'aliases': []},
'band': {'min_args': 2, 'max_args': 2, 'signature': 'band(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise AND of x and y', 'details': '', 'aliases': ['bitwise_and']},
'bitwise_and': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_and(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise AND of x and y', 'details': '', 'aliases': ['band']},
'bxor': {'min_args': 2, 'max_args': 2, 'signature': 'bxor(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise XOR of x and y', 'details': '', 'aliases': ['bitwise_xor']},
'bitwise_xor': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_xor(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise XOR of x and y', 'details': '', 'aliases': ['bxor']},
'bor': {'min_args': 2, 'max_args': 2, 'signature': 'bor(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise OR of x and y', 'details': '', 'aliases': ['bitwise_or']},
'bitwise_or': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_or(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise OR of x and y', 'details': '', 'aliases': ['bor']},
'tensor': {'min_args': 1, 'max_args': 3, 'signature': 'tensor(shape, [value], [dtype_template])', 'forms': [['shape', '[value]', '[dtype_template]']], 'description': 'creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32', 'details': '', 'aliases': []},
'zeros': {'min_args': 1, 'max_args': 2, 'signature': 'zeros(shape, [dtype_template])', 'forms': [['shape', '[dtype_template]']], 'description': 'creates a zero-filled tensor on the current device', 'details': '', 'aliases': []},
'ones': {'min_args': 1, 'max_args': 2, 'signature': 'ones(shape, [dtype_template])', 'forms': [['shape', '[dtype_template]']], 'description': 'creates a one-filled tensor on the current device', 'details': '', 'aliases': []},
'eye': {'min_args': 1, 'max_args': 2, 'signature': 'eye(n, [dtype_template])', 'forms': [['n', '[dtype_template]']], 'description': 'creates an n-by-n identity matrix', 'details': '', 'aliases': []},
'one_hot': {'min_args': 2, 'max_args': 2, 'signature': 'one_hot(indices, classes)', 'forms': [['indices', 'classes']], 'description': 'converts integer class indices to float32 one-hot vectors', 'details': '', 'aliases': []},
'mse': {'min_args': 2, 'max_args': 3, 'signature': 'mse(a, b, [reduction])', 'forms': [['a', 'b', '[reduction]']], 'description': 'mean squared error; reduction is mean (default), sum, or none', 'details': '', 'aliases': []},
'mae': {'min_args': 2, 'max_args': 3, 'signature': 'mae(a, b, [reduction])', 'forms': [['a', 'b', '[reduction]']], 'description': 'mean absolute error; reduction is mean (default), sum, or none', 'details': '', 'aliases': []},
'psnr': {'min_args': 2, 'max_args': 3, 'signature': 'psnr(a, b, [data_range])', 'forms': [['a', 'b', '[data_range]']], 'description': 'peak signal-to-noise ratio in dB; data_range defaults to 1', 'details': '', 'aliases': []},
'weighted_mean': {'min_args': 2, 'max_args': 3, 'signature': 'weighted_mean(x, weights, [dims])', 'forms': [['x', 'weights', '[dims]']], 'description': 'computes the weighted mean globally or along one or more dimensions', 'details': '', 'aliases': []},
'huber_loss': {'min_args': 2, 'max_args': 4, 'signature': 'huber_loss(prediction, target, [delta], [reduction])', 'forms': [['prediction', 'target', '[delta]', '[reduction]']], 'description': 'computes Huber loss; delta defaults to 1 and reduction to mean', 'details': '', 'aliases': []},
'cross_entropy': {'min_args': 2, 'max_args': 4, 'signature': 'cross_entropy(logits, target, [dim], [reduction])', 'forms': [['logits', 'target', '[dim]', '[reduction]']], 'description': 'computes cross-entropy from class logits and class indices or target probabilities', 'details': '', 'aliases': []},
'add_key': {'min_args': 3, 'max_args': 3, 'signature': 'add_key(dict, key, value)', 'forms': [['dict', 'key', 'value']], 'description': 'adds or replaces a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': []},
'remove_key': {'min_args': 2, 'max_args': 2, 'signature': 'remove_key(dict, key)', 'forms': [['dict', 'key']], 'description': 'removes a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': ['rm_key']},
'rm_key': {'min_args': 2, 'max_args': 2, 'signature': 'rm_key(dict, key)', 'forms': [['dict', 'key']], 'description': 'removes a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': ['remove_key']},
'stack_push': {'min_args': 2, 'max_args': 2, 'signature': 'stack_push(slot, val)', 'forms': [['slot', 'val']], 'description': 'pushes val onto the end of slot stack', 'details': '', 'aliases': []},
'stack_pop': {'min_args': 1, 'max_args': 1, 'signature': 'stack_pop(slot)', 'forms': [['slot']], 'description': 'removes and returns the last element of slot stack', 'details': '', 'aliases': []},
'stack_clear': {'min_args': 1, 'max_args': 1, 'signature': 'stack_clear(slot)', 'forms': [['slot']], 'description': 'clears the contents of slot stack', 'details': '', 'aliases': []},
'stack_has': {'min_args': 1, 'max_args': 1, 'signature': 'stack_has(slot)', 'forms': [['slot']], 'description': 'returns 1.0 if slot exists in stack and is not empty else returns 0.0', 'details': '', 'aliases': []},
'stack_get': {'min_args': 1, 'max_args': 1, 'signature': 'stack_get(slot)', 'forms': [['slot']], 'description': 'returns the last pushed value in slot without popping it', 'details': '', 'aliases': []},
'cat': {'min_args': 2, 'max_args': None, 'signature': 'cat(x, ..., dim)', 'forms': [['x', '...', 'dim']], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['concat', 'concatenate']},
'concat': {'min_args': 2, 'max_args': None, 'signature': 'concat(x, ..., dim)', 'forms': [['x', '...', 'dim']], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['cat', 'concatenate']},
'concatenate': {'min_args': 2, 'max_args': None, 'signature': 'concatenate(x, ..., dim)', 'forms': [['x', '...', 'dim']], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['cat', 'concat']},
'stack': {'min_args': 1, 'max_args': 2, 'signature': 'stack(tensors, [dim])', 'forms': [['tensors', '[dim]']], 'description': 'stacks a list of tensors along a new dimension', 'details': '', 'aliases': []},
'nonzero': {'min_args': 1, 'max_args': 1, 'signature': 'nonzero(x)', 'forms': [['x']], 'description': 'returns an N-by-rank tensor of coordinates for nonzero elements', 'details': '', 'aliases': []},
'int': {'min_args': 1, 'max_args': 1, 'signature': 'int(x)', 'forms': [['x']], 'description': 'casts x to integer', 'details': '', 'aliases': []},
'float': {'min_args': 1, 'max_args': 1, 'signature': 'float(x)', 'forms': [['x']], 'description': 'casts x to float', 'details': '', 'aliases': []},
'upper': {'min_args': 1, 'max_args': 1, 'signature': 'upper(x)', 'forms': [['x']], 'description': 'converts string to uppercase', 'details': '', 'aliases': []},
'lower': {'min_args': 1, 'max_args': 1, 'signature': 'lower(x)', 'forms': [['x']], 'description': 'converts string to lowercase', 'details': '', 'aliases': []},
'trim': {'min_args': 1, 'max_args': 1, 'signature': 'trim(x)', 'forms': [['x']], 'description': 'removes leading and trailing whitespace from string', 'details': '', 'aliases': []},
'split': {'min_args': 1, 'max_args': 2, 'signature': 'split(x, [delimiter])', 'forms': [['x', '[delimiter]']], 'description': 'splits string to list of strings based on delimiter. Default is space.', 'details': '', 'aliases': []},
'join': {'min_args': 1, 'max_args': 2, 'signature': 'join(x, [separator])', 'forms': [['x', '[separator]']], 'description': 'joins the items of list x as text using separator (default ""). Use concatenate(...) to join tensors', 'details': '', 'aliases': []},
'substring': {'min_args': 2, 'max_args': 3, 'signature': 'substring(s, start, [length])', 'forms': [['s', 'start', '[length]']], 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'aliases': ['substr']},
'substr': {'min_args': 2, 'max_args': 3, 'signature': 'substr(s, start, [length])', 'forms': [['s', 'start', '[length]']], 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'aliases': ['substring']},
'find': {'min_args': 2, 'max_args': 2, 'signature': 'find(s, sub)', 'forms': [['s', 'sub']], 'description': 'returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings.', 'details': '', 'aliases': []},
'replace': {'min_args': 3, 'max_args': 3, 'signature': 'replace(s, old, new)', 'forms': [['s', 'old', 'new']], 'description': 'replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.', 'details': '', 'aliases': []},
'dilate': {'min_args': 1, 'max_args': 2, 'signature': 'dilate(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological dilation to x with a square kernel (default size 3).', 'details': '', 'aliases': []},
'erode': {'min_args': 1, 'max_args': 2, 'signature': 'erode(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological erosion to x with a square kernel (default size 3).', 'details': '', 'aliases': []},
'morph_open': {'min_args': 1, 'max_args': 2, 'signature': 'morph_open(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological opening (erosion then dilation) to x with a square kernel (default size 3).', 'details': '', 'aliases': []},
'morph_close': {'min_args': 1, 'max_args': 2, 'signature': 'morph_close(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological closing (dilation then erosion) to x with a square kernel (default size 3).', 'details': '', 'aliases': []},
'rgb_to_oklab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_oklab(rgb) / rgb_to_oklab(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'converts 0-1 sRGB to OKLab. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result', 'details': '', 'aliases': []},
'rgb_to_cielab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_cielab(rgb) / rgb_to_cielab(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'converts 0-1 sRGB to CIELAB (D65) divided by 100, so L is 0-1. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result', 'details': '', 'aliases': []},
'oklab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)', 'forms': [['oklab'], ['l', 'a', 'b']], 'description': 'converts OKLab to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result', 'details': '', 'aliases': []},
'cielab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)', 'forms': [['cielab'], ['l', 'a', 'b']], 'description': 'converts CIELAB divided by 100 (as returned by rgb_to_cielab) to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result', 'details': '', 'aliases': []},
'rgb_to_hsv': {'min_args': 1, 'max_args': 4, 'signature': 'rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees])', 'forms': [['rgb', '[degrees]'], ['r', 'g', 'b', '[degrees]']], 'description': 'converts RGB to HSV. With one color argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is 0-360 instead of 0-1', 'details': '', 'aliases': []},
'hsv_to_rgb': {'min_args': 1, 'max_args': 4, 'signature': 'hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees])', 'forms': [['hsv', '[degrees]'], ['h', 's', 'v', '[degrees]']], 'description': 'converts HSV to RGB. With one color argument its last dimension holds H, S, V; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is read as 0-360 instead of 0-1', 'details': '', 'aliases': []},
'int_to_rgb': {'min_args': 1, 'max_args': 1, 'signature': 'int_to_rgb(val)', 'forms': [['val']], 'description': 'unpacks 0xRRGGBB integers into 0-1 RGB colors. Tensors get R, G, B stacked in a new last dimension, lists return a list of colors and a number returns a 3-item list', 'details': '', 'aliases': []},
'rgb_to_int': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_int(rgb) / rgb_to_int(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'packs 0-1 RGB components into 0xRRGGBB integers. With one argument the last dimension (or a 3-item list) holds R, G, B; with three, each argument is one channel', 'details': '', 'aliases': []},
'interpolate_linear': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_linear(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with (bi/tri)linear interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'aliases': []},
'interpolate_area': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_area(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with area interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'aliases': []},
'interpolate_nearest': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_nearest(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'aliases': ['interpolate_nearest_exact']},
'interpolate_nearest_exact': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_nearest_exact(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'aliases': ['interpolate_nearest']},
'text_image': {'min_args': 3, 'max_args': 9, 'signature': 'text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline])', 'forms': [['text', 'font', 'size', '[max_width]', '[weight]', '[rotation_angle]', '[line_spacing]', '[italic]', '[underline]']], 'description': 'renders text to a 2D tensor with values 0-1', 'details': '', 'aliases': []},
'as_nested_tensor': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested_tensor(x)', 'forms': [['x']], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'aliases': ['as_nested']},
'as_nested': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested(x)', 'forms': [['x']], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'aliases': ['as_nested_tensor']},
'svd': {'min_args': 1, 'max_args': 2, 'signature': 'svd(x, [full_matrices])', 'forms': [['x', '[full_matrices]']], 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)', 'details': '', 'aliases': ['singular_value_decomposition']},
'singular_value_decomposition': {'min_args': 1, 'max_args': 2, 'signature': 'singular_value_decomposition(x, [full_matrices])', 'forms': [['x', '[full_matrices]']], 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)', 'details': '', 'aliases': ['svd']},
'diagonal_matrix': {'min_args': 2, 'max_args': 5, 'signature': 'diagonal_matrix(x, shape, [offset], [dim1], [dim2])', 'forms': [['x', 'shape', '[offset]', '[dim1]', '[dim2]']], 'description': 'creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.', 'details': '', 'aliases': ['diag']},
'diag': {'min_args': 2, 'max_args': 5, 'signature': 'diag(x, shape, [offset], [dim1], [dim2])', 'forms': [['x', 'shape', '[offset]', '[dim1]', '[dim2]']], 'description': 'creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.', 'details': '', 'aliases': ['diagonal_matrix']},
'timestamp': {'min_args': 0, 'max_args': 0, 'signature': 'timestamp()', 'forms': [[]], 'description': 'returns the current system timestamp', 'details': '', 'aliases': ['now']},
'now': {'min_args': 0, 'max_args': 0, 'signature': 'now()', 'forms': [[]], 'description': 'returns the current system timestamp', 'details': '', 'aliases': ['timestamp']},
'sort': {'min_args': 1, 'max_args': 3, 'signature': 'sort(x, [descending], [dim])', 'forms': [['x', '[descending]', '[dim]']], 'description': 'returns x sorted ascending, or descending when descending is truthy. Tensors are sorted along dim (default: last dimension); lists use Python sorting', 'details': '', 'aliases': []},
'argsort': {'min_args': 1, 'max_args': 3, 'signature': 'argsort(x, [descending], [dim])', 'forms': [['x', '[descending]', '[dim]']], 'description': 'returns the indices that would sort x. descending defaults to false and dim defaults to the last dimension.', 'details': '', 'aliases': []},
'argmin': {'min_args': 1, 'max_args': 3, 'signature': 'argmin(x, [as_position], [dim])', 'forms': [['x', '[as_position]', '[dim]']], 'description': 'returns the minimum index globally or along dim; as_position returns global coordinates', 'details': '', 'aliases': []},
'argmax': {'min_args': 1, 'max_args': 3, 'signature': 'argmax(x, [as_position], [dim])', 'forms': [['x', '[as_position]', '[dim]']], 'description': 'returns the maximum index globally or along dim; as_position returns global coordinates', 'details': '', 'aliases': []},
'softmax': {'min_args': 1, 'max_args': 2, 'signature': 'softmax(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'applies the softmax function to x (each slice sums to 1.0). dim defaults to the last dimension.', 'details': '', 'aliases': []},
'softmin': {'min_args': 1, 'max_args': 2, 'signature': 'softmin(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'applies the softmin function to x (same as softmax(-x, [dim])). dim defaults to the last dimension.', 'details': '', 'aliases': []},
'unique': {'min_args': 1, 'max_args': 1, 'signature': 'unique(x)', 'forms': [['x']], 'description': 'returns the sorted unique elements of x (tensors are flattened first)', 'details': '', 'aliases': []},
'flip': {'min_args': 2, 'max_args': 2, 'signature': 'flip(x, dims)', 'forms': [['x', 'dims']], 'description': 'reverses the order of elements along the specified dimensions. Text is reversed as a whole', 'details': '', 'aliases': []},
'startswith': {'min_args': 2, 'max_args': 2, 'signature': 'startswith(text, prefix)', 'forms': [['text', 'prefix']], 'description': 'returns 1 if text starts with prefix, else 0', 'details': '', 'aliases': []},
'endswith': {'min_args': 2, 'max_args': 2, 'signature': 'endswith(text, suffix)', 'forms': [['text', 'suffix']], 'description': 'returns 1 if text ends with suffix, else 0', 'details': '', 'aliases': []},
'squeeze': {'min_args': 1, 'max_args': 2, 'signature': 'squeeze(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'removes size-1 dimensions from tensor x, optionally at dim', 'details': '', 'aliases': []},
'unsqueeze': {'min_args': 2, 'max_args': 2, 'signature': 'unsqueeze(x, dim)', 'forms': [['x', 'dim']], 'description': 'inserts a size-1 dimension into tensor x at dim', 'details': '', 'aliases': []},
'roll': {'min_args': 2, 'max_args': 3, 'signature': 'roll(x, shifts, [dim])', 'forms': [['x', 'shifts', '[dim]']], 'description': 'circularly shifts tensor x along dim (default 0)', 'details': '', 'aliases': []},
'cov': {'min_args': 2, 'max_args': 2, 'signature': 'cov(x, y)', 'forms': [['x', 'y']], 'description': 'computes the sample covariance of the flattened x and y (which must have the same number of elements)', 'details': '', 'aliases': []},
'corr': {'min_args': 2, 'max_args': 2, 'signature': 'corr(x, y)', 'forms': [['x', 'y']], 'description': 'computes the Pearson correlation coefficient between x and y', 'details': '', 'aliases': ['correlation']},
'correlation': {'min_args': 2, 'max_args': 2, 'signature': 'correlation(x, y)', 'forms': [['x', 'y']], 'description': 'computes the Pearson correlation coefficient between x and y', 'details': '', 'aliases': ['corr']},
'entropy': {'min_args': 1, 'max_args': 1, 'signature': 'entropy(x)', 'forms': [['x']], 'description': 'computes the Shannon entropy (in nats) of softmax(x), i.e. x is treated as logits over all of its elements', 'details': '', 'aliases': []},
'crop': {'min_args': 3, 'max_args': 3, 'signature': 'crop(x, start, size)', 'forms': [['x', 'start', 'size']], 'description': 'crops the region of x beginning at start (the low corner). The result always has shape size; parts outside x are zero-filled. On text, returns at most size characters', 'details': '', 'aliases': []},
'coords': {'min_args': 2, 'max_args': 3, 'signature': 'coords(shape, dim, [dtype_template])', 'forms': [['shape', 'dim', '[dtype_template]']], 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).', 'details': '', 'aliases': ['coordinates']},
'coordinates': {'min_args': 2, 'max_args': 3, 'signature': 'coordinates(shape, dim, [dtype_template])', 'forms': [['shape', 'dim', '[dtype_template]']], 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).', 'details': '', 'aliases': ['coords']},
'gather': {'min_args': 3, 'max_args': 3, 'signature': 'gather(x, dim, idx)', 'forms': [['x', 'dim', 'idx']], 'description': 'gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.', 'details': '', 'aliases': []},
'scatter': {'min_args': 4, 'max_args': 4, 'signature': 'scatter(x, dim, idx, src)', 'forms': [['x', 'dim', 'idx', 'src']], 'description': 'scatters elements from src into x along dim using the indices specified in idx. The output tensor has the same shape as x.', 'details': '', 'aliases': []},
'scatter_add': {'min_args': 4, 'max_args': 4, 'signature': 'scatter_add(x, dim, idx, src)', 'forms': [['x', 'dim', 'idx', 'src']], 'description': 'scatters elements from src into x along dim using the indices specified in idx, adding to existing values. The output tensor has the same shape as x.', 'details': '', 'aliases': []},
'noise': {'min_args': 1, 'max_args': 2, 'signature': 'noise(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['randn', 'random_normal']},
'randn': {'min_args': 1, 'max_args': 2, 'signature': 'randn(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['noise', 'random_normal']},
'random_normal': {'min_args': 1, 'max_args': 2, 'signature': 'random_normal(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['noise', 'randn']},
'pink_noise': {'min_args': 1, 'max_args': 2, 'signature': 'pink_noise(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic pink noise (approximately 1/f power spectrum), normalised per row', 'details': '', 'aliases': ['pink']},
'pink': {'min_args': 1, 'max_args': 2, 'signature': 'pink(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic pink noise (approximately 1/f power spectrum), normalised per row', 'details': '', 'aliases': ['pink_noise']},
'brown_noise': {'min_args': 1, 'max_args': 2, 'signature': 'brown_noise(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row', 'details': '', 'aliases': ['brown']},
'brown': {'min_args': 1, 'max_args': 2, 'signature': 'brown(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row', 'details': '', 'aliases': ['brown_noise']},
'rand': {'min_args': 1, 'max_args': 2, 'signature': 'rand(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['randu', 'random_uniform']},
'randu': {'min_args': 1, 'max_args': 2, 'signature': 'randu(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['rand', 'random_uniform']},
'random_uniform': {'min_args': 1, 'max_args': 2, 'signature': 'random_uniform(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['rand', 'randu']},
'randc': {'min_args': 3, 'max_args': 4, 'signature': 'randc(seed, median, sigma, [shape])', 'forms': [['seed', 'median', 'sigma', '[shape]']], 'description': 'generates Cauchy distributed random values.', 'details': '', 'aliases': ['random_cauchy']},
'random_cauchy': {'min_args': 3, 'max_args': 4, 'signature': 'random_cauchy(seed, median, sigma, [shape])', 'forms': [['seed', 'median', 'sigma', '[shape]']], 'description': 'generates Cauchy distributed random values.', 'details': '', 'aliases': ['randc']},
'rande': {'min_args': 2, 'max_args': 3, 'signature': 'rande(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates exponentially distributed random values', 'details': '', 'aliases': ['random_exponential']},
'random_exponential': {'min_args': 2, 'max_args': 3, 'signature': 'random_exponential(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates exponentially distributed random values', 'details': '', 'aliases': ['rande']},
'randln': {'min_args': 3, 'max_args': 4, 'signature': 'randln(seed, mean, std, [shape])', 'forms': [['seed', 'mean', 'std', '[shape]']], 'description': 'generates log-normally distributed random values.', 'details': '', 'aliases': ['random_log_normal']},
'random_log_normal': {'min_args': 3, 'max_args': 4, 'signature': 'random_log_normal(seed, mean, std, [shape])', 'forms': [['seed', 'mean', 'std', '[shape]']], 'description': 'generates log-normally distributed random values.', 'details': '', 'aliases': ['randln']},
'randb': {'min_args': 2, 'max_args': 3, 'signature': 'randb(seed, probability, [shape])', 'forms': [['seed', 'probability', '[shape]']], 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor', 'details': '', 'aliases': ['random_bernoulli']},
'random_bernoulli': {'min_args': 2, 'max_args': 3, 'signature': 'random_bernoulli(seed, probability, [shape])', 'forms': [['seed', 'probability', '[shape]']], 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor', 'details': '', 'aliases': ['randb']},
'randp': {'min_args': 2, 'max_args': 3, 'signature': 'randp(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates Poisson distributed random values.', 'details': '', 'aliases': ['random_poisson']},
'random_poisson': {'min_args': 2, 'max_args': 3, 'signature': 'random_poisson(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates Poisson distributed random values.', 'details': '', 'aliases': ['randp']},
'randg': {'min_args': 3, 'max_args': 4, 'signature': 'randg(seed, shape_param, scale, [shape])', 'forms': [['seed', 'shape_param', 'scale', '[shape]']], 'description': 'generates Gamma distributed random values.', 'details': '', 'aliases': ['random_gamma']},
'random_gamma': {'min_args': 3, 'max_args': 4, 'signature': 'random_gamma(seed, shape_param, scale, [shape])', 'forms': [['seed', 'shape_param', 'scale', '[shape]']], 'description': 'generates Gamma distributed random values.', 'details': '', 'aliases': ['randg']},
'randbeta': {'min_args': 3, 'max_args': 4, 'signature': 'randbeta(seed, alpha, beta, [shape])', 'forms': [['seed', 'alpha', 'beta', '[shape]']], 'description': 'generates Beta distributed random values', 'details': '', 'aliases': ['random_beta']},
'random_beta': {'min_args': 3, 'max_args': 4, 'signature': 'random_beta(seed, alpha, beta, [shape])', 'forms': [['seed', 'alpha', 'beta', '[shape]']], 'description': 'generates Beta distributed random values', 'details': '', 'aliases': ['randbeta']},
'randl': {'min_args': 3, 'max_args': 4, 'signature': 'randl(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Laplace distributed random values', 'details': '', 'aliases': ['random_laplace']},
'random_laplace': {'min_args': 3, 'max_args': 4, 'signature': 'random_laplace(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Laplace distributed random values', 'details': '', 'aliases': ['randl']},
'randgumbel': {'min_args': 3, 'max_args': 4, 'signature': 'randgumbel(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Gumbel distributed random values', 'details': '', 'aliases': ['random_gumbel']},
'random_gumbel': {'min_args': 3, 'max_args': 4, 'signature': 'random_gumbel(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Gumbel distributed random values', 'details': '', 'aliases': ['randgumbel']},
'randw': {'min_args': 3, 'max_args': 4, 'signature': 'randw(seed, scale, concentration, [shape])', 'forms': [['seed', 'scale', 'concentration', '[shape]']], 'description': 'generates Weibull distributed random values', 'details': '', 'aliases': ['random_weibull']},
'random_weibull': {'min_args': 3, 'max_args': 4, 'signature': 'random_weibull(seed, scale, concentration, [shape])', 'forms': [['seed', 'scale', 'concentration', '[shape]']], 'description': 'generates Weibull distributed random values', 'details': '', 'aliases': ['randw']},
'randchi2': {'min_args': 2, 'max_args': 3, 'signature': 'randchi2(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Chi-squared distributed random values', 'details': '', 'aliases': ['random_chi2']},
'random_chi2': {'min_args': 2, 'max_args': 3, 'signature': 'random_chi2(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Chi-squared distributed random values', 'details': '', 'aliases': ['randchi2']},
'randt': {'min_args': 2, 'max_args': 3, 'signature': 'randt(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Student-t distributed random values', 'details': '', 'aliases': ['random_studentt']},
'random_studentt': {'min_args': 2, 'max_args': 3, 'signature': 'random_studentt(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Student-t distributed random values', 'details': '', 'aliases': ['randt']},
'perlin': {'min_args': 2, 'max_args': 5, 'signature': 'perlin(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Perlin noise', 'details': '', 'aliases': ['perlin_noise']},
'perlin_noise': {'min_args': 2, 'max_args': 5, 'signature': 'perlin_noise(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Perlin noise', 'details': '', 'aliases': ['perlin']},
'cellular': {'min_args': 2, 'max_args': 5, 'signature': 'cellular(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['voronoi', 'worley', 'cellular_noise', 'voronoi_noise']},
'voronoi': {'min_args': 2, 'max_args': 5, 'signature': 'voronoi(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'worley', 'cellular_noise', 'voronoi_noise']},
'worley': {'min_args': 2, 'max_args': 5, 'signature': 'worley(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'voronoi', 'cellular_noise', 'voronoi_noise']},
'cellular_noise': {'min_args': 2, 'max_args': 5, 'signature': 'cellular_noise(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'voronoi', 'worley', 'voronoi_noise']},
'voronoi_noise': {'min_args': 2, 'max_args': 5, 'signature': 'voronoi_noise(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'voronoi', 'worley', 'cellular_noise']},
'plasma': {'min_args': 2, 'max_args': 5, 'signature': 'plasma(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4', 'details': '', 'aliases': ['turbulence', 'plasma_noise']},
'turbulence': {'min_args': 2, 'max_args': 5, 'signature': 'turbulence(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4', 'details': '', 'aliases': ['plasma', 'plasma_noise']},
'plasma_noise': {'min_args': 2, 'max_args': 5, 'signature': 'plasma_noise(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4', 'details': '', 'aliases': ['plasma', 'turbulence']},
'ridged': {'min_args': 2, 'max_args': 5, 'signature': 'ridged(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates ridged multi-fractal noise', 'details': '', 'aliases': ['ridged_noise']},
'ridged_noise': {'min_args': 2, 'max_args': 5, 'signature': 'ridged_noise(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates ridged multi-fractal noise', 'details': '', 'aliases': ['ridged']},
'domain_warp': {'min_args': 4, 'max_args': 8, 'signature': 'domain_warp(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])', 'forms': [['seed', 'scale', 'warp_scale', 'warp_strength', '[octaves]', '[warp_octaves]', '[offset]', '[shape]']], 'description': 'generates domain warped noise', 'details': '', 'aliases': ['domain_warp_noise']},
'domain_warp_noise': {'min_args': 4, 'max_args': 8, 'signature': 'domain_warp_noise(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])', 'forms': [['seed', 'scale', 'warp_scale', 'warp_strength', '[octaves]', '[warp_octaves]', '[offset]', '[shape]']], 'description': 'generates domain warped noise', 'details': '', 'aliases': ['domain_warp']},
}
+52 -5
View File
@@ -435,16 +435,62 @@ function findCallContext(text, cursor) {
depth--;
continue;
}
if (value !== "(") return null;
// Inside a list or dict literal: it is one argument of the enclosing call.
if (value !== "(") {
argIndex = 0;
continue;
}
let j = i - 1;
while (j >= 0 && isBlank(tokens[j])) j--;
const name = tokens[j]?.type === "function" ? tokens[j].value : null;
return name ? { name, argIndex } : null;
return name ? { name, argIndex, argCount: countCallArgs(text, tokens[i].start) } : null;
}
return null;
}
// Number of arguments in the call whose "(" is at openPos, including those after the cursor.
function countCallArgs(text, openPos) {
let depth = 0;
let commas = 0;
let hasArg = false;
for (const t of tokenize(text.slice(openPos))) {
if (t.type === "bracket") {
if (OPENING_BRACKETS.has(t.value)) {
if (++depth === 1) continue;
} else if (--depth === 0) {
break;
}
}
if (depth === 1 && t.type === "operator" && t.value === ",") commas++;
else if (!isBlank(t) && t.type !== "comment") hasArg = true;
}
return hasArg || commas ? commas + 1 : 0;
}
// Arity of one documented call form, e.g. ["x", "[dims]"] or ["r", "[g", "b]"].
function formArity(args) {
let depth = 0;
let min = 0;
let max = 0;
for (const a of args) {
const optional = depth > 0 || a.startsWith("[");
depth += (a.match(/\[/g) ?? []).length - (a.match(/\]/g) ?? []).length;
if (a.includes("...")) return { min, max: Infinity };
max++;
if (!optional) min++;
}
return { min, max };
}
// First documented form that accepts argCount arguments (e.g. rgb_to_hsv(rgb) vs rgb_to_hsv(r, g, b)).
function pickForm(forms, argCount) {
return forms.find((form) => {
const { min, max } = formArity(form);
return argCount >= min && argCount <= max;
}) ?? forms[0];
}
function getCaretCoordinates(textarea, position) {
const style = window.getComputedStyle(textarea);
const div = document.createElement("div");
@@ -766,11 +812,12 @@ export function attachAutocomplete(textarea) {
return;
}
// A variadic arg (`...`, `[sizes...]`) absorbs every argument from its position on.
const variadicAt = meta.args.findIndex((a) => a.includes("..."));
const form = pickForm(meta.forms, Math.max(ctx.argCount, ctx.argIndex + 1));
// A variadic arg (`...`) absorbs every argument from its position on.
const variadicAt = form.findIndex((a) => a.includes("..."));
let active = ctx.argIndex;
if (variadicAt !== -1 && active >= variadicAt) active = variadicAt;
const args = meta.args
const args = form
.map((a, i) => (i === active ? `<span class="mrmth-sig-active">${escapeHtml(a)}</span>` : escapeHtml(a)))
.join(", ");
+322 -322
View File
@@ -13,326 +13,326 @@ export const FUNCTIONS = new Set([
]);
export const FUNCTION_META = {
"sin": { minArgs: 1, maxArgs: 1, signature: "sin(x)", args: ["x"], description: "applies sinus function to value or each element of value", details: "", aliases: [] },
"cos": { minArgs: 1, maxArgs: 1, signature: "cos(x)", args: ["x"], description: "applies cosinus function to value or each element of value", details: "", aliases: [] },
"tan": { minArgs: 1, maxArgs: 1, signature: "tan(x)", args: ["x"], description: "applies tangents function to value or each element of value", details: "", aliases: [] },
"asin": { minArgs: 1, maxArgs: 1, signature: "asin(x)", args: ["x"], description: "applies arcus sinus function to value or each element of value", details: "", aliases: [] },
"acos": { minArgs: 1, maxArgs: 1, signature: "acos(x)", args: ["x"], description: "applies arcus cosinus function to value or each element of value", details: "", aliases: [] },
"atan": { minArgs: 1, maxArgs: 1, signature: "atan(x)", args: ["x"], description: "applies arcus tangents function to value or each element of value", details: "", aliases: [] },
"atan2": { minArgs: 2, maxArgs: 2, signature: "atan2(y, x)", args: ["y", "x"], description: "computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant", details: "", aliases: [] },
"sinh": { minArgs: 1, maxArgs: 1, signature: "sinh(x)", args: ["x"], description: "applies hyperbolic sinus function to value or each element of value", details: "", aliases: [] },
"cosh": { minArgs: 1, maxArgs: 1, signature: "cosh(x)", args: ["x"], description: "applies hyperbolic cosinus function to value or each element of value", details: "", aliases: [] },
"tanh": { minArgs: 1, maxArgs: 1, signature: "tanh(x)", args: ["x"], description: "applies hyperbolic tangents function to value or each element of value", details: "", aliases: [] },
"asinh": { minArgs: 1, maxArgs: 1, signature: "asinh(x)", args: ["x"], description: "applies hyperbolic arcus sinus function to value or each element of value", details: "", aliases: [] },
"acosh": { minArgs: 1, maxArgs: 1, signature: "acosh(x)", args: ["x"], description: "applies hyperbolic arcus cosinus function to value or each element of value", details: "", aliases: [] },
"atanh": { minArgs: 1, maxArgs: 1, signature: "atanh(x)", args: ["x"], description: "applies hyperbolic arcus tangents function to value or each element of value", details: "", aliases: [] },
"abs": { minArgs: 1, maxArgs: 1, signature: "abs(x)", args: ["x"], description: "applies per element absolute value function. Same as |x| for numbers.", details: "", aliases: [] },
"sqrt": { minArgs: 1, maxArgs: 1, signature: "sqrt(x)", args: ["x"], description: "applies sqere root per element. Negative numbers return NaN (not a number)", details: "", aliases: [] },
"ln": { minArgs: 1, maxArgs: 1, signature: "ln(x)", args: ["x"], description: "applies natural logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] },
"log": { minArgs: 1, maxArgs: 1, signature: "log(x)", args: ["x"], description: "applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] },
"log2": { minArgs: 1, maxArgs: 1, signature: "log2(x)", args: ["x"], description: "applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] },
"exp": { minArgs: 1, maxArgs: 1, signature: "exp(x)", args: ["x"], description: "applies e^x to value (per element)", details: "", aliases: [] },
"log1p": { minArgs: 1, maxArgs: 1, signature: "log1p(x)", args: ["x"], description: "applies ln(1+x) accurately for values near zero", details: "", aliases: [] },
"expm1": { minArgs: 1, maxArgs: 1, signature: "expm1(x)", args: ["x"], description: "applies exp(x)-1 accurately for values near zero", details: "", aliases: [] },
"sinc": { minArgs: 1, maxArgs: 1, signature: "sinc(x)", args: ["x"], description: "computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1", details: "", aliases: [] },
"cbrt": { minArgs: 1, maxArgs: 1, signature: "cbrt(x)", args: ["x"], description: "computes the real cube root of each value, including negative values", details: "", aliases: [] },
"reciprocal": { minArgs: 1, maxArgs: 1, signature: "reciprocal(x)", args: ["x"], description: "computes 1/x element-wise", details: "", aliases: [] },
"logaddexp": { minArgs: 2, maxArgs: 2, signature: "logaddexp(x, y)", args: ["x", "y"], description: "computes log(exp(x) + exp(y)) element-wise using a numerically stable method", details: "", aliases: [] },
"logsumexp": { minArgs: 1, maxArgs: 2, signature: "logsumexp(x, [dims])", args: ["x", "[dims]"], description: "computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions", details: "", aliases: [] },
"norm": { minArgs: 1, maxArgs: 3, signature: "norm(x, [p], [dims])", args: ["x", "[p]", "[dims]"], description: "computes the p-norm globally or along one or more dimensions (default p=2)", details: "", aliases: [] },
"normalize": { minArgs: 1, maxArgs: 4, signature: "normalize(x, [p], [dim], [eps])", args: ["x", "[p]", "[dim]", "[eps]"], description: "normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)", details: "", aliases: [] },
"group_norm": { minArgs: 2, maxArgs: 5, signature: "group_norm(x, groups, [weight], [bias], [eps])", args: ["x", "groups", "[weight]", "[bias]", "[eps]"], description: "applies channel-first GroupNorm to [N, C, ...] input", details: "", aliases: [] },
"outer": { minArgs: 2, maxArgs: 2, signature: "outer(x, y)", args: ["x", "y"], description: "computes the outer product of flattened x and y", details: "", aliases: [] },
"trace": { minArgs: 1, maxArgs: 1, signature: "trace(x)", args: ["x"], description: "sums the main diagonal of each square matrix in x", details: "", aliases: [] },
"det": { minArgs: 1, maxArgs: 1, signature: "det(x)", args: ["x"], description: "computes the determinant of each square matrix in x", details: "", aliases: [] },
"rfft": { minArgs: 1, maxArgs: 2, signature: "rfft(x, [dim])", args: ["x", "[dim]"], description: "computes the one-dimensional real-input FFT along dim (default: last dimension)", details: "", aliases: [] },
"irfft": { minArgs: 1, maxArgs: 3, signature: "irfft(x, [n], [dim])", args: ["x", "[n]", "[dim]"], description: "computes the inverse one-dimensional real FFT along dim (default: last dimension)", details: "", aliases: [] },
"isnan": { minArgs: 1, maxArgs: 1, signature: "isnan(x)", args: ["x"], description: "returns 1.0 for NaN values and 0.0 otherwise", details: "", aliases: [] },
"isinf": { minArgs: 1, maxArgs: 1, signature: "isinf(x)", args: ["x"], description: "returns 1.0 for infinite values and 0.0 otherwise", details: "", aliases: [] },
"isfinite": { minArgs: 1, maxArgs: 1, signature: "isfinite(x)", args: ["x"], description: "returns 1.0 for finite values and 0.0 otherwise", details: "", aliases: [] },
"smin": { minArgs: 1, maxArgs: null, signature: "smin(x, ...)", args: ["x", "..."], description: "computes the minimum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smin(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.", details: "", aliases: [] },
"smax": { minArgs: 1, maxArgs: null, signature: "smax(x, ...)", args: ["x", "..."], description: "computes the maximum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smax(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.", details: "", aliases: [] },
"tmin": { minArgs: 2, maxArgs: 2, signature: "tmin(x, y)", args: ["x", "y"], description: "elementwise minimum of tensor or list. min(x,y) when inputs are floats", details: "", aliases: [] },
"tmax": { minArgs: 2, maxArgs: 2, signature: "tmax(x,y)", args: ["x", "y"], description: "elementwise maximum of tensor or list. max(x,y) when inputs are floats", details: "", aliases: [] },
"tnorm": { minArgs: 1, maxArgs: 2, signature: "tnorm(x, [dim])", args: ["x", "[dim]"], description: "normalises tensor or list by multiplication such that sum(x^2)==1.0 for each slice. Defaults to the last dimension; dim selects a different slicing dimension.", details: "", aliases: [] },
"snorm": { minArgs: 1, maxArgs: 2, signature: "snorm(x,[dim])", args: ["x", "[dim]"], description: "frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.", details: "", aliases: [] },
"floor": { minArgs: 1, maxArgs: 1, signature: "floor(x)", args: ["x"], description: "returns the largest integer less than or equal to x", details: "", aliases: [] },
"ceil": { minArgs: 1, maxArgs: 1, signature: "ceil(x)", args: ["x"], description: "returns the smallest integer greater than or equal to x", details: "", aliases: [] },
"round": { minArgs: 1, maxArgs: 1, signature: "round(x)", args: ["x"], description: "rounds x to the nearest integer", details: "", aliases: [] },
"gamma": { minArgs: 1, maxArgs: 1, signature: "gamma(x)", args: ["x"], description: "computes the gamma function (per element)", details: "", aliases: [] },
"pow": { minArgs: 2, maxArgs: 2, signature: "pow(x, y)", args: ["x", "y"], description: "computes x raised to the power of y", details: "", aliases: [] },
"sigm": { minArgs: 1, maxArgs: 1, signature: "sigm(x)", args: ["x"], description: "applies the sigmoid function: 1 / (1 + exp(-x))", details: "", aliases: [] },
"clamp": { minArgs: 3, maxArgs: 3, signature: "clamp(x, min, max)", args: ["x", "min", "max"], description: "clamps x between min and max per element", details: "", aliases: [] },
"fft": { minArgs: 1, maxArgs: 1, signature: "fft(x)", args: ["x"], description: "computes fast Fourier transform of x", details: "", aliases: [] },
"ifft": { minArgs: 1, maxArgs: 2, signature: "ifft(x, [shape])", args: ["x", "[shape]"], description: "inverse fast Fourier transform of x. shape (defaults to the node's tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.", details: "", aliases: [] },
"angle": { minArgs: 1, maxArgs: 1, signature: "angle(x)", args: ["x"], description: "returns the angle of a complex number or vector", details: "", aliases: [] },
"print": { minArgs: 1, maxArgs: 1, signature: "print(x)", args: ["x"], description: "prints the value of x to the console while passing output unchanged", details: "", aliases: [] },
"print_shape": { minArgs: 1, maxArgs: 1, signature: "print_shape(x)", args: ["x"], description: "prints the shape of the tensor x", details: "", aliases: ["pshp"] },
"pshp": { minArgs: 1, maxArgs: 1, signature: "pshp(x)", args: ["x"], description: "prints the shape of the tensor x", details: "", aliases: ["print_shape"] },
"nvl": { minArgs: 4, maxArgs: 4, signature: "nvl(x, nan, pos_inf, neg_inf)", args: ["x", "nan", "pos_inf", "neg_inf"], description: "null value replacement - inspired by NVL", details: "", aliases: ["nan_to_num"] },
"nan_to_num": { minArgs: 4, maxArgs: 4, signature: "nan_to_num(x, nan, pos_inf, neg_inf)", args: ["x", "nan", "pos_inf", "neg_inf"], description: "null value replacement - inspired by NVL", details: "", aliases: ["nvl"] },
"lerp": { minArgs: 3, maxArgs: 3, signature: "lerp(a, b, t)", args: ["a", "b", "t"], description: "linear interpolation between a and b by t per element. t can be float or tensor.", details: "", aliases: [] },
"slerp": { minArgs: 3, maxArgs: 4, signature: "slerp(a, b, t, [dim])", args: ["a", "b", "t", "[dim]"], description: "interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.", details: "", aliases: [] },
"step": { minArgs: 2, maxArgs: 2, signature: "step(x, edge)", args: ["x", "edge"], description: "returns 0 if x < edge, else 1", details: "", aliases: [] },
"smoothstep": { minArgs: 3, maxArgs: 3, signature: "smoothstep(x, edge0, edge1)", args: ["x", "edge0", "edge1"], description: "smooth interpolation between edge0 and edge1", details: "", aliases: [] },
"fract": { minArgs: 1, maxArgs: 1, signature: "fract(x)", args: ["x"], description: "returns the fractional part of x: x - floor(x)", details: "", aliases: [] },
"relu": { minArgs: 1, maxArgs: 1, signature: "relu(x)", args: ["x"], description: "applies rectified linear unit function: max(0, x)", details: "", aliases: [] },
"softsign": { minArgs: 1, maxArgs: 1, signature: "softsign(x)", args: ["x"], description: "applies x / (1 + abs(x)) element-wise", details: "", aliases: [] },
"leaky_relu": { minArgs: 1, maxArgs: 2, signature: "leaky_relu(x, [negative_slope])", args: ["x", "[negative_slope]"], description: "applies leaky ReLU element-wise; negative_slope defaults to 0.01", details: "", aliases: [] },
"softplus": { minArgs: 1, maxArgs: 1, signature: "softplus(x)", args: ["x"], description: "applies the softplus function: ln(1 + exp(x))", details: "", aliases: [] },
"gelu": { minArgs: 1, maxArgs: 1, signature: "gelu(x)", args: ["x"], description: "applies the Gaussian Error Linear Unit (GELU) activation function", details: "", aliases: [] },
"silu": { minArgs: 1, maxArgs: 1, signature: "silu(x)", args: ["x"], description: "applies the Sigmoid Linear Unit activation element-wise", details: "", aliases: [] },
"sign": { minArgs: 1, maxArgs: 1, signature: "sign(x)", args: ["x"], description: "returns the sign of x: -1, 0, or 1", details: "", aliases: [] },
"degrees": { minArgs: 1, maxArgs: 1, signature: "degrees(x)", args: ["x"], description: "converts radians to degrees (per element)", details: "", aliases: [] },
"radians": { minArgs: 1, maxArgs: 1, signature: "radians(x)", args: ["x"], description: "converts degrees to radians (per element)", details: "", aliases: [] },
"logical_not": { minArgs: 1, maxArgs: 1, signature: "logical_not(x)", args: ["x"], description: "returns 1.0 where x is zero and 0.0 otherwise", details: "", aliases: [] },
"logical_and": { minArgs: 2, maxArgs: 2, signature: "logical_and(x, y)", args: ["x", "y"], description: "returns 1.0 if both values are non-zero, else 0.0", details: "", aliases: [] },
"logical_or": { minArgs: 2, maxArgs: 2, signature: "logical_or(x, y)", args: ["x", "y"], description: "returns 1.0 if either value is non-zero, else 0.0", details: "", aliases: [] },
"hypot": { minArgs: 2, maxArgs: 2, signature: "hypot(x, y)", args: ["x", "y"], description: "computes the element-wise Euclidean distance from the origin", details: "", aliases: [] },
"map": { minArgs: 2, maxArgs: 4, signature: "map(tensor, coord1, [coord2], [coord3])", args: ["tensor", "coord1", "[coord2]", "[coord3]"], description: "samples/remaps input tensor using coordinates", details: "", aliases: [] },
"ezconvolution": { minArgs: 2, maxArgs: null, signature: "ezconvolution(tensor, [kernel_sizes...], kernel)", args: ["tensor", "[kernel_sizes...]", "kernel"], description: "applies convolution with kernel. Attempts to correctly convolve over size dimensions.", details: "", aliases: ["ezconv"] },
"ezconv": { minArgs: 2, maxArgs: null, signature: "ezconv(tensor, [kernel_sizes...], kernel)", args: ["tensor", "[kernel_sizes...]", "kernel"], description: "applies convolution with kernel. Attempts to correctly convolve over size dimensions.", details: "", aliases: ["ezconvolution"] },
"convolution": { minArgs: 2, maxArgs: null, signature: "convolution(tensor, [kernel_sizes...], kernel)", args: ["tensor", "[kernel_sizes...]", "kernel"], description: "applies convolution with kernel. Expects [batch,channel, ...]", details: "", aliases: ["conv"] },
"conv": { minArgs: 2, maxArgs: null, signature: "conv(tensor, [kernel_sizes...], kernel)", args: ["tensor", "[kernel_sizes...]", "kernel"], description: "applies convolution with kernel. Expects [batch,channel, ...]", details: "", aliases: ["convolution"] },
"swap": { minArgs: 4, maxArgs: 4, signature: "swap(x, dim, idx1, idx2)", args: ["x", "dim", "idx1", "idx2"], description: "swaps elements along dim between idx1 and idx2", details: "", aliases: [] },
"transpose": { minArgs: 3, maxArgs: 3, signature: "transpose(x, dim0, dim1) / transpose(x, dim0, dim1)", args: ["x", "dim0", "dim1"], description: "swaps two tensor dimensions", details: "", aliases: ["swapaxes"] },
"swapaxes": { minArgs: 3, maxArgs: 3, signature: "swapaxes(x, dim0, dim1) / swapaxes(x, dim0, dim1)", args: ["x", "dim0", "dim1"], description: "swaps two tensor dimensions", details: "", aliases: ["transpose"] },
"permute": { minArgs: 2, maxArgs: 2, signature: "permute(x, dims)", args: ["x", "dims"], description: "permutes the dimensions of tensor x according to dims", details: "", aliases: ["perm"] },
"perm": { minArgs: 2, maxArgs: 2, signature: "perm(x, dims)", args: ["x", "dims"], description: "permutes the dimensions of tensor x according to dims", details: "", aliases: ["permute"] },
"reshape": { minArgs: 2, maxArgs: 2, signature: "reshape(x, shape)", args: ["x", "shape"], description: "reshapes tensor x to the specified shape", details: "", aliases: ["rshp"] },
"rshp": { minArgs: 2, maxArgs: 2, signature: "rshp(x, shape)", args: ["x", "shape"], description: "reshapes tensor x to the specified shape", details: "", aliases: ["reshape"] },
"range": { minArgs: 3, maxArgs: 3, signature: "range(start, stop, step)", args: ["start", "stop", "step"], description: "creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.", details: "", aliases: [] },
"linspace": { minArgs: 3, maxArgs: 3, signature: "linspace(start, stop, num)", args: ["start", "stop", "num"], description: "creates num linearly spaced values from start to stop (inclusive). Use range if you want to control the step between values.", details: "", aliases: [] },
"logspace": { minArgs: 4, maxArgs: 4, signature: "logspace(start, stop, num, base)", args: ["start", "stop", "num", "base"], description: "creates logarithmically spaced values", details: "", aliases: [] },
"topk": { minArgs: 2, maxArgs: 3, signature: "topk(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.", details: "", aliases: [] },
"botk": { minArgs: 2, maxArgs: 3, signature: "botk(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.", details: "", aliases: [] },
"pinv": { minArgs: 1, maxArgs: 1, signature: "pinv(x)", args: ["x"], description: "computes the permutative inverse of a list x (list must have uniqe elements) -- TODO: CHECK --", details: "", aliases: [] },
"inv": { minArgs: 1, maxArgs: 2, signature: "inv(x, [pseudo])", args: ["x", "[pseudo]"], description: "computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead", details: "", aliases: [] },
"sum": { minArgs: 1, maxArgs: 2, signature: "sum(x, [dims])", args: ["x", "[dims]"], description: "computes the sum of elements of x, optionally along one or more dimensions", details: "", aliases: [] },
"mean": { minArgs: 1, maxArgs: 2, signature: "mean(x, [dims])", args: ["x", "[dims]"], description: "computes the arithmetic mean of elements of x globally or along one or more dimensions", details: "", aliases: [] },
"std": { minArgs: 1, maxArgs: 2, signature: "std(x, [dims])", args: ["x", "[dims]"], description: "computes the sample standard deviation of elements of x globally or along one or more dimensions", details: "", aliases: [] },
"var": { minArgs: 1, maxArgs: 2, signature: "var(x, [dims])", args: ["x", "[dims]"], description: "computes the sample variance of elements of x globally or along one or more dimensions", details: "", aliases: [] },
"prod": { minArgs: 1, maxArgs: 2, signature: "prod(x, [dims])", args: ["x", "[dims]"], description: "computes the product of elements of x globally or along one or more dimensions", details: "", aliases: [] },
"isclose": { minArgs: 2, maxArgs: 4, signature: "isclose(a, b, [rtol], [atol])", args: ["a", "b", "[rtol]", "[atol]"], description: "elementwise approximate equality test", details: "", aliases: [] },
"allclose": { minArgs: 2, maxArgs: 4, signature: "allclose(a, b, [rtol], [atol])", args: ["a", "b", "[rtol]", "[atol]"], description: "returns 1.0 if all elements are approximately equal, else 0.0", details: "", aliases: [] },
"quartile": { minArgs: 2, maxArgs: 3, signature: "quartile(x, q, [dim])", args: ["x", "q", "[dim]"], description: "computes the q-th quartile globally or along dim", details: "", aliases: ["quartil"] },
"quartil": { minArgs: 2, maxArgs: 3, signature: "quartil(x, q, [dim])", args: ["x", "q", "[dim]"], description: "computes the q-th quartile globally or along dim", details: "", aliases: ["quartile"] },
"percentile": { minArgs: 2, maxArgs: 3, signature: "percentile(x, p, [dim])", args: ["x", "p", "[dim]"], description: "computes the p-th percentile globally or along dim", details: "", aliases: ["prcnt"] },
"prcnt": { minArgs: 2, maxArgs: 3, signature: "prcnt(x, p, [dim])", args: ["x", "p", "[dim]"], description: "computes the p-th percentile globally or along dim", details: "", aliases: ["percentile"] },
"quantile": { minArgs: 2, maxArgs: 3, signature: "quantile(x, q, [dim])", args: ["x", "q", "[dim]"], description: "computes the q-th quantile globally or along dim", details: "", aliases: [] },
"dot": { minArgs: 2, maxArgs: 2, signature: "dot(x, y)", args: ["x", "y"], description: "computes the dot product of x and y after flattening both to 1D. Use cross(x, y) if you need a per-vector product with the last dimension kept.", details: "", aliases: [] },
"moment": { minArgs: 3, maxArgs: 3, signature: "moment(x, a, k)", args: ["x", "a", "k"], description: "computes the k-th moment of x around a", details: "", aliases: [] },
"erf": { minArgs: 1, maxArgs: 1, signature: "erf(x)", args: ["x"], description: "computes the error function (torch.erf)", details: "", aliases: [] },
"erfc": { minArgs: 1, maxArgs: 1, signature: "erfc(x)", args: ["x"], description: "computes the complementary error function (torch.special.erfc)", details: "", aliases: [] },
"erfinv": { minArgs: 1, maxArgs: 1, signature: "erfinv(x)", args: ["x"], description: "computes the inverse error function (torch.erfinv)", details: "", aliases: [] },
"any": { minArgs: 1, maxArgs: 1, signature: "any(x)", args: ["x"], description: "returns 1 if any element of x is non-zero otherwise 0", details: "", aliases: [] },
"all": { minArgs: 1, maxArgs: 1, signature: "all(x)", args: ["x"], description: "returns 1 if all elements of x are non-zero otherwise 0", details: "", aliases: [] },
"edge": { minArgs: 1, maxArgs: 2, signature: "edge(x, [matrix_size])", args: ["x", "[matrix_size]"], description: "detects edges in x. Matrix size denotes the size of edge detection matrix.", details: "", aliases: [] },
"blur": { minArgs: 2, maxArgs: 3, signature: "blur(x, sigma, [reshape])", args: ["x", "sigma", "[reshape]"], description: "applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.", details: "", aliases: ["gaussian"] },
"gaussian": { minArgs: 2, maxArgs: 3, signature: "gaussian(x, sigma, [reshape])", args: ["x", "sigma", "[reshape]"], description: "applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.", details: "", aliases: ["blur"] },
"median": { minArgs: 1, maxArgs: 2, signature: "median(x, [dim])", args: ["x", "[dim]"], description: "computes the median globally or along one dimension", details: "", aliases: [] },
"mode": { minArgs: 1, maxArgs: 2, signature: "mode(x, [dim])", args: ["x", "[dim]"], description: "computes the mode globally or along one dimension", details: "", aliases: [] },
"cumsum": { minArgs: 1, maxArgs: 2, signature: "cumsum(x, [dim])", args: ["x", "[dim]"], description: "computes the cumulative sum, defaulting to the first dimension.", details: "", aliases: [] },
"cumprod": { minArgs: 1, maxArgs: 1, signature: "cumprod(x)", args: ["x"], description: "computes the cumulative product over first dimension.", details: "", aliases: [] },
"topk_ind": { minArgs: 2, maxArgs: 3, signature: "topk_ind(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the indices of the k largest elements along dim; dim defaults to the last", details: "", aliases: ["topk_indices"] },
"topk_indices": { minArgs: 2, maxArgs: 3, signature: "topk_indices(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the indices of the k largest elements along dim; dim defaults to the last", details: "", aliases: ["topk_ind"] },
"botk_ind": { minArgs: 2, maxArgs: 3, signature: "botk_ind(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the indices of the k smallest elements along dim; dim defaults to the last", details: "", aliases: ["botk_indices"] },
"botk_indices": { minArgs: 2, maxArgs: 3, signature: "botk_indices(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the indices of the k smallest elements along dim; dim defaults to the last", details: "", aliases: ["botk_ind"] },
"cubic_ease": { minArgs: 3, maxArgs: 3, signature: "cubic_ease(a, b, t)", args: ["a", "b", "t"], description: "cubic ease between a and b", details: "", aliases: ["cubic"] },
"cubic": { minArgs: 3, maxArgs: 3, signature: "cubic(a, b, t)", args: ["a", "b", "t"], description: "cubic ease between a and b", details: "", aliases: ["cubic_ease"] },
"elastic_ease": { minArgs: 3, maxArgs: 3, signature: "elastic_ease(a, b, t)", args: ["a", "b", "t"], description: "elastic ease between a and b", details: "", aliases: ["elastic"] },
"elastic": { minArgs: 3, maxArgs: 3, signature: "elastic(a, b, t)", args: ["a", "b", "t"], description: "elastic ease between a and b", details: "", aliases: ["elastic_ease"] },
"sine_ease": { minArgs: 3, maxArgs: 3, signature: "sine_ease(a, b, t)", args: ["a", "b", "t"], description: "sine easing between a and b", details: "", aliases: ["sine"] },
"sine": { minArgs: 3, maxArgs: 3, signature: "sine(a, b, t)", args: ["a", "b", "t"], description: "sine easing between a and b", details: "", aliases: ["sine_ease"] },
"smootherstep": { minArgs: 3, maxArgs: 3, signature: "smootherstep(x, edge0, edge1)", args: ["x", "edge0", "edge1"], description: "smoother interpolation between edge0 and edge1", details: "", aliases: [] },
"dist": { minArgs: 4, maxArgs: 4, signature: "dist(x1, y1, x2, y2)", args: ["x1", "y1", "x2", "y2"], description: "computes Euclidean distance between (x1, y1) and (x2, y2)", details: "", aliases: ["distance"] },
"distance": { minArgs: 4, maxArgs: 4, signature: "distance(x1, y1, x2, y2)", args: ["x1", "y1", "x2", "y2"], description: "computes Euclidean distance between (x1, y1) and (x2, y2)", details: "", aliases: ["dist"] },
"remap": { minArgs: 5, maxArgs: 5, signature: "remap(v, i_min, i_max, o_min, o_max)", args: ["v", "i_min", "i_max", "o_min", "o_max"], description: "remaps values from input range to output range", details: "", aliases: [] },
"cossim": { minArgs: 2, maxArgs: 2, signature: "cossim(x, y)", args: ["x", "y"], description: "computes the cosine similarity between x and y.", details: "", aliases: ["cosine_similarity"] },
"cosine_similarity": { minArgs: 2, maxArgs: 2, signature: "cosine_similarity(x, y)", args: ["x", "y"], description: "computes the cosine similarity between x and y.", details: "", aliases: ["cossim"] },
"count": { minArgs: 1, maxArgs: 1, signature: "count(x)", args: ["x"], description: "returns the number of elements in x", details: "", aliases: ["cnt", "length"] },
"cnt": { minArgs: 1, maxArgs: 1, signature: "cnt(x)", args: ["x"], description: "returns the number of elements in x", details: "", aliases: ["count", "length"] },
"length": { minArgs: 1, maxArgs: 1, signature: "length(x)", args: ["x"], description: "returns the number of elements in x", details: "", aliases: ["count", "cnt"] },
"keys": { minArgs: 1, maxArgs: 1, signature: "keys(x)", args: ["x"], description: "returns a list of dictionary keys in insertion order", details: "", aliases: [] },
"enable_tracking": { minArgs: 1, maxArgs: 1, signature: "enable_tracking(d)", args: ["d"], description: "enables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_on"] },
"track_on": { minArgs: 1, maxArgs: 1, signature: "track_on(d)", args: ["d"], description: "enables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["enable_tracking"] },
"disable_tracking": { minArgs: 1, maxArgs: 1, signature: "disable_tracking(d)", args: ["d"], description: "disables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_off"] },
"track_off": { minArgs: 1, maxArgs: 1, signature: "track_off(d)", args: ["d"], description: "disables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["disable_tracking"] },
"reset_tracking": { minArgs: 1, maxArgs: 1, signature: "reset_tracking(d)", args: ["d"], description: "resets change tracking state for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_reset"] },
"track_reset": { minArgs: 1, maxArgs: 1, signature: "track_reset(d)", args: ["d"], description: "resets change tracking state for ChangeTrackingDict d (returns d)", details: "", aliases: ["reset_tracking"] },
"get_changed_keys": { minArgs: 1, maxArgs: 1, signature: "get_changed_keys(d)", args: ["d"], description: "returns list of keys that were modified or added in ChangeTrackingDict d", details: "", aliases: ["changed_keys"] },
"changed_keys": { minArgs: 1, maxArgs: 1, signature: "changed_keys(d)", args: ["d"], description: "returns list of keys that were modified or added in ChangeTrackingDict d", details: "", aliases: ["get_changed_keys"] },
"get_added_keys": { minArgs: 1, maxArgs: 1, signature: "get_added_keys(d)", args: ["d"], description: "returns list of keys that were added (newly created) in ChangeTrackingDict d", details: "", aliases: ["added_keys"] },
"added_keys": { minArgs: 1, maxArgs: 1, signature: "added_keys(d)", args: ["d"], description: "returns list of keys that were added (newly created) in ChangeTrackingDict d", details: "", aliases: ["get_added_keys"] },
"get_removed_keys": { minArgs: 1, maxArgs: 1, signature: "get_removed_keys(d)", args: ["d"], description: "returns list of keys that were removed from ChangeTrackingDict d", details: "", aliases: ["removed_keys"] },
"removed_keys": { minArgs: 1, maxArgs: 1, signature: "removed_keys(d)", args: ["d"], description: "returns list of keys that were removed from ChangeTrackingDict d", details: "", aliases: ["get_removed_keys"] },
"get_unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "get_unchanged_keys(d)", args: ["d"], description: "returns list of keys that remain unchanged in ChangeTrackingDict d", details: "", aliases: ["unchanged_keys"] },
"unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "unchanged_keys(d)", args: ["d"], description: "returns list of keys that remain unchanged in ChangeTrackingDict d", details: "", aliases: ["get_unchanged_keys"] },
"repeat": { minArgs: 2, maxArgs: 3, signature: "repeat(x, count, [dims])", args: ["x", "count", "[dims]"], description: "repeats tensor elements; count may be scalar or per-dim list", details: "", aliases: [] },
"flatten": { minArgs: 1, maxArgs: 1, signature: "flatten(x)", args: ["x"], description: "flattens tensor into a 1D tensor", details: "", aliases: [] },
"append": { minArgs: 2, maxArgs: 2, signature: "append(x, y)", args: ["x", "y"], description: "appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)", details: "", aliases: [] },
"get_value": { minArgs: 2, maxArgs: 2, signature: "get_value(tensor, position)", args: ["tensor", "position"], description: "reads the value at an N-D position of tensor. Superseded by tensor[position] indexing", details: "", aliases: [] },
"flow_apply": { minArgs: 2, maxArgs: 2, signature: "flow_apply(image, flow)", args: ["image", "flow"], description: "applies optical flow to an image", details: "", aliases: [] },
"batch_shuffle": { minArgs: 2, maxArgs: 2, signature: "batch_shuffle(x, indices)", args: ["x", "indices"], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["shuffle", "select"] },
"shuffle": { minArgs: 2, maxArgs: 2, signature: "shuffle(x, indices)", args: ["x", "indices"], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["batch_shuffle", "select"] },
"select": { minArgs: 2, maxArgs: 2, signature: "select(x, indices)", args: ["x", "indices"], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["batch_shuffle", "shuffle"] },
"motion_mask": { minArgs: 1, maxArgs: 1, signature: "motion_mask(x)", args: ["x"], description: "generates a motion mask from optical flow", details: "", aliases: [] },
"flow_to_image": { minArgs: 1, maxArgs: 1, signature: "flow_to_image(x)", args: ["x"], description: "converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta.", details: "", aliases: [] },
"flow_mag": { minArgs: 1, maxArgs: 1, signature: "flow_mag(x)", args: ["x"], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", aliases: ["flow_magnitude"] },
"flow_magnitude": { minArgs: 1, maxArgs: 1, signature: "flow_magnitude(x)", args: ["x"], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", aliases: ["flow_mag"] },
"flow_ang": { minArgs: 1, maxArgs: 1, signature: "flow_ang(x)", args: ["x"], description: "computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)", details: "", aliases: ["flow_angle"] },
"flow_angle": { minArgs: 1, maxArgs: 1, signature: "flow_angle(x)", args: ["x"], description: "computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)", details: "", aliases: ["flow_ang"] },
"where": { minArgs: 3, maxArgs: 3, signature: "where(condition, x, y)", args: ["condition", "x", "y"], description: "returns x if condition is true, else y. Runs per element.", details: "", aliases: [] },
"histogram": { minArgs: 4, maxArgs: 4, signature: "histogram(x, bins, min, max)", args: ["x", "bins", "min", "max"], description: "computes histogram", details: "", aliases: ["hist"] },
"hist": { minArgs: 4, maxArgs: 4, signature: "hist(x, bins, min, max)", args: ["x", "bins", "min", "max"], description: "computes histogram", details: "", aliases: ["histogram"] },
"overlay": { minArgs: 3, maxArgs: 4, signature: "overlay(base, overlay, offset, [opacity])", args: ["base", "overlay", "offset", "[opacity]"], description: "overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.", details: "", aliases: [] },
"pad": { minArgs: 2, maxArgs: 2, signature: "pad(x, padding)", args: ["x", "padding"], description: "pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)", details: "", aliases: [] },
"cross": { minArgs: 2, maxArgs: 2, signature: "cross(x, y)", args: ["x", "y"], description: "computes the cross product of x and y. Last dimension must be 3", details: "", aliases: [] },
"matmul": { minArgs: 2, maxArgs: 2, signature: "matmul(x, y)", args: ["x", "y"], description: "computes the matrix multiplication of x and y", details: "", aliases: [] },
"solve": { minArgs: 2, maxArgs: 2, signature: "solve(A, b)", args: ["A", "b"], description: "solves the square linear system A*x=b without explicitly forming A inverse", details: "", aliases: [] },
"matrix_rank": { minArgs: 1, maxArgs: 2, signature: "matrix_rank(x, [tol])", args: ["x", "[tol]"], description: "computes the numerical rank of each matrix using optional absolute tolerance tol", details: "", aliases: [] },
"rife": { minArgs: 2, maxArgs: 5, signature: "rife(image1, image2, [tiling_size], [iterations], [multi_scale])", args: ["image1", "image2", "[tiling_size]", "[iterations]", "[multi_scale]"], description: "computes the optical flow field ([H, W, 2]) between image1 and image2 using a RAFT-based model", details: "- tiling_size: chuncks image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution\n- iterations: how many times to run the flow model. Default 12\n- multi_scale: also use low resolution of base image for giant movements. Default false", aliases: [] },
"bnot": { minArgs: 1, maxArgs: 1, signature: "bnot(x)", args: ["x"], description: "computes the bitwise NOT", details: "", aliases: ["bitwise_not"] },
"bitwise_not": { minArgs: 1, maxArgs: 1, signature: "bitwise_not(x)", args: ["x"], description: "computes the bitwise NOT", details: "", aliases: ["bnot"] },
"bitcount": { minArgs: 1, maxArgs: 1, signature: "bitcount(x)", args: ["x"], description: "returns the number of set bits", details: "", aliases: ["popcount", "popcnt"] },
"popcount": { minArgs: 1, maxArgs: 1, signature: "popcount(x)", args: ["x"], description: "returns the number of set bits", details: "", aliases: ["bitcount", "popcnt"] },
"popcnt": { minArgs: 1, maxArgs: 1, signature: "popcnt(x)", args: ["x"], description: "returns the number of set bits", details: "", aliases: ["bitcount", "popcount"] },
"shape": { minArgs: 1, maxArgs: 1, signature: "shape(x)", args: ["x"], description: "returns the shape of tensor as a list", details: "", aliases: [] },
"band": { minArgs: 2, maxArgs: 2, signature: "band(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise AND of x and y", details: "", aliases: ["bitwise_and"] },
"bitwise_and": { minArgs: 2, maxArgs: 2, signature: "bitwise_and(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise AND of x and y", details: "", aliases: ["band"] },
"bxor": { minArgs: 2, maxArgs: 2, signature: "bxor(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise XOR of x and y", details: "", aliases: ["bitwise_xor"] },
"bitwise_xor": { minArgs: 2, maxArgs: 2, signature: "bitwise_xor(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise XOR of x and y", details: "", aliases: ["bxor"] },
"bor": { minArgs: 2, maxArgs: 2, signature: "bor(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise OR of x and y", details: "", aliases: ["bitwise_or"] },
"bitwise_or": { minArgs: 2, maxArgs: 2, signature: "bitwise_or(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise OR of x and y", details: "", aliases: ["bor"] },
"tensor": { minArgs: 1, maxArgs: 3, signature: "tensor(shape, [value], [dtype_template])", args: ["shape", "[value]", "[dtype_template]"], description: "creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32", details: "", aliases: [] },
"zeros": { minArgs: 1, maxArgs: 2, signature: "zeros(shape, [dtype_template])", args: ["shape", "[dtype_template]"], description: "creates a zero-filled tensor on the current device", details: "", aliases: [] },
"ones": { minArgs: 1, maxArgs: 2, signature: "ones(shape, [dtype_template])", args: ["shape", "[dtype_template]"], description: "creates a one-filled tensor on the current device", details: "", aliases: [] },
"eye": { minArgs: 1, maxArgs: 2, signature: "eye(n, [dtype_template])", args: ["n", "[dtype_template]"], description: "creates an n-by-n identity matrix", details: "", aliases: [] },
"one_hot": { minArgs: 2, maxArgs: 2, signature: "one_hot(indices, classes)", args: ["indices", "classes"], description: "converts integer class indices to float32 one-hot vectors", details: "", aliases: [] },
"mse": { minArgs: 2, maxArgs: 3, signature: "mse(a, b, [reduction])", args: ["a", "b", "[reduction]"], description: "mean squared error; reduction is mean (default), sum, or none", details: "", aliases: [] },
"mae": { minArgs: 2, maxArgs: 3, signature: "mae(a, b, [reduction])", args: ["a", "b", "[reduction]"], description: "mean absolute error; reduction is mean (default), sum, or none", details: "", aliases: [] },
"psnr": { minArgs: 2, maxArgs: 3, signature: "psnr(a, b, [data_range])", args: ["a", "b", "[data_range]"], description: "peak signal-to-noise ratio in dB; data_range defaults to 1", details: "", aliases: [] },
"weighted_mean": { minArgs: 2, maxArgs: 3, signature: "weighted_mean(x, weights, [dims])", args: ["x", "weights", "[dims]"], description: "computes the weighted mean globally or along one or more dimensions", details: "", aliases: [] },
"huber_loss": { minArgs: 2, maxArgs: 4, signature: "huber_loss(prediction, target, [delta], [reduction])", args: ["prediction", "target", "[delta]", "[reduction]"], description: "computes Huber loss; delta defaults to 1 and reduction to mean", details: "", aliases: [] },
"cross_entropy": { minArgs: 2, maxArgs: 4, signature: "cross_entropy(logits, target, [dim], [reduction])", args: ["logits", "target", "[dim]", "[reduction]"], description: "computes cross-entropy from class logits and class indices or target probabilities", details: "", aliases: [] },
"add_key": { minArgs: 3, maxArgs: 3, signature: "add_key(dict, key, value)", args: ["dict", "key", "value"], description: "adds or replaces a dictionary entry and returns the updated dictionary", details: "", aliases: [] },
"remove_key": { minArgs: 2, maxArgs: 2, signature: "remove_key(dict, key)", args: ["dict", "key"], description: "removes a dictionary entry and returns the updated dictionary", details: "", aliases: ["rm_key"] },
"rm_key": { minArgs: 2, maxArgs: 2, signature: "rm_key(dict, key)", args: ["dict", "key"], description: "removes a dictionary entry and returns the updated dictionary", details: "", aliases: ["remove_key"] },
"stack_push": { minArgs: 2, maxArgs: 2, signature: "stack_push(slot, val)", args: ["slot", "val"], description: "pushes val onto the end of slot stack", details: "", aliases: [] },
"stack_pop": { minArgs: 1, maxArgs: 1, signature: "stack_pop(slot)", args: ["slot"], description: "removes and returns the last element of slot stack", details: "", aliases: [] },
"stack_clear": { minArgs: 1, maxArgs: 1, signature: "stack_clear(slot)", args: ["slot"], description: "clears the contents of slot stack", details: "", aliases: [] },
"stack_has": { minArgs: 1, maxArgs: 1, signature: "stack_has(slot)", args: ["slot"], description: "returns 1.0 if slot exists in stack and is not empty else returns 0.0", details: "", aliases: [] },
"stack_get": { minArgs: 1, maxArgs: 1, signature: "stack_get(slot)", args: ["slot"], description: "returns the last pushed value in slot without popping it", details: "", aliases: [] },
"cat": { minArgs: 2, maxArgs: null, signature: "cat(x, ..., dim)", args: ["x", "...", "dim"], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["concat", "concatenate"] },
"concat": { minArgs: 2, maxArgs: null, signature: "concat(x, ..., dim)", args: ["x", "...", "dim"], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["cat", "concatenate"] },
"concatenate": { minArgs: 2, maxArgs: null, signature: "concatenate(x, ..., dim)", args: ["x", "...", "dim"], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["cat", "concat"] },
"stack": { minArgs: 1, maxArgs: 2, signature: "stack(tensors, [dim])", args: ["tensors", "[dim]"], description: "stacks a list of tensors along a new dimension", details: "", aliases: [] },
"nonzero": { minArgs: 1, maxArgs: 1, signature: "nonzero(x)", args: ["x"], description: "returns an N-by-rank tensor of coordinates for nonzero elements", details: "", aliases: [] },
"int": { minArgs: 1, maxArgs: 1, signature: "int(x)", args: ["x"], description: "casts x to integer", details: "", aliases: [] },
"float": { minArgs: 1, maxArgs: 1, signature: "float(x)", args: ["x"], description: "casts x to float", details: "", aliases: [] },
"upper": { minArgs: 1, maxArgs: 1, signature: "upper(x)", args: ["x"], description: "converts string to uppercase", details: "", aliases: [] },
"lower": { minArgs: 1, maxArgs: 1, signature: "lower(x)", args: ["x"], description: "converts string to lowercase", details: "", aliases: [] },
"trim": { minArgs: 1, maxArgs: 1, signature: "trim(x)", args: ["x"], description: "removes leading and trailing whitespace from string", details: "", aliases: [] },
"split": { minArgs: 1, maxArgs: 2, signature: "split(x, [delimiter])", args: ["x", "[delimiter]"], description: "splits string to list of strings based on delimiter. Default is space.", details: "", aliases: [] },
"join": { minArgs: 1, maxArgs: 2, signature: "join(x, [separator])", args: ["x", "[separator]"], description: "joins strings in list using separator. Defalut separator is \"\". If you want to join tensors use concatinate(...)", details: "", aliases: [] },
"substring": { minArgs: 2, maxArgs: 3, signature: "substring(s, start, [length])", args: ["s", "start", "[length]"], description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string", details: "", aliases: ["substr"] },
"substr": { minArgs: 2, maxArgs: 3, signature: "substr(s, start, [length])", args: ["s", "start", "[length]"], description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string", details: "", aliases: ["substring"] },
"find": { minArgs: 2, maxArgs: 2, signature: "find(s, sub)", args: ["s", "sub"], description: "returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings.", details: "", aliases: [] },
"replace": { minArgs: 3, maxArgs: 3, signature: "replace(s, old, new)", args: ["s", "old", "new"], description: "replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.", details: "", aliases: [] },
"dilate": { minArgs: 1, maxArgs: 2, signature: "dilate(x, [kernel])", args: ["x", "[kernel]"], description: "applies dilation to x. kernel is optional.", details: "", aliases: [] },
"erode": { minArgs: 1, maxArgs: 2, signature: "erode(x, [kernel])", args: ["x", "[kernel]"], description: "applies erosion to x. kernel is size of used matrix.", details: "", aliases: [] },
"morph_open": { minArgs: 1, maxArgs: 2, signature: "morph_open(x, [kernel])", args: ["x", "[kernel]"], description: "applies morphological opening to x. kernel is size of used matrix.", details: "", aliases: [] },
"morph_close": { minArgs: 1, maxArgs: 2, signature: "morph_close(x, [kernel])", args: ["x", "[kernel]"], description: "applies morphological closing to x. kernel is size of used matrix.", details: "", aliases: [] },
"rgb_to_oklab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_oklab(r, [g], [b])", args: ["r", "[g]", "[b]"], description: "converts RGB to OKLab. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.", details: "", aliases: [] },
"rgb_to_cielab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_cielab(r, [g], [b])", args: ["r", "[g]", "[b]"], description: "converts RGB to CIELAB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.", details: "", aliases: [] },
"oklab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)", args: ["oklab"], description: "converts OKLab to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.", details: "", aliases: [] },
"cielab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)", args: ["cielab"], description: "converts CIELAB to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.", details: "", aliases: [] },
"rgb_to_hsv": { minArgs: 1, maxArgs: 4, signature: "rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees])", args: ["rgb", "[degrees]"], description: "converts RGB to HSV. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting. If degrees is specified and nonzero it returns hue as 0-360 instead of 0-1", details: "", aliases: [] },
"hsv_to_rgb": { minArgs: 1, maxArgs: 4, signature: "hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees])", args: ["hsv", "[degrees]"], description: "converts HSV to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.", details: "", aliases: [] },
"int_to_rgb": { minArgs: 1, maxArgs: 1, signature: "int_to_rgb(val)", args: ["val"], description: "converts an integer to an RGB color. If input is tensor it stacks the resulting R, G and B tensors using last dimension. If It is list, List of lists is returned and if value, 3 long list is returned.", details: "", aliases: [] },
"rgb_to_int": { minArgs: 1, maxArgs: 3, signature: "rgb_to_int(r, [g, b])", args: ["r", "[g", "b]"], description: "converts RGB components to an integer It uses last dimension of tensor (or list) as R,G,B if one value. Othervise uses whole thing as channel.", details: "", aliases: [] },
"interpolate_linear": { minArgs: 2, maxArgs: 2, signature: "interpolate_linear(x, y)", args: ["x", "y"], description: "performs linear interpolation on X. Assumes that dim 0 is batch and dim 1 = channel", details: "", aliases: [] },
"interpolate_area": { minArgs: 2, maxArgs: 2, signature: "interpolate_area(x, y)", args: ["x", "y"], description: "performs area interpolation X. Assumes that dim 0 is batch and dim 1 = channel", details: "", aliases: [] },
"interpolate_nearest": { minArgs: 2, maxArgs: 2, signature: "interpolate_nearest(x, y)", args: ["x", "y"], description: "performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel", details: "", aliases: ["interpolate_nearest_exact"] },
"interpolate_nearest_exact": { minArgs: 2, maxArgs: 2, signature: "interpolate_nearest_exact(x, y)", args: ["x", "y"], description: "performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel", details: "", aliases: ["interpolate_nearest"] },
"text_image": { minArgs: 3, maxArgs: 9, signature: "text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline])", args: ["text", "font", "size", "[max_width]", "[weight]", "[rotation_angle]", "[line_spacing]", "[italic]", "[underline]"], description: "renders text to an 2D tensor", details: "", aliases: [] },
"as_nested_tensor": { minArgs: 1, maxArgs: 1, signature: "as_nested_tensor(x)", args: ["x"], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", aliases: ["as_nested"] },
"as_nested": { minArgs: 1, maxArgs: 1, signature: "as_nested(x)", args: ["x"], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", aliases: ["as_nested_tensor"] },
"svd": { minArgs: 1, maxArgs: 2, signature: "svd(x, [full_matrices])", args: ["x", "[full_matrices]"], description: "computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)", details: "", aliases: ["singular_value_decomposition"] },
"singular_value_decomposition": { minArgs: 1, maxArgs: 2, signature: "singular_value_decomposition(x, [full_matrices])", args: ["x", "[full_matrices]"], description: "computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)", details: "", aliases: ["svd"] },
"diagonal_matrix": { minArgs: 2, maxArgs: 5, signature: "diagonal_matrix(x, shape, [offset], [dim1], [dim2])", args: ["x", "shape", "[offset]", "[dim1]", "[dim2]"], description: "creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.", details: "", aliases: ["diag"] },
"diag": { minArgs: 2, maxArgs: 5, signature: "diag(x, shape, [offset], [dim1], [dim2])", args: ["x", "shape", "[offset]", "[dim1]", "[dim2]"], description: "creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.", details: "", aliases: ["diagonal_matrix"] },
"timestamp": { minArgs: 0, maxArgs: 0, signature: "timestamp()", args: [], description: "returns the current system timestamp", details: "", aliases: ["now"] },
"now": { minArgs: 0, maxArgs: 0, signature: "now()", args: [], description: "returns the current system timestamp", details: "", aliases: ["timestamp"] },
"sort": { minArgs: 1, maxArgs: 3, signature: "sort(x, [desc], [dim])", args: ["x", "[desc]", "[dim]"], description: "returns a sorted version of x (If input is tensor, it sorts the last dimension)", details: "", aliases: [] },
"argsort": { minArgs: 1, maxArgs: 3, signature: "argsort(x, [desc], [dim])", args: ["x", "[desc]", "[dim]"], description: "returns the indices that would sort x. desc defaults to ascending and dim defaults to the last dimension.", details: "", aliases: [] },
"argmin": { minArgs: 1, maxArgs: 3, signature: "argmin(x, [as_position], [dim])", args: ["x", "[as_position]", "[dim]"], description: "returns the minimum index globally or along dim; as_position returns global coordinates", details: "", aliases: [] },
"argmax": { minArgs: 1, maxArgs: 3, signature: "argmax(x, [as_position], [dim])", args: ["x", "[as_position]", "[dim]"], description: "returns the maximum index globally or along dim; as_position returns global coordinates", details: "", aliases: [] },
"softmax": { minArgs: 1, maxArgs: 2, signature: "softmax(x, [axis])", args: ["x", "[axis]"], description: "applies the softmax function to x (sum of slice == 1.0 and max value <= 1.0). axis defaults to last.", details: "", aliases: [] },
"softmin": { minArgs: 1, maxArgs: 2, signature: "softmin(x, [axis])", args: ["x", "[axis]"], description: "applies the softmin function to x (same as softmax(-x,[axis])). axis defaults to last.", details: "", aliases: [] },
"unique": { minArgs: 1, maxArgs: 1, signature: "unique(x)", args: ["x"], description: "returns the unique elements (sorted, flatened)", details: "", aliases: [] },
"flip": { minArgs: 2, maxArgs: 2, signature: "flip(x, dims)", args: ["x", "dims"], description: "reverses the order of elements along the specified dimensions. Works also for text and list with dims=0", details: "", aliases: [] },
"startswith": { minArgs: 2, maxArgs: 2, signature: "startswith(text, prefix)", args: ["text", "prefix"], description: "returns 1 if text starts with prefix, else 0", details: "", aliases: [] },
"endswith": { minArgs: 2, maxArgs: 2, signature: "endswith(text, suffix)", args: ["text", "suffix"], description: "returns 1 if text ends with suffix, else 0", details: "", aliases: [] },
"squeeze": { minArgs: 1, maxArgs: 2, signature: "squeeze(x, [dim])", args: ["x", "[dim]"], description: "removes size-1 dimensions from tensor x, optionally at dim", details: "", aliases: [] },
"unsqueeze": { minArgs: 2, maxArgs: 2, signature: "unsqueeze(x, dim)", args: ["x", "dim"], description: "inserts a size-1 dimension into tensor x at dim", details: "", aliases: [] },
"roll": { minArgs: 2, maxArgs: 3, signature: "roll(x, shifts, [axis])", args: ["x", "shifts", "[axis]"], description: "rolls tensor x along axis", details: "", aliases: [] },
"cov": { minArgs: 2, maxArgs: 2, signature: "cov(x, y)", args: ["x", "y"], description: "computes the covariance matrix of x and y", details: "", aliases: [] },
"corr": { minArgs: 2, maxArgs: 2, signature: "corr(x, y)", args: ["x", "y"], description: "computes the correlation between x and y", details: "", aliases: ["correlation"] },
"correlation": { minArgs: 2, maxArgs: 2, signature: "correlation(x, y)", args: ["x", "y"], description: "computes the correlation between x and y", details: "", aliases: ["corr"] },
"entropy": { minArgs: 1, maxArgs: 1, signature: "entropy(x)", args: ["x"], description: "computes shanon entropy", details: "", aliases: [] },
"crop": { minArgs: 3, maxArgs: 3, signature: "crop(x, start, size)", args: ["x", "start", "size"], description: "crops tensor x. Take size and begin at start. start should be the low corner. The result is at most size (if size is bigger then rest of tensor).", details: "", aliases: [] },
"coords": { minArgs: 2, maxArgs: 3, signature: "coords(shape, dim, [dtype])", args: ["shape", "dim", "[dtype]"], description: "generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor.", details: "", aliases: ["coordinates"] },
"coordinates": { minArgs: 2, maxArgs: 3, signature: "coordinates(shape, dim, [dtype])", args: ["shape", "dim", "[dtype]"], description: "generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor.", details: "", aliases: ["coords"] },
"gather": { minArgs: 3, maxArgs: 3, signature: "gather(x, dim, idx)", args: ["x", "dim", "idx"], description: "gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.", details: "", aliases: [] },
"scatter": { minArgs: 4, maxArgs: 4, signature: "scatter(x, dim, idx, src)", args: ["x", "dim", "idx", "src"], description: "scatters elements from src into x along dim using the indices specified in idx. The output tensor has the same shape as x.", details: "", aliases: [] },
"scatter_add": { minArgs: 4, maxArgs: 4, signature: "scatter_add(x, dim, idx, src)", args: ["x", "dim", "idx", "src"], description: "scatters elements from src into x along dim using the indices specified in idx, adding to existing values. The output tensor has the same shape as x.", details: "", aliases: [] },
"noise": { minArgs: 1, maxArgs: 2, signature: "noise(seed, [shape])", args: ["seed", "[shape]"], description: "generates normally distributed random noise", details: "", aliases: ["randn", "random_normal"] },
"randn": { minArgs: 1, maxArgs: 2, signature: "randn(seed, [shape])", args: ["seed", "[shape]"], description: "generates normally distributed random noise", details: "", aliases: ["noise", "random_normal"] },
"random_normal": { minArgs: 1, maxArgs: 2, signature: "random_normal(seed, [shape])", args: ["seed", "[shape]"], description: "generates normally distributed random noise", details: "", aliases: ["noise", "randn"] },
"pink_noise": { minArgs: 1, maxArgs: 2, signature: "pink_noise(seed, [shape])", args: ["seed", "[shape]"], description: "generates deterministic pink noise (approximately 1/f power spectrum), normalised per row", details: "", aliases: ["pink"] },
"pink": { minArgs: 1, maxArgs: 2, signature: "pink(seed, [shape])", args: ["seed", "[shape]"], description: "generates deterministic pink noise (approximately 1/f power spectrum), normalised per row", details: "", aliases: ["pink_noise"] },
"brown_noise": { minArgs: 1, maxArgs: 2, signature: "brown_noise(seed, [shape])", args: ["seed", "[shape]"], description: "generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row", details: "", aliases: ["brown"] },
"brown": { minArgs: 1, maxArgs: 2, signature: "brown(seed, [shape])", args: ["seed", "[shape]"], description: "generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row", details: "", aliases: ["brown_noise"] },
"rand": { minArgs: 1, maxArgs: 2, signature: "rand(seed, [shape])", args: ["seed", "[shape]"], description: "generates uniformly distributed random noise", details: "", aliases: ["randu", "random_uniform"] },
"randu": { minArgs: 1, maxArgs: 2, signature: "randu(seed, [shape])", args: ["seed", "[shape]"], description: "generates uniformly distributed random noise", details: "", aliases: ["rand", "random_uniform"] },
"random_uniform": { minArgs: 1, maxArgs: 2, signature: "random_uniform(seed, [shape])", args: ["seed", "[shape]"], description: "generates uniformly distributed random noise", details: "", aliases: ["rand", "randu"] },
"randc": { minArgs: 3, maxArgs: 4, signature: "randc(seed, median, sigma, [shape])", args: ["seed", "median", "sigma", "[shape]"], description: "generates Cauchy distributed random values.", details: "", aliases: ["random_cauchy"] },
"random_cauchy": { minArgs: 3, maxArgs: 4, signature: "random_cauchy(seed, median, sigma, [shape])", args: ["seed", "median", "sigma", "[shape]"], description: "generates Cauchy distributed random values.", details: "", aliases: ["randc"] },
"rande": { minArgs: 2, maxArgs: 3, signature: "rande(seed, lambda, [shape])", args: ["seed", "lambda", "[shape]"], description: "generates exponentially distributed random values", details: "", aliases: ["random_exponential"] },
"random_exponential": { minArgs: 2, maxArgs: 3, signature: "random_exponential(seed, lambda, [shape])", args: ["seed", "lambda", "[shape]"], description: "generates exponentially distributed random values", details: "", aliases: ["rande"] },
"randln": { minArgs: 3, maxArgs: 4, signature: "randln(seed, mean, std, [shape])", args: ["seed", "mean", "std", "[shape]"], description: "generates log-normally distributed random values.", details: "", aliases: ["random_log_normal"] },
"random_log_normal": { minArgs: 3, maxArgs: 4, signature: "random_log_normal(seed, mean, std, [shape])", args: ["seed", "mean", "std", "[shape]"], description: "generates log-normally distributed random values.", details: "", aliases: ["randln"] },
"randb": { minArgs: 2, maxArgs: 3, signature: "randb(seed, probability, [shape])", args: ["seed", "probability", "[shape]"], description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor", details: "", aliases: ["random_bernoulli"] },
"random_bernoulli": { minArgs: 2, maxArgs: 3, signature: "random_bernoulli(seed, probability, [shape])", args: ["seed", "probability", "[shape]"], description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor", details: "", aliases: ["randb"] },
"randp": { minArgs: 2, maxArgs: 3, signature: "randp(seed, lambda, [shape])", args: ["seed", "lambda", "[shape]"], description: "generates Poisson distributed random values.", details: "", aliases: ["random_poisson"] },
"random_poisson": { minArgs: 2, maxArgs: 3, signature: "random_poisson(seed, lambda, [shape])", args: ["seed", "lambda", "[shape]"], description: "generates Poisson distributed random values.", details: "", aliases: ["randp"] },
"randg": { minArgs: 3, maxArgs: 4, signature: "randg(seed, shape_param, scale, [shape])", args: ["seed", "shape_param", "scale", "[shape]"], description: "generates Gamma distributed random values.", details: "", aliases: ["random_gamma"] },
"random_gamma": { minArgs: 3, maxArgs: 4, signature: "random_gamma(seed, shape_param, scale, [shape])", args: ["seed", "shape_param", "scale", "[shape]"], description: "generates Gamma distributed random values.", details: "", aliases: ["randg"] },
"randbeta": { minArgs: 3, maxArgs: 4, signature: "randbeta(seed, alpha, beta, [shape])", args: ["seed", "alpha", "beta", "[shape]"], description: "generates Beta distributed random values", details: "", aliases: ["random_beta"] },
"random_beta": { minArgs: 3, maxArgs: 4, signature: "random_beta(seed, alpha, beta, [shape])", args: ["seed", "alpha", "beta", "[shape]"], description: "generates Beta distributed random values", details: "", aliases: ["randbeta"] },
"randl": { minArgs: 3, maxArgs: 4, signature: "randl(seed, loc, scale, [shape])", args: ["seed", "loc", "scale", "[shape]"], description: "generates Laplace distributed random values", details: "", aliases: ["random_laplace"] },
"random_laplace": { minArgs: 3, maxArgs: 4, signature: "random_laplace(seed, loc, scale, [shape])", args: ["seed", "loc", "scale", "[shape]"], description: "generates Laplace distributed random values", details: "", aliases: ["randl"] },
"randgumbel": { minArgs: 3, maxArgs: 4, signature: "randgumbel(seed, loc, scale, [shape])", args: ["seed", "loc", "scale", "[shape]"], description: "generates Gumbel distributed random values", details: "", aliases: ["random_gumbel"] },
"random_gumbel": { minArgs: 3, maxArgs: 4, signature: "random_gumbel(seed, loc, scale, [shape])", args: ["seed", "loc", "scale", "[shape]"], description: "generates Gumbel distributed random values", details: "", aliases: ["randgumbel"] },
"randw": { minArgs: 3, maxArgs: 4, signature: "randw(seed, scale, concentration, [shape])", args: ["seed", "scale", "concentration", "[shape]"], description: "generates Weibull distributed random values", details: "", aliases: ["random_weibull"] },
"random_weibull": { minArgs: 3, maxArgs: 4, signature: "random_weibull(seed, scale, concentration, [shape])", args: ["seed", "scale", "concentration", "[shape]"], description: "generates Weibull distributed random values", details: "", aliases: ["randw"] },
"randchi2": { minArgs: 2, maxArgs: 3, signature: "randchi2(seed, df, [shape])", args: ["seed", "df", "[shape]"], description: "generates Chi-squared distributed random values", details: "", aliases: ["random_chi2"] },
"random_chi2": { minArgs: 2, maxArgs: 3, signature: "random_chi2(seed, df, [shape])", args: ["seed", "df", "[shape]"], description: "generates Chi-squared distributed random values", details: "", aliases: ["randchi2"] },
"randt": { minArgs: 2, maxArgs: 3, signature: "randt(seed, df, [shape])", args: ["seed", "df", "[shape]"], description: "generates Student-t distributed random values", details: "", aliases: ["random_studentt"] },
"random_studentt": { minArgs: 2, maxArgs: 3, signature: "random_studentt(seed, df, [shape])", args: ["seed", "df", "[shape]"], description: "generates Student-t distributed random values", details: "", aliases: ["randt"] },
"perlin": { minArgs: 2, maxArgs: 5, signature: "perlin(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates Perlin noise", details: "", aliases: ["perlin_noise"] },
"perlin_noise": { minArgs: 2, maxArgs: 5, signature: "perlin_noise(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates Perlin noise", details: "", aliases: ["perlin"] },
"cellular": { minArgs: 2, maxArgs: 5, signature: "cellular(seed, scale, [jitter], [offset], [shape])", args: ["seed", "scale", "[jitter]", "[offset]", "[shape]"], description: "generates Cellular/Voronoi noise", details: "", aliases: ["voronoi", "worley", "cellular_noise", "voronoi_noise"] },
"voronoi": { minArgs: 2, maxArgs: 5, signature: "voronoi(seed, scale, [jitter], [offset], [shape])", args: ["seed", "scale", "[jitter]", "[offset]", "[shape]"], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "worley", "cellular_noise", "voronoi_noise"] },
"worley": { minArgs: 2, maxArgs: 5, signature: "worley(seed, scale, [jitter], [offset], [shape])", args: ["seed", "scale", "[jitter]", "[offset]", "[shape]"], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "voronoi", "cellular_noise", "voronoi_noise"] },
"cellular_noise": { minArgs: 2, maxArgs: 5, signature: "cellular_noise(seed, scale, [jitter], [offset], [shape])", args: ["seed", "scale", "[jitter]", "[offset]", "[shape]"], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "voronoi", "worley", "voronoi_noise"] },
"voronoi_noise": { minArgs: 2, maxArgs: 5, signature: "voronoi_noise(seed, scale, [jitter], [offset], [shape])", args: ["seed", "scale", "[jitter]", "[offset]", "[shape]"], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "voronoi", "worley", "cellular_noise"] },
"plasma": { minArgs: 2, maxArgs: 5, signature: "plasma(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4", details: "", aliases: ["turbulence", "plasma_noise"] },
"turbulence": { minArgs: 2, maxArgs: 5, signature: "turbulence(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4", details: "", aliases: ["plasma", "plasma_noise"] },
"plasma_noise": { minArgs: 2, maxArgs: 5, signature: "plasma_noise(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4", details: "", aliases: ["plasma", "turbulence"] },
"ridged": { minArgs: 2, maxArgs: 5, signature: "ridged(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates ridged multi-fractal noise", details: "", aliases: ["ridged_noise"] },
"ridged_noise": { minArgs: 2, maxArgs: 5, signature: "ridged_noise(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates ridged multi-fractal noise", details: "", aliases: ["ridged"] },
"domain_warp": { minArgs: 4, maxArgs: 8, signature: "domain_warp(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])", args: ["seed", "scale", "warp_scale", "warp_strength", "[octaves]", "[warp_octaves]", "[offset]", "[shape]"], description: "generates domain warped noise", details: "", aliases: ["domain_warp_noise"] },
"domain_warp_noise": { minArgs: 4, maxArgs: 8, signature: "domain_warp_noise(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])", args: ["seed", "scale", "warp_scale", "warp_strength", "[octaves]", "[warp_octaves]", "[offset]", "[shape]"], description: "generates domain warped noise", details: "", aliases: ["domain_warp"] },
"sin": { minArgs: 1, maxArgs: 1, signature: "sin(x)", forms: [["x"]], description: "applies sine function to value or each element of value", details: "", aliases: [] },
"cos": { minArgs: 1, maxArgs: 1, signature: "cos(x)", forms: [["x"]], description: "applies cosine function to value or each element of value", details: "", aliases: [] },
"tan": { minArgs: 1, maxArgs: 1, signature: "tan(x)", forms: [["x"]], description: "applies tangent function to value or each element of value", details: "", aliases: [] },
"asin": { minArgs: 1, maxArgs: 1, signature: "asin(x)", forms: [["x"]], description: "applies arcus sine function to value or each element of value", details: "", aliases: [] },
"acos": { minArgs: 1, maxArgs: 1, signature: "acos(x)", forms: [["x"]], description: "applies arcus cosine function to value or each element of value", details: "", aliases: [] },
"atan": { minArgs: 1, maxArgs: 1, signature: "atan(x)", forms: [["x"]], description: "applies arcus tangent function to value or each element of value", details: "", aliases: [] },
"atan2": { minArgs: 2, maxArgs: 2, signature: "atan2(y, x)", forms: [["y", "x"]], description: "computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant", details: "", aliases: [] },
"sinh": { minArgs: 1, maxArgs: 1, signature: "sinh(x)", forms: [["x"]], description: "applies hyperbolic sine function to value or each element of value", details: "", aliases: [] },
"cosh": { minArgs: 1, maxArgs: 1, signature: "cosh(x)", forms: [["x"]], description: "applies hyperbolic cosine function to value or each element of value", details: "", aliases: [] },
"tanh": { minArgs: 1, maxArgs: 1, signature: "tanh(x)", forms: [["x"]], description: "applies hyperbolic tangent function to value or each element of value", details: "", aliases: [] },
"asinh": { minArgs: 1, maxArgs: 1, signature: "asinh(x)", forms: [["x"]], description: "applies hyperbolic arcus sine function to value or each element of value", details: "", aliases: [] },
"acosh": { minArgs: 1, maxArgs: 1, signature: "acosh(x)", forms: [["x"]], description: "applies hyperbolic arcus cosine function to value or each element of value", details: "", aliases: [] },
"atanh": { minArgs: 1, maxArgs: 1, signature: "atanh(x)", forms: [["x"]], description: "applies hyperbolic arcus tangent function to value or each element of value", details: "", aliases: [] },
"abs": { minArgs: 1, maxArgs: 1, signature: "abs(x)", forms: [["x"]], description: "applies per element absolute value function. Same as |x| for numbers.", details: "", aliases: [] },
"sqrt": { minArgs: 1, maxArgs: 1, signature: "sqrt(x)", forms: [["x"]], description: "applies square root per element. Negative numbers return NaN (not a number)", details: "", aliases: [] },
"ln": { minArgs: 1, maxArgs: 1, signature: "ln(x)", forms: [["x"]], description: "applies natural logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] },
"log": { minArgs: 1, maxArgs: 1, signature: "log(x)", forms: [["x"]], description: "applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] },
"log2": { minArgs: 1, maxArgs: 1, signature: "log2(x)", forms: [["x"]], description: "applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] },
"exp": { minArgs: 1, maxArgs: 1, signature: "exp(x)", forms: [["x"]], description: "applies e^x to value (per element)", details: "", aliases: [] },
"log1p": { minArgs: 1, maxArgs: 1, signature: "log1p(x)", forms: [["x"]], description: "applies ln(1+x) accurately for values near zero", details: "", aliases: [] },
"expm1": { minArgs: 1, maxArgs: 1, signature: "expm1(x)", forms: [["x"]], description: "applies exp(x)-1 accurately for values near zero", details: "", aliases: [] },
"sinc": { minArgs: 1, maxArgs: 1, signature: "sinc(x)", forms: [["x"]], description: "computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1", details: "", aliases: [] },
"cbrt": { minArgs: 1, maxArgs: 1, signature: "cbrt(x)", forms: [["x"]], description: "computes the real cube root of each value, including negative values", details: "", aliases: [] },
"reciprocal": { minArgs: 1, maxArgs: 1, signature: "reciprocal(x)", forms: [["x"]], description: "computes 1/x element-wise", details: "", aliases: [] },
"logaddexp": { minArgs: 2, maxArgs: 2, signature: "logaddexp(x, y)", forms: [["x", "y"]], description: "computes log(exp(x) + exp(y)) element-wise using a numerically stable method", details: "", aliases: [] },
"logsumexp": { minArgs: 1, maxArgs: 2, signature: "logsumexp(x, [dims])", forms: [["x", "[dims]"]], description: "computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions", details: "", aliases: [] },
"norm": { minArgs: 1, maxArgs: 3, signature: "norm(x, [p], [dims])", forms: [["x", "[p]", "[dims]"]], description: "computes the p-norm globally or along one or more dimensions (default p=2)", details: "", aliases: [] },
"normalize": { minArgs: 1, maxArgs: 4, signature: "normalize(x, [p], [dim], [eps])", forms: [["x", "[p]", "[dim]", "[eps]"]], description: "normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)", details: "", aliases: [] },
"group_norm": { minArgs: 2, maxArgs: 5, signature: "group_norm(x, groups, [weight], [bias], [eps])", forms: [["x", "groups", "[weight]", "[bias]", "[eps]"]], description: "applies channel-first GroupNorm to [N, C, ...] input", details: "", aliases: [] },
"outer": { minArgs: 2, maxArgs: 2, signature: "outer(x, y)", forms: [["x", "y"]], description: "computes the outer product of flattened x and y", details: "", aliases: [] },
"trace": { minArgs: 1, maxArgs: 1, signature: "trace(x)", forms: [["x"]], description: "sums the main diagonal of each square matrix in x", details: "", aliases: [] },
"det": { minArgs: 1, maxArgs: 1, signature: "det(x)", forms: [["x"]], description: "computes the determinant of each square matrix in x", details: "", aliases: [] },
"rfft": { minArgs: 1, maxArgs: 2, signature: "rfft(x, [dim])", forms: [["x", "[dim]"]], description: "computes the one-dimensional real-input FFT along dim (default: last dimension)", details: "", aliases: [] },
"irfft": { minArgs: 1, maxArgs: 3, signature: "irfft(x, [n], [dim])", forms: [["x", "[n]", "[dim]"]], description: "computes the inverse one-dimensional real FFT along dim (default: last dimension)", details: "", aliases: [] },
"isnan": { minArgs: 1, maxArgs: 1, signature: "isnan(x)", forms: [["x"]], description: "returns 1.0 for NaN values and 0.0 otherwise", details: "", aliases: [] },
"isinf": { minArgs: 1, maxArgs: 1, signature: "isinf(x)", forms: [["x"]], description: "returns 1.0 for infinite values and 0.0 otherwise", details: "", aliases: [] },
"isfinite": { minArgs: 1, maxArgs: 1, signature: "isfinite(x)", forms: [["x"]], description: "returns 1.0 for finite values and 0.0 otherwise", details: "", aliases: [] },
"smin": { minArgs: 1, maxArgs: null, signature: "smin(x, ...)", forms: [["x", "..."]], description: "computes the minimum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smin(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.", details: "", aliases: [] },
"smax": { minArgs: 1, maxArgs: null, signature: "smax(x, ...)", forms: [["x", "..."]], description: "computes the maximum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smax(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.", details: "", aliases: [] },
"tmin": { minArgs: 2, maxArgs: 2, signature: "tmin(x, y)", forms: [["x", "y"]], description: "elementwise minimum of tensor or list. min(x,y) when inputs are floats", details: "", aliases: [] },
"tmax": { minArgs: 2, maxArgs: 2, signature: "tmax(x,y)", forms: [["x", "y"]], description: "elementwise maximum of tensor or list. max(x,y) when inputs are floats", details: "", aliases: [] },
"tnorm": { minArgs: 1, maxArgs: 2, signature: "tnorm(x, [dim])", forms: [["x", "[dim]"]], description: "normalises tensor or list by multiplication such that sum(x^2)==1.0 for each slice. Defaults to the last dimension; dim selects a different slicing dimension.", details: "", aliases: [] },
"snorm": { minArgs: 1, maxArgs: 2, signature: "snorm(x,[dim])", forms: [["x", "[dim]"]], description: "frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.", details: "", aliases: [] },
"floor": { minArgs: 1, maxArgs: 1, signature: "floor(x)", forms: [["x"]], description: "returns the largest integer less than or equal to x", details: "", aliases: [] },
"ceil": { minArgs: 1, maxArgs: 1, signature: "ceil(x)", forms: [["x"]], description: "returns the smallest integer greater than or equal to x", details: "", aliases: [] },
"round": { minArgs: 1, maxArgs: 1, signature: "round(x)", forms: [["x"]], description: "rounds x to the nearest integer", details: "", aliases: [] },
"gamma": { minArgs: 1, maxArgs: 1, signature: "gamma(x)", forms: [["x"]], description: "computes the gamma function (per element)", details: "", aliases: [] },
"pow": { minArgs: 2, maxArgs: 2, signature: "pow(x, y)", forms: [["x", "y"]], description: "computes x raised to the power of y", details: "", aliases: [] },
"sigm": { minArgs: 1, maxArgs: 1, signature: "sigm(x)", forms: [["x"]], description: "applies the sigmoid function: 1 / (1 + exp(-x))", details: "", aliases: [] },
"clamp": { minArgs: 3, maxArgs: 3, signature: "clamp(x, min, max)", forms: [["x", "min", "max"]], description: "clamps x between min and max per element", details: "", aliases: [] },
"fft": { minArgs: 1, maxArgs: 1, signature: "fft(x)", forms: [["x"]], description: "computes fast Fourier transform of x", details: "", aliases: [] },
"ifft": { minArgs: 1, maxArgs: 2, signature: "ifft(x, [shape])", forms: [["x", "[shape]"]], description: "inverse fast Fourier transform of x. shape (defaults to the node's tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.", details: "", aliases: [] },
"angle": { minArgs: 1, maxArgs: 1, signature: "angle(x)", forms: [["x"]], description: "returns the angle of a complex number or vector", details: "", aliases: [] },
"print": { minArgs: 1, maxArgs: 1, signature: "print(x)", forms: [["x"]], description: "prints the value of x to the console while passing output unchanged", details: "", aliases: [] },
"print_shape": { minArgs: 1, maxArgs: 1, signature: "print_shape(x)", forms: [["x"]], description: "prints the shape of the tensor x", details: "", aliases: ["pshp"] },
"pshp": { minArgs: 1, maxArgs: 1, signature: "pshp(x)", forms: [["x"]], description: "prints the shape of the tensor x", details: "", aliases: ["print_shape"] },
"nvl": { minArgs: 4, maxArgs: 4, signature: "nvl(x, nan, pos_inf, neg_inf)", forms: [["x", "nan", "pos_inf", "neg_inf"]], description: "replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)", details: "", aliases: ["nan_to_num"] },
"nan_to_num": { minArgs: 4, maxArgs: 4, signature: "nan_to_num(x, nan, pos_inf, neg_inf)", forms: [["x", "nan", "pos_inf", "neg_inf"]], description: "replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)", details: "", aliases: ["nvl"] },
"lerp": { minArgs: 3, maxArgs: 3, signature: "lerp(a, b, t)", forms: [["a", "b", "t"]], description: "linear interpolation between a and b by t per element. t can be float or tensor.", details: "", aliases: [] },
"slerp": { minArgs: 3, maxArgs: 4, signature: "slerp(a, b, t, [dim])", forms: [["a", "b", "t", "[dim]"]], description: "interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.", details: "", aliases: [] },
"step": { minArgs: 2, maxArgs: 2, signature: "step(x, edge)", forms: [["x", "edge"]], description: "returns 0 if x < edge, else 1", details: "", aliases: [] },
"smoothstep": { minArgs: 3, maxArgs: 3, signature: "smoothstep(x, edge0, edge1)", forms: [["x", "edge0", "edge1"]], description: "smooth interpolation between edge0 and edge1", details: "", aliases: [] },
"fract": { minArgs: 1, maxArgs: 1, signature: "fract(x)", forms: [["x"]], description: "returns the fractional part of x: x - floor(x)", details: "", aliases: [] },
"relu": { minArgs: 1, maxArgs: 1, signature: "relu(x)", forms: [["x"]], description: "applies rectified linear unit function: max(0, x)", details: "", aliases: [] },
"softsign": { minArgs: 1, maxArgs: 1, signature: "softsign(x)", forms: [["x"]], description: "applies x / (1 + abs(x)) element-wise", details: "", aliases: [] },
"leaky_relu": { minArgs: 1, maxArgs: 2, signature: "leaky_relu(x, [negative_slope])", forms: [["x", "[negative_slope]"]], description: "applies leaky ReLU element-wise; negative_slope defaults to 0.01", details: "", aliases: [] },
"softplus": { minArgs: 1, maxArgs: 1, signature: "softplus(x)", forms: [["x"]], description: "applies the softplus function: ln(1 + exp(x))", details: "", aliases: [] },
"gelu": { minArgs: 1, maxArgs: 1, signature: "gelu(x)", forms: [["x"]], description: "applies the Gaussian Error Linear Unit (GELU) activation function", details: "", aliases: [] },
"silu": { minArgs: 1, maxArgs: 1, signature: "silu(x)", forms: [["x"]], description: "applies the Sigmoid Linear Unit activation element-wise", details: "", aliases: [] },
"sign": { minArgs: 1, maxArgs: 1, signature: "sign(x)", forms: [["x"]], description: "returns the sign of x: -1, 0, or 1", details: "", aliases: [] },
"degrees": { minArgs: 1, maxArgs: 1, signature: "degrees(x)", forms: [["x"]], description: "converts radians to degrees (per element)", details: "", aliases: [] },
"radians": { minArgs: 1, maxArgs: 1, signature: "radians(x)", forms: [["x"]], description: "converts degrees to radians (per element)", details: "", aliases: [] },
"logical_not": { minArgs: 1, maxArgs: 1, signature: "logical_not(x)", forms: [["x"]], description: "returns 1.0 where x is zero and 0.0 otherwise", details: "", aliases: [] },
"logical_and": { minArgs: 2, maxArgs: 2, signature: "logical_and(x, y)", forms: [["x", "y"]], description: "returns 1.0 if both values are non-zero, else 0.0", details: "", aliases: [] },
"logical_or": { minArgs: 2, maxArgs: 2, signature: "logical_or(x, y)", forms: [["x", "y"]], description: "returns 1.0 if either value is non-zero, else 0.0", details: "", aliases: [] },
"hypot": { minArgs: 2, maxArgs: 2, signature: "hypot(x, y)", forms: [["x", "y"]], description: "computes the element-wise Euclidean distance from the origin", details: "", aliases: [] },
"map": { minArgs: 2, maxArgs: 4, signature: "map(tensor, coord1, [coord2], [coord3])", forms: [["tensor", "coord1", "[coord2]", "[coord3]"]], description: "samples/remaps input tensor using coordinates", details: "", aliases: [] },
"ezconvolution": { minArgs: 3, maxArgs: 5, signature: "ezconvolution(tensor, size_x, kernel) / ezconvolution(tensor, size_x, size_y, kernel) / ezconvolution(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", aliases: ["ezconv"] },
"ezconv": { minArgs: 3, maxArgs: 5, signature: "ezconv(tensor, size_x, kernel) / ezconv(tensor, size_x, size_y, kernel) / ezconv(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", aliases: ["ezconvolution"] },
"convolution": { minArgs: 3, maxArgs: 5, signature: "convolution(tensor, size_x, kernel) / convolution(tensor, size_x, size_y, kernel) / convolution(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", aliases: ["conv"] },
"conv": { minArgs: 3, maxArgs: 5, signature: "conv(tensor, size_x, kernel) / conv(tensor, size_x, size_y, kernel) / conv(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", aliases: ["convolution"] },
"swap": { minArgs: 4, maxArgs: 4, signature: "swap(x, dim, idx1, idx2)", forms: [["x", "dim", "idx1", "idx2"]], description: "swaps elements along dim between idx1 and idx2", details: "", aliases: [] },
"transpose": { minArgs: 3, maxArgs: 3, signature: "transpose(x, dim0, dim1) / transpose(x, dim0, dim1)", forms: [["x", "dim0", "dim1"], ["x", "dim0", "dim1"]], description: "swaps two tensor dimensions", details: "", aliases: ["swapaxes"] },
"swapaxes": { minArgs: 3, maxArgs: 3, signature: "swapaxes(x, dim0, dim1) / swapaxes(x, dim0, dim1)", forms: [["x", "dim0", "dim1"], ["x", "dim0", "dim1"]], description: "swaps two tensor dimensions", details: "", aliases: ["transpose"] },
"permute": { minArgs: 2, maxArgs: 2, signature: "permute(x, dims)", forms: [["x", "dims"]], description: "permutes the dimensions of tensor x according to dims", details: "", aliases: ["perm"] },
"perm": { minArgs: 2, maxArgs: 2, signature: "perm(x, dims)", forms: [["x", "dims"]], description: "permutes the dimensions of tensor x according to dims", details: "", aliases: ["permute"] },
"reshape": { minArgs: 2, maxArgs: 2, signature: "reshape(x, shape)", forms: [["x", "shape"]], description: "reshapes tensor x to the specified shape", details: "", aliases: ["rshp"] },
"rshp": { minArgs: 2, maxArgs: 2, signature: "rshp(x, shape)", forms: [["x", "shape"]], description: "reshapes tensor x to the specified shape", details: "", aliases: ["reshape"] },
"range": { minArgs: 3, maxArgs: 3, signature: "range(start, stop, step)", forms: [["start", "stop", "step"]], description: "creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.", details: "", aliases: [] },
"linspace": { minArgs: 3, maxArgs: 3, signature: "linspace(start, stop, num)", forms: [["start", "stop", "num"]], description: "creates num linearly spaced values from start to stop (inclusive). Use range if you want to control the step between values.", details: "", aliases: [] },
"logspace": { minArgs: 4, maxArgs: 4, signature: "logspace(start, stop, num, base)", forms: [["start", "stop", "num", "base"]], description: "creates logarithmically spaced values", details: "", aliases: [] },
"topk": { minArgs: 2, maxArgs: 3, signature: "topk(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.", details: "", aliases: [] },
"botk": { minArgs: 2, maxArgs: 3, signature: "botk(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.", details: "", aliases: [] },
"pinv": { minArgs: 1, maxArgs: 1, signature: "pinv(x)", forms: [["x"]], description: "computes the inverse permutation of x: where x[i] == j the result has result[j] == i. Not the matrix pseudoinverse; use inv(x, 1) for that", details: "", aliases: [] },
"inv": { minArgs: 1, maxArgs: 2, signature: "inv(x, [pseudo])", forms: [["x", "[pseudo]"]], description: "computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead", details: "", aliases: [] },
"sum": { minArgs: 1, maxArgs: 2, signature: "sum(x, [dims])", forms: [["x", "[dims]"]], description: "computes the sum of elements of x, optionally along one or more dimensions", details: "", aliases: [] },
"mean": { minArgs: 1, maxArgs: 2, signature: "mean(x, [dims])", forms: [["x", "[dims]"]], description: "computes the arithmetic mean of elements of x globally or along one or more dimensions", details: "", aliases: [] },
"std": { minArgs: 1, maxArgs: 2, signature: "std(x, [dims])", forms: [["x", "[dims]"]], description: "computes the sample standard deviation of elements of x globally or along one or more dimensions", details: "", aliases: [] },
"var": { minArgs: 1, maxArgs: 2, signature: "var(x, [dims])", forms: [["x", "[dims]"]], description: "computes the sample variance of elements of x globally or along one or more dimensions", details: "", aliases: [] },
"prod": { minArgs: 1, maxArgs: 2, signature: "prod(x, [dims])", forms: [["x", "[dims]"]], description: "computes the product of elements of x globally or along one or more dimensions", details: "", aliases: [] },
"isclose": { minArgs: 2, maxArgs: 4, signature: "isclose(a, b, [rtol], [atol])", forms: [["a", "b", "[rtol]", "[atol]"]], description: "elementwise approximate equality test", details: "", aliases: [] },
"allclose": { minArgs: 2, maxArgs: 4, signature: "allclose(a, b, [rtol], [atol])", forms: [["a", "b", "[rtol]", "[atol]"]], description: "returns 1.0 if all elements are approximately equal, else 0.0", details: "", aliases: [] },
"quartile": { minArgs: 2, maxArgs: 3, signature: "quartile(x, q, [dim])", forms: [["x", "q", "[dim]"]], description: "computes the q-th quartile globally or along dim", details: "", aliases: ["quartil"] },
"quartil": { minArgs: 2, maxArgs: 3, signature: "quartil(x, q, [dim])", forms: [["x", "q", "[dim]"]], description: "computes the q-th quartile globally or along dim", details: "", aliases: ["quartile"] },
"percentile": { minArgs: 2, maxArgs: 3, signature: "percentile(x, p, [dim])", forms: [["x", "p", "[dim]"]], description: "computes the p-th percentile globally or along dim", details: "", aliases: ["prcnt"] },
"prcnt": { minArgs: 2, maxArgs: 3, signature: "prcnt(x, p, [dim])", forms: [["x", "p", "[dim]"]], description: "computes the p-th percentile globally or along dim", details: "", aliases: ["percentile"] },
"quantile": { minArgs: 2, maxArgs: 3, signature: "quantile(x, q, [dim])", forms: [["x", "q", "[dim]"]], description: "computes the q-th quantile globally or along dim", details: "", aliases: [] },
"dot": { minArgs: 2, maxArgs: 2, signature: "dot(x, y)", forms: [["x", "y"]], description: "computes the dot product of x and y after flattening both to 1D. Use cross(x, y) if you need a per-vector product with the last dimension kept.", details: "", aliases: [] },
"moment": { minArgs: 3, maxArgs: 3, signature: "moment(x, a, k)", forms: [["x", "a", "k"]], description: "computes the k-th moment of x around a", details: "", aliases: [] },
"erf": { minArgs: 1, maxArgs: 1, signature: "erf(x)", forms: [["x"]], description: "computes the error function (torch.erf)", details: "", aliases: [] },
"erfc": { minArgs: 1, maxArgs: 1, signature: "erfc(x)", forms: [["x"]], description: "computes the complementary error function (torch.special.erfc)", details: "", aliases: [] },
"erfinv": { minArgs: 1, maxArgs: 1, signature: "erfinv(x)", forms: [["x"]], description: "computes the inverse error function (torch.erfinv)", details: "", aliases: [] },
"any": { minArgs: 1, maxArgs: 1, signature: "any(x)", forms: [["x"]], description: "returns 1 if any element of x is non-zero otherwise 0", details: "", aliases: [] },
"all": { minArgs: 1, maxArgs: 1, signature: "all(x)", forms: [["x"]], description: "returns 1 if all elements of x are non-zero otherwise 0", details: "", aliases: [] },
"edge": { minArgs: 1, maxArgs: 2, signature: "edge(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "detects edges in x with a Sobel filter. kernel_size must be odd and at least 3 (default 3).", details: "", aliases: [] },
"blur": { minArgs: 2, maxArgs: 3, signature: "blur(x, sigma, [reshape])", forms: [["x", "sigma", "[reshape]"]], description: "applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.", details: "", aliases: ["gaussian"] },
"gaussian": { minArgs: 2, maxArgs: 3, signature: "gaussian(x, sigma, [reshape])", forms: [["x", "sigma", "[reshape]"]], description: "applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.", details: "", aliases: ["blur"] },
"median": { minArgs: 1, maxArgs: 2, signature: "median(x, [dim])", forms: [["x", "[dim]"]], description: "computes the median globally or along one dimension", details: "", aliases: [] },
"mode": { minArgs: 1, maxArgs: 2, signature: "mode(x, [dim])", forms: [["x", "[dim]"]], description: "computes the mode globally or along one dimension", details: "", aliases: [] },
"cumsum": { minArgs: 1, maxArgs: 2, signature: "cumsum(x, [dim])", forms: [["x", "[dim]"]], description: "computes the cumulative sum, defaulting to the first dimension.", details: "", aliases: [] },
"cumprod": { minArgs: 1, maxArgs: 1, signature: "cumprod(x)", forms: [["x"]], description: "computes the cumulative product over first dimension.", details: "", aliases: [] },
"topk_ind": { minArgs: 2, maxArgs: 3, signature: "topk_ind(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)", details: "", aliases: ["topk_indices"] },
"topk_indices": { minArgs: 2, maxArgs: 3, signature: "topk_indices(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)", details: "", aliases: ["topk_ind"] },
"botk_ind": { minArgs: 2, maxArgs: 3, signature: "botk_ind(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)", details: "", aliases: ["botk_indices"] },
"botk_indices": { minArgs: 2, maxArgs: 3, signature: "botk_indices(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)", details: "", aliases: ["botk_ind"] },
"cubic_ease": { minArgs: 3, maxArgs: 3, signature: "cubic_ease(a, b, t)", forms: [["a", "b", "t"]], description: "cubic ease between a and b", details: "", aliases: ["cubic"] },
"cubic": { minArgs: 3, maxArgs: 3, signature: "cubic(a, b, t)", forms: [["a", "b", "t"]], description: "cubic ease between a and b", details: "", aliases: ["cubic_ease"] },
"elastic_ease": { minArgs: 3, maxArgs: 3, signature: "elastic_ease(a, b, t)", forms: [["a", "b", "t"]], description: "elastic ease between a and b", details: "", aliases: ["elastic"] },
"elastic": { minArgs: 3, maxArgs: 3, signature: "elastic(a, b, t)", forms: [["a", "b", "t"]], description: "elastic ease between a and b", details: "", aliases: ["elastic_ease"] },
"sine_ease": { minArgs: 3, maxArgs: 3, signature: "sine_ease(a, b, t)", forms: [["a", "b", "t"]], description: "sine easing between a and b", details: "", aliases: ["sine"] },
"sine": { minArgs: 3, maxArgs: 3, signature: "sine(a, b, t)", forms: [["a", "b", "t"]], description: "sine easing between a and b", details: "", aliases: ["sine_ease"] },
"smootherstep": { minArgs: 3, maxArgs: 3, signature: "smootherstep(x, edge0, edge1)", forms: [["x", "edge0", "edge1"]], description: "smoother interpolation between edge0 and edge1", details: "", aliases: [] },
"dist": { minArgs: 4, maxArgs: 4, signature: "dist(x1, y1, x2, y2)", forms: [["x1", "y1", "x2", "y2"]], description: "computes Euclidean distance between (x1, y1) and (x2, y2)", details: "", aliases: ["distance"] },
"distance": { minArgs: 4, maxArgs: 4, signature: "distance(x1, y1, x2, y2)", forms: [["x1", "y1", "x2", "y2"]], description: "computes Euclidean distance between (x1, y1) and (x2, y2)", details: "", aliases: ["dist"] },
"remap": { minArgs: 5, maxArgs: 5, signature: "remap(v, i_min, i_max, o_min, o_max)", forms: [["v", "i_min", "i_max", "o_min", "o_max"]], description: "remaps values from input range to output range", details: "", aliases: [] },
"cossim": { minArgs: 2, maxArgs: 2, signature: "cossim(x, y)", forms: [["x", "y"]], description: "computes the cosine similarity between x and y.", details: "", aliases: ["cosine_similarity"] },
"cosine_similarity": { minArgs: 2, maxArgs: 2, signature: "cosine_similarity(x, y)", forms: [["x", "y"]], description: "computes the cosine similarity between x and y.", details: "", aliases: ["cossim"] },
"count": { minArgs: 1, maxArgs: 1, signature: "count(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", aliases: ["cnt", "length"] },
"cnt": { minArgs: 1, maxArgs: 1, signature: "cnt(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", aliases: ["count", "length"] },
"length": { minArgs: 1, maxArgs: 1, signature: "length(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", aliases: ["count", "cnt"] },
"keys": { minArgs: 1, maxArgs: 1, signature: "keys(x)", forms: [["x"]], description: "returns a list of dictionary keys in insertion order", details: "", aliases: [] },
"enable_tracking": { minArgs: 1, maxArgs: 1, signature: "enable_tracking(d)", forms: [["d"]], description: "enables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_on"] },
"track_on": { minArgs: 1, maxArgs: 1, signature: "track_on(d)", forms: [["d"]], description: "enables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["enable_tracking"] },
"disable_tracking": { minArgs: 1, maxArgs: 1, signature: "disable_tracking(d)", forms: [["d"]], description: "disables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_off"] },
"track_off": { minArgs: 1, maxArgs: 1, signature: "track_off(d)", forms: [["d"]], description: "disables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["disable_tracking"] },
"reset_tracking": { minArgs: 1, maxArgs: 1, signature: "reset_tracking(d)", forms: [["d"]], description: "resets change tracking state for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_reset"] },
"track_reset": { minArgs: 1, maxArgs: 1, signature: "track_reset(d)", forms: [["d"]], description: "resets change tracking state for ChangeTrackingDict d (returns d)", details: "", aliases: ["reset_tracking"] },
"get_changed_keys": { minArgs: 1, maxArgs: 1, signature: "get_changed_keys(d)", forms: [["d"]], description: "returns list of keys that were modified or added in ChangeTrackingDict d", details: "", aliases: ["changed_keys"] },
"changed_keys": { minArgs: 1, maxArgs: 1, signature: "changed_keys(d)", forms: [["d"]], description: "returns list of keys that were modified or added in ChangeTrackingDict d", details: "", aliases: ["get_changed_keys"] },
"get_added_keys": { minArgs: 1, maxArgs: 1, signature: "get_added_keys(d)", forms: [["d"]], description: "returns list of keys that were added (newly created) in ChangeTrackingDict d", details: "", aliases: ["added_keys"] },
"added_keys": { minArgs: 1, maxArgs: 1, signature: "added_keys(d)", forms: [["d"]], description: "returns list of keys that were added (newly created) in ChangeTrackingDict d", details: "", aliases: ["get_added_keys"] },
"get_removed_keys": { minArgs: 1, maxArgs: 1, signature: "get_removed_keys(d)", forms: [["d"]], description: "returns list of keys that were removed from ChangeTrackingDict d", details: "", aliases: ["removed_keys"] },
"removed_keys": { minArgs: 1, maxArgs: 1, signature: "removed_keys(d)", forms: [["d"]], description: "returns list of keys that were removed from ChangeTrackingDict d", details: "", aliases: ["get_removed_keys"] },
"get_unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "get_unchanged_keys(d)", forms: [["d"]], description: "returns list of keys that remain unchanged in ChangeTrackingDict d", details: "", aliases: ["unchanged_keys"] },
"unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "unchanged_keys(d)", forms: [["d"]], description: "returns list of keys that remain unchanged in ChangeTrackingDict d", details: "", aliases: ["get_unchanged_keys"] },
"repeat": { minArgs: 2, maxArgs: 3, signature: "repeat(x, count, [dims])", forms: [["x", "count", "[dims]"]], description: "repeats tensor elements; count may be scalar or per-dim list", details: "", aliases: [] },
"flatten": { minArgs: 1, maxArgs: 1, signature: "flatten(x)", forms: [["x"]], description: "flattens tensor into a 1D tensor", details: "", aliases: [] },
"append": { minArgs: 2, maxArgs: 2, signature: "append(x, y)", forms: [["x", "y"]], description: "appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)", details: "", aliases: [] },
"get_value": { minArgs: 2, maxArgs: 2, signature: "get_value(tensor, position)", forms: [["tensor", "position"]], description: "reads the value at an N-D position of tensor. Superseded by tensor[position] indexing", details: "", aliases: [] },
"flow_apply": { minArgs: 2, maxArgs: 2, signature: "flow_apply(image, flow)", forms: [["image", "flow"]], description: "applies optical flow to an image", details: "", aliases: [] },
"batch_shuffle": { minArgs: 2, maxArgs: 2, signature: "batch_shuffle(x, indices)", forms: [["x", "indices"]], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["shuffle", "select"] },
"shuffle": { minArgs: 2, maxArgs: 2, signature: "shuffle(x, indices)", forms: [["x", "indices"]], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["batch_shuffle", "select"] },
"select": { minArgs: 2, maxArgs: 2, signature: "select(x, indices)", forms: [["x", "indices"]], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["batch_shuffle", "shuffle"] },
"motion_mask": { minArgs: 1, maxArgs: 1, signature: "motion_mask(x)", forms: [["x"]], description: "generates a motion mask from optical flow", details: "", aliases: [] },
"flow_to_image": { minArgs: 1, maxArgs: 1, signature: "flow_to_image(x)", forms: [["x"]], description: "converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta.", details: "", aliases: [] },
"flow_mag": { minArgs: 1, maxArgs: 1, signature: "flow_mag(x)", forms: [["x"]], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", aliases: ["flow_magnitude"] },
"flow_magnitude": { minArgs: 1, maxArgs: 1, signature: "flow_magnitude(x)", forms: [["x"]], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", aliases: ["flow_mag"] },
"flow_ang": { minArgs: 1, maxArgs: 1, signature: "flow_ang(x)", forms: [["x"]], description: "computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)", details: "", aliases: ["flow_angle"] },
"flow_angle": { minArgs: 1, maxArgs: 1, signature: "flow_angle(x)", forms: [["x"]], description: "computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)", details: "", aliases: ["flow_ang"] },
"where": { minArgs: 3, maxArgs: 3, signature: "where(condition, x, y)", forms: [["condition", "x", "y"]], description: "returns x if condition is true, else y. Runs per element.", details: "", aliases: [] },
"histogram": { minArgs: 4, maxArgs: 4, signature: "histogram(x, bins, min, max)", forms: [["x", "bins", "min", "max"]], description: "counts the elements of flatten(x) in bins equal-width bins over [min, max]", details: "", aliases: ["hist"] },
"hist": { minArgs: 4, maxArgs: 4, signature: "hist(x, bins, min, max)", forms: [["x", "bins", "min", "max"]], description: "counts the elements of flatten(x) in bins equal-width bins over [min, max]", details: "", aliases: ["histogram"] },
"overlay": { minArgs: 3, maxArgs: 4, signature: "overlay(base, overlay, offset, [opacity])", forms: [["base", "overlay", "offset", "[opacity]"]], description: "overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.", details: "", aliases: [] },
"pad": { minArgs: 2, maxArgs: 2, signature: "pad(x, padding)", forms: [["x", "padding"]], description: "pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)", details: "", aliases: [] },
"cross": { minArgs: 2, maxArgs: 2, signature: "cross(x, y)", forms: [["x", "y"]], description: "computes the cross product of x and y. Last dimension must be 3", details: "", aliases: [] },
"matmul": { minArgs: 2, maxArgs: 2, signature: "matmul(x, y)", forms: [["x", "y"]], description: "computes the matrix multiplication of x and y", details: "", aliases: [] },
"solve": { minArgs: 2, maxArgs: 2, signature: "solve(A, b)", forms: [["A", "b"]], description: "solves the square linear system A*x=b without explicitly forming A inverse", details: "", aliases: [] },
"matrix_rank": { minArgs: 1, maxArgs: 2, signature: "matrix_rank(x, [tol])", forms: [["x", "[tol]"]], description: "computes the numerical rank of each matrix using optional absolute tolerance tol", details: "", aliases: [] },
"rife": { minArgs: 2, maxArgs: 5, signature: "rife(image1, image2, [tiling_size], [iterations], [multi_scale])", forms: [["image1", "image2", "[tiling_size]", "[iterations]", "[multi_scale]"]], description: "computes the optical flow field ([H, W, 2]) between image1 and image2 using a RAFT-based model", details: "- tiling_size: splits the image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution\n- iterations: how many times to run the flow model. Default 12\n- multi_scale: also use low resolution of base image for giant movements. Default false", aliases: [] },
"bnot": { minArgs: 1, maxArgs: 1, signature: "bnot(x)", forms: [["x"]], description: "computes the bitwise NOT", details: "", aliases: ["bitwise_not"] },
"bitwise_not": { minArgs: 1, maxArgs: 1, signature: "bitwise_not(x)", forms: [["x"]], description: "computes the bitwise NOT", details: "", aliases: ["bnot"] },
"bitcount": { minArgs: 1, maxArgs: 1, signature: "bitcount(x)", forms: [["x"]], description: "returns the number of set bits", details: "", aliases: ["popcount", "popcnt"] },
"popcount": { minArgs: 1, maxArgs: 1, signature: "popcount(x)", forms: [["x"]], description: "returns the number of set bits", details: "", aliases: ["bitcount", "popcnt"] },
"popcnt": { minArgs: 1, maxArgs: 1, signature: "popcnt(x)", forms: [["x"]], description: "returns the number of set bits", details: "", aliases: ["bitcount", "popcount"] },
"shape": { minArgs: 1, maxArgs: 1, signature: "shape(x)", forms: [["x"]], description: "returns the shape of tensor as a list", details: "", aliases: [] },
"band": { minArgs: 2, maxArgs: 2, signature: "band(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise AND of x and y", details: "", aliases: ["bitwise_and"] },
"bitwise_and": { minArgs: 2, maxArgs: 2, signature: "bitwise_and(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise AND of x and y", details: "", aliases: ["band"] },
"bxor": { minArgs: 2, maxArgs: 2, signature: "bxor(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise XOR of x and y", details: "", aliases: ["bitwise_xor"] },
"bitwise_xor": { minArgs: 2, maxArgs: 2, signature: "bitwise_xor(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise XOR of x and y", details: "", aliases: ["bxor"] },
"bor": { minArgs: 2, maxArgs: 2, signature: "bor(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise OR of x and y", details: "", aliases: ["bitwise_or"] },
"bitwise_or": { minArgs: 2, maxArgs: 2, signature: "bitwise_or(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise OR of x and y", details: "", aliases: ["bor"] },
"tensor": { minArgs: 1, maxArgs: 3, signature: "tensor(shape, [value], [dtype_template])", forms: [["shape", "[value]", "[dtype_template]"]], description: "creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32", details: "", aliases: [] },
"zeros": { minArgs: 1, maxArgs: 2, signature: "zeros(shape, [dtype_template])", forms: [["shape", "[dtype_template]"]], description: "creates a zero-filled tensor on the current device", details: "", aliases: [] },
"ones": { minArgs: 1, maxArgs: 2, signature: "ones(shape, [dtype_template])", forms: [["shape", "[dtype_template]"]], description: "creates a one-filled tensor on the current device", details: "", aliases: [] },
"eye": { minArgs: 1, maxArgs: 2, signature: "eye(n, [dtype_template])", forms: [["n", "[dtype_template]"]], description: "creates an n-by-n identity matrix", details: "", aliases: [] },
"one_hot": { minArgs: 2, maxArgs: 2, signature: "one_hot(indices, classes)", forms: [["indices", "classes"]], description: "converts integer class indices to float32 one-hot vectors", details: "", aliases: [] },
"mse": { minArgs: 2, maxArgs: 3, signature: "mse(a, b, [reduction])", forms: [["a", "b", "[reduction]"]], description: "mean squared error; reduction is mean (default), sum, or none", details: "", aliases: [] },
"mae": { minArgs: 2, maxArgs: 3, signature: "mae(a, b, [reduction])", forms: [["a", "b", "[reduction]"]], description: "mean absolute error; reduction is mean (default), sum, or none", details: "", aliases: [] },
"psnr": { minArgs: 2, maxArgs: 3, signature: "psnr(a, b, [data_range])", forms: [["a", "b", "[data_range]"]], description: "peak signal-to-noise ratio in dB; data_range defaults to 1", details: "", aliases: [] },
"weighted_mean": { minArgs: 2, maxArgs: 3, signature: "weighted_mean(x, weights, [dims])", forms: [["x", "weights", "[dims]"]], description: "computes the weighted mean globally or along one or more dimensions", details: "", aliases: [] },
"huber_loss": { minArgs: 2, maxArgs: 4, signature: "huber_loss(prediction, target, [delta], [reduction])", forms: [["prediction", "target", "[delta]", "[reduction]"]], description: "computes Huber loss; delta defaults to 1 and reduction to mean", details: "", aliases: [] },
"cross_entropy": { minArgs: 2, maxArgs: 4, signature: "cross_entropy(logits, target, [dim], [reduction])", forms: [["logits", "target", "[dim]", "[reduction]"]], description: "computes cross-entropy from class logits and class indices or target probabilities", details: "", aliases: [] },
"add_key": { minArgs: 3, maxArgs: 3, signature: "add_key(dict, key, value)", forms: [["dict", "key", "value"]], description: "adds or replaces a dictionary entry and returns the updated dictionary", details: "", aliases: [] },
"remove_key": { minArgs: 2, maxArgs: 2, signature: "remove_key(dict, key)", forms: [["dict", "key"]], description: "removes a dictionary entry and returns the updated dictionary", details: "", aliases: ["rm_key"] },
"rm_key": { minArgs: 2, maxArgs: 2, signature: "rm_key(dict, key)", forms: [["dict", "key"]], description: "removes a dictionary entry and returns the updated dictionary", details: "", aliases: ["remove_key"] },
"stack_push": { minArgs: 2, maxArgs: 2, signature: "stack_push(slot, val)", forms: [["slot", "val"]], description: "pushes val onto the end of slot stack", details: "", aliases: [] },
"stack_pop": { minArgs: 1, maxArgs: 1, signature: "stack_pop(slot)", forms: [["slot"]], description: "removes and returns the last element of slot stack", details: "", aliases: [] },
"stack_clear": { minArgs: 1, maxArgs: 1, signature: "stack_clear(slot)", forms: [["slot"]], description: "clears the contents of slot stack", details: "", aliases: [] },
"stack_has": { minArgs: 1, maxArgs: 1, signature: "stack_has(slot)", forms: [["slot"]], description: "returns 1.0 if slot exists in stack and is not empty else returns 0.0", details: "", aliases: [] },
"stack_get": { minArgs: 1, maxArgs: 1, signature: "stack_get(slot)", forms: [["slot"]], description: "returns the last pushed value in slot without popping it", details: "", aliases: [] },
"cat": { minArgs: 2, maxArgs: null, signature: "cat(x, ..., dim)", forms: [["x", "...", "dim"]], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["concat", "concatenate"] },
"concat": { minArgs: 2, maxArgs: null, signature: "concat(x, ..., dim)", forms: [["x", "...", "dim"]], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["cat", "concatenate"] },
"concatenate": { minArgs: 2, maxArgs: null, signature: "concatenate(x, ..., dim)", forms: [["x", "...", "dim"]], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["cat", "concat"] },
"stack": { minArgs: 1, maxArgs: 2, signature: "stack(tensors, [dim])", forms: [["tensors", "[dim]"]], description: "stacks a list of tensors along a new dimension", details: "", aliases: [] },
"nonzero": { minArgs: 1, maxArgs: 1, signature: "nonzero(x)", forms: [["x"]], description: "returns an N-by-rank tensor of coordinates for nonzero elements", details: "", aliases: [] },
"int": { minArgs: 1, maxArgs: 1, signature: "int(x)", forms: [["x"]], description: "casts x to integer", details: "", aliases: [] },
"float": { minArgs: 1, maxArgs: 1, signature: "float(x)", forms: [["x"]], description: "casts x to float", details: "", aliases: [] },
"upper": { minArgs: 1, maxArgs: 1, signature: "upper(x)", forms: [["x"]], description: "converts string to uppercase", details: "", aliases: [] },
"lower": { minArgs: 1, maxArgs: 1, signature: "lower(x)", forms: [["x"]], description: "converts string to lowercase", details: "", aliases: [] },
"trim": { minArgs: 1, maxArgs: 1, signature: "trim(x)", forms: [["x"]], description: "removes leading and trailing whitespace from string", details: "", aliases: [] },
"split": { minArgs: 1, maxArgs: 2, signature: "split(x, [delimiter])", forms: [["x", "[delimiter]"]], description: "splits string to list of strings based on delimiter. Default is space.", details: "", aliases: [] },
"join": { minArgs: 1, maxArgs: 2, signature: "join(x, [separator])", forms: [["x", "[separator]"]], description: "joins the items of list x as text using separator (default \"\"). Use concatenate(...) to join tensors", details: "", aliases: [] },
"substring": { minArgs: 2, maxArgs: 3, signature: "substring(s, start, [length])", forms: [["s", "start", "[length]"]], description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string", details: "", aliases: ["substr"] },
"substr": { minArgs: 2, maxArgs: 3, signature: "substr(s, start, [length])", forms: [["s", "start", "[length]"]], description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string", details: "", aliases: ["substring"] },
"find": { minArgs: 2, maxArgs: 2, signature: "find(s, sub)", forms: [["s", "sub"]], description: "returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings.", details: "", aliases: [] },
"replace": { minArgs: 3, maxArgs: 3, signature: "replace(s, old, new)", forms: [["s", "old", "new"]], description: "replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.", details: "", aliases: [] },
"dilate": { minArgs: 1, maxArgs: 2, signature: "dilate(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological dilation to x with a square kernel (default size 3).", details: "", aliases: [] },
"erode": { minArgs: 1, maxArgs: 2, signature: "erode(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological erosion to x with a square kernel (default size 3).", details: "", aliases: [] },
"morph_open": { minArgs: 1, maxArgs: 2, signature: "morph_open(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological opening (erosion then dilation) to x with a square kernel (default size 3).", details: "", aliases: [] },
"morph_close": { minArgs: 1, maxArgs: 2, signature: "morph_close(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological closing (dilation then erosion) to x with a square kernel (default size 3).", details: "", aliases: [] },
"rgb_to_oklab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_oklab(rgb) / rgb_to_oklab(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "converts 0-1 sRGB to OKLab. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result", details: "", aliases: [] },
"rgb_to_cielab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_cielab(rgb) / rgb_to_cielab(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "converts 0-1 sRGB to CIELAB (D65) divided by 100, so L is 0-1. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result", details: "", aliases: [] },
"oklab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)", forms: [["oklab"], ["l", "a", "b"]], description: "converts OKLab to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result", details: "", aliases: [] },
"cielab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)", forms: [["cielab"], ["l", "a", "b"]], description: "converts CIELAB divided by 100 (as returned by rgb_to_cielab) to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result", details: "", aliases: [] },
"rgb_to_hsv": { minArgs: 1, maxArgs: 4, signature: "rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees])", forms: [["rgb", "[degrees]"], ["r", "g", "b", "[degrees]"]], description: "converts RGB to HSV. With one color argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is 0-360 instead of 0-1", details: "", aliases: [] },
"hsv_to_rgb": { minArgs: 1, maxArgs: 4, signature: "hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees])", forms: [["hsv", "[degrees]"], ["h", "s", "v", "[degrees]"]], description: "converts HSV to RGB. With one color argument its last dimension holds H, S, V; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is read as 0-360 instead of 0-1", details: "", aliases: [] },
"int_to_rgb": { minArgs: 1, maxArgs: 1, signature: "int_to_rgb(val)", forms: [["val"]], description: "unpacks 0xRRGGBB integers into 0-1 RGB colors. Tensors get R, G, B stacked in a new last dimension, lists return a list of colors and a number returns a 3-item list", details: "", aliases: [] },
"rgb_to_int": { minArgs: 1, maxArgs: 3, signature: "rgb_to_int(rgb) / rgb_to_int(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "packs 0-1 RGB components into 0xRRGGBB integers. With one argument the last dimension (or a 3-item list) holds R, G, B; with three, each argument is one channel", details: "", aliases: [] },
"interpolate_linear": { minArgs: 2, maxArgs: 2, signature: "interpolate_linear(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with (bi/tri)linear interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", aliases: [] },
"interpolate_area": { minArgs: 2, maxArgs: 2, signature: "interpolate_area(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with area interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", aliases: [] },
"interpolate_nearest": { minArgs: 2, maxArgs: 2, signature: "interpolate_nearest(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", aliases: ["interpolate_nearest_exact"] },
"interpolate_nearest_exact": { minArgs: 2, maxArgs: 2, signature: "interpolate_nearest_exact(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", aliases: ["interpolate_nearest"] },
"text_image": { minArgs: 3, maxArgs: 9, signature: "text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline])", forms: [["text", "font", "size", "[max_width]", "[weight]", "[rotation_angle]", "[line_spacing]", "[italic]", "[underline]"]], description: "renders text to a 2D tensor with values 0-1", details: "", aliases: [] },
"as_nested_tensor": { minArgs: 1, maxArgs: 1, signature: "as_nested_tensor(x)", forms: [["x"]], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", aliases: ["as_nested"] },
"as_nested": { minArgs: 1, maxArgs: 1, signature: "as_nested(x)", forms: [["x"]], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", aliases: ["as_nested_tensor"] },
"svd": { minArgs: 1, maxArgs: 2, signature: "svd(x, [full_matrices])", forms: [["x", "[full_matrices]"]], description: "computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)", details: "", aliases: ["singular_value_decomposition"] },
"singular_value_decomposition": { minArgs: 1, maxArgs: 2, signature: "singular_value_decomposition(x, [full_matrices])", forms: [["x", "[full_matrices]"]], description: "computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)", details: "", aliases: ["svd"] },
"diagonal_matrix": { minArgs: 2, maxArgs: 5, signature: "diagonal_matrix(x, shape, [offset], [dim1], [dim2])", forms: [["x", "shape", "[offset]", "[dim1]", "[dim2]"]], description: "creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.", details: "", aliases: ["diag"] },
"diag": { minArgs: 2, maxArgs: 5, signature: "diag(x, shape, [offset], [dim1], [dim2])", forms: [["x", "shape", "[offset]", "[dim1]", "[dim2]"]], description: "creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.", details: "", aliases: ["diagonal_matrix"] },
"timestamp": { minArgs: 0, maxArgs: 0, signature: "timestamp()", forms: [[]], description: "returns the current system timestamp", details: "", aliases: ["now"] },
"now": { minArgs: 0, maxArgs: 0, signature: "now()", forms: [[]], description: "returns the current system timestamp", details: "", aliases: ["timestamp"] },
"sort": { minArgs: 1, maxArgs: 3, signature: "sort(x, [descending], [dim])", forms: [["x", "[descending]", "[dim]"]], description: "returns x sorted ascending, or descending when descending is truthy. Tensors are sorted along dim (default: last dimension); lists use Python sorting", details: "", aliases: [] },
"argsort": { minArgs: 1, maxArgs: 3, signature: "argsort(x, [descending], [dim])", forms: [["x", "[descending]", "[dim]"]], description: "returns the indices that would sort x. descending defaults to false and dim defaults to the last dimension.", details: "", aliases: [] },
"argmin": { minArgs: 1, maxArgs: 3, signature: "argmin(x, [as_position], [dim])", forms: [["x", "[as_position]", "[dim]"]], description: "returns the minimum index globally or along dim; as_position returns global coordinates", details: "", aliases: [] },
"argmax": { minArgs: 1, maxArgs: 3, signature: "argmax(x, [as_position], [dim])", forms: [["x", "[as_position]", "[dim]"]], description: "returns the maximum index globally or along dim; as_position returns global coordinates", details: "", aliases: [] },
"softmax": { minArgs: 1, maxArgs: 2, signature: "softmax(x, [dim])", forms: [["x", "[dim]"]], description: "applies the softmax function to x (each slice sums to 1.0). dim defaults to the last dimension.", details: "", aliases: [] },
"softmin": { minArgs: 1, maxArgs: 2, signature: "softmin(x, [dim])", forms: [["x", "[dim]"]], description: "applies the softmin function to x (same as softmax(-x, [dim])). dim defaults to the last dimension.", details: "", aliases: [] },
"unique": { minArgs: 1, maxArgs: 1, signature: "unique(x)", forms: [["x"]], description: "returns the sorted unique elements of x (tensors are flattened first)", details: "", aliases: [] },
"flip": { minArgs: 2, maxArgs: 2, signature: "flip(x, dims)", forms: [["x", "dims"]], description: "reverses the order of elements along the specified dimensions. Text is reversed as a whole", details: "", aliases: [] },
"startswith": { minArgs: 2, maxArgs: 2, signature: "startswith(text, prefix)", forms: [["text", "prefix"]], description: "returns 1 if text starts with prefix, else 0", details: "", aliases: [] },
"endswith": { minArgs: 2, maxArgs: 2, signature: "endswith(text, suffix)", forms: [["text", "suffix"]], description: "returns 1 if text ends with suffix, else 0", details: "", aliases: [] },
"squeeze": { minArgs: 1, maxArgs: 2, signature: "squeeze(x, [dim])", forms: [["x", "[dim]"]], description: "removes size-1 dimensions from tensor x, optionally at dim", details: "", aliases: [] },
"unsqueeze": { minArgs: 2, maxArgs: 2, signature: "unsqueeze(x, dim)", forms: [["x", "dim"]], description: "inserts a size-1 dimension into tensor x at dim", details: "", aliases: [] },
"roll": { minArgs: 2, maxArgs: 3, signature: "roll(x, shifts, [dim])", forms: [["x", "shifts", "[dim]"]], description: "circularly shifts tensor x along dim (default 0)", details: "", aliases: [] },
"cov": { minArgs: 2, maxArgs: 2, signature: "cov(x, y)", forms: [["x", "y"]], description: "computes the sample covariance of the flattened x and y (which must have the same number of elements)", details: "", aliases: [] },
"corr": { minArgs: 2, maxArgs: 2, signature: "corr(x, y)", forms: [["x", "y"]], description: "computes the Pearson correlation coefficient between x and y", details: "", aliases: ["correlation"] },
"correlation": { minArgs: 2, maxArgs: 2, signature: "correlation(x, y)", forms: [["x", "y"]], description: "computes the Pearson correlation coefficient between x and y", details: "", aliases: ["corr"] },
"entropy": { minArgs: 1, maxArgs: 1, signature: "entropy(x)", forms: [["x"]], description: "computes the Shannon entropy (in nats) of softmax(x), i.e. x is treated as logits over all of its elements", details: "", aliases: [] },
"crop": { minArgs: 3, maxArgs: 3, signature: "crop(x, start, size)", forms: [["x", "start", "size"]], description: "crops the region of x beginning at start (the low corner). The result always has shape size; parts outside x are zero-filled. On text, returns at most size characters", details: "", aliases: [] },
"coords": { minArgs: 2, maxArgs: 3, signature: "coords(shape, dim, [dtype_template])", forms: [["shape", "dim", "[dtype_template]"]], description: "generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).", details: "", aliases: ["coordinates"] },
"coordinates": { minArgs: 2, maxArgs: 3, signature: "coordinates(shape, dim, [dtype_template])", forms: [["shape", "dim", "[dtype_template]"]], description: "generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).", details: "", aliases: ["coords"] },
"gather": { minArgs: 3, maxArgs: 3, signature: "gather(x, dim, idx)", forms: [["x", "dim", "idx"]], description: "gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.", details: "", aliases: [] },
"scatter": { minArgs: 4, maxArgs: 4, signature: "scatter(x, dim, idx, src)", forms: [["x", "dim", "idx", "src"]], description: "scatters elements from src into x along dim using the indices specified in idx. The output tensor has the same shape as x.", details: "", aliases: [] },
"scatter_add": { minArgs: 4, maxArgs: 4, signature: "scatter_add(x, dim, idx, src)", forms: [["x", "dim", "idx", "src"]], description: "scatters elements from src into x along dim using the indices specified in idx, adding to existing values. The output tensor has the same shape as x.", details: "", aliases: [] },
"noise": { minArgs: 1, maxArgs: 2, signature: "noise(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates normally distributed random noise", details: "", aliases: ["randn", "random_normal"] },
"randn": { minArgs: 1, maxArgs: 2, signature: "randn(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates normally distributed random noise", details: "", aliases: ["noise", "random_normal"] },
"random_normal": { minArgs: 1, maxArgs: 2, signature: "random_normal(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates normally distributed random noise", details: "", aliases: ["noise", "randn"] },
"pink_noise": { minArgs: 1, maxArgs: 2, signature: "pink_noise(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic pink noise (approximately 1/f power spectrum), normalised per row", details: "", aliases: ["pink"] },
"pink": { minArgs: 1, maxArgs: 2, signature: "pink(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic pink noise (approximately 1/f power spectrum), normalised per row", details: "", aliases: ["pink_noise"] },
"brown_noise": { minArgs: 1, maxArgs: 2, signature: "brown_noise(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row", details: "", aliases: ["brown"] },
"brown": { minArgs: 1, maxArgs: 2, signature: "brown(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row", details: "", aliases: ["brown_noise"] },
"rand": { minArgs: 1, maxArgs: 2, signature: "rand(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates uniformly distributed random noise", details: "", aliases: ["randu", "random_uniform"] },
"randu": { minArgs: 1, maxArgs: 2, signature: "randu(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates uniformly distributed random noise", details: "", aliases: ["rand", "random_uniform"] },
"random_uniform": { minArgs: 1, maxArgs: 2, signature: "random_uniform(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates uniformly distributed random noise", details: "", aliases: ["rand", "randu"] },
"randc": { minArgs: 3, maxArgs: 4, signature: "randc(seed, median, sigma, [shape])", forms: [["seed", "median", "sigma", "[shape]"]], description: "generates Cauchy distributed random values.", details: "", aliases: ["random_cauchy"] },
"random_cauchy": { minArgs: 3, maxArgs: 4, signature: "random_cauchy(seed, median, sigma, [shape])", forms: [["seed", "median", "sigma", "[shape]"]], description: "generates Cauchy distributed random values.", details: "", aliases: ["randc"] },
"rande": { minArgs: 2, maxArgs: 3, signature: "rande(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates exponentially distributed random values", details: "", aliases: ["random_exponential"] },
"random_exponential": { minArgs: 2, maxArgs: 3, signature: "random_exponential(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates exponentially distributed random values", details: "", aliases: ["rande"] },
"randln": { minArgs: 3, maxArgs: 4, signature: "randln(seed, mean, std, [shape])", forms: [["seed", "mean", "std", "[shape]"]], description: "generates log-normally distributed random values.", details: "", aliases: ["random_log_normal"] },
"random_log_normal": { minArgs: 3, maxArgs: 4, signature: "random_log_normal(seed, mean, std, [shape])", forms: [["seed", "mean", "std", "[shape]"]], description: "generates log-normally distributed random values.", details: "", aliases: ["randln"] },
"randb": { minArgs: 2, maxArgs: 3, signature: "randb(seed, probability, [shape])", forms: [["seed", "probability", "[shape]"]], description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor", details: "", aliases: ["random_bernoulli"] },
"random_bernoulli": { minArgs: 2, maxArgs: 3, signature: "random_bernoulli(seed, probability, [shape])", forms: [["seed", "probability", "[shape]"]], description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor", details: "", aliases: ["randb"] },
"randp": { minArgs: 2, maxArgs: 3, signature: "randp(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates Poisson distributed random values.", details: "", aliases: ["random_poisson"] },
"random_poisson": { minArgs: 2, maxArgs: 3, signature: "random_poisson(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates Poisson distributed random values.", details: "", aliases: ["randp"] },
"randg": { minArgs: 3, maxArgs: 4, signature: "randg(seed, shape_param, scale, [shape])", forms: [["seed", "shape_param", "scale", "[shape]"]], description: "generates Gamma distributed random values.", details: "", aliases: ["random_gamma"] },
"random_gamma": { minArgs: 3, maxArgs: 4, signature: "random_gamma(seed, shape_param, scale, [shape])", forms: [["seed", "shape_param", "scale", "[shape]"]], description: "generates Gamma distributed random values.", details: "", aliases: ["randg"] },
"randbeta": { minArgs: 3, maxArgs: 4, signature: "randbeta(seed, alpha, beta, [shape])", forms: [["seed", "alpha", "beta", "[shape]"]], description: "generates Beta distributed random values", details: "", aliases: ["random_beta"] },
"random_beta": { minArgs: 3, maxArgs: 4, signature: "random_beta(seed, alpha, beta, [shape])", forms: [["seed", "alpha", "beta", "[shape]"]], description: "generates Beta distributed random values", details: "", aliases: ["randbeta"] },
"randl": { minArgs: 3, maxArgs: 4, signature: "randl(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Laplace distributed random values", details: "", aliases: ["random_laplace"] },
"random_laplace": { minArgs: 3, maxArgs: 4, signature: "random_laplace(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Laplace distributed random values", details: "", aliases: ["randl"] },
"randgumbel": { minArgs: 3, maxArgs: 4, signature: "randgumbel(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Gumbel distributed random values", details: "", aliases: ["random_gumbel"] },
"random_gumbel": { minArgs: 3, maxArgs: 4, signature: "random_gumbel(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Gumbel distributed random values", details: "", aliases: ["randgumbel"] },
"randw": { minArgs: 3, maxArgs: 4, signature: "randw(seed, scale, concentration, [shape])", forms: [["seed", "scale", "concentration", "[shape]"]], description: "generates Weibull distributed random values", details: "", aliases: ["random_weibull"] },
"random_weibull": { minArgs: 3, maxArgs: 4, signature: "random_weibull(seed, scale, concentration, [shape])", forms: [["seed", "scale", "concentration", "[shape]"]], description: "generates Weibull distributed random values", details: "", aliases: ["randw"] },
"randchi2": { minArgs: 2, maxArgs: 3, signature: "randchi2(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Chi-squared distributed random values", details: "", aliases: ["random_chi2"] },
"random_chi2": { minArgs: 2, maxArgs: 3, signature: "random_chi2(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Chi-squared distributed random values", details: "", aliases: ["randchi2"] },
"randt": { minArgs: 2, maxArgs: 3, signature: "randt(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Student-t distributed random values", details: "", aliases: ["random_studentt"] },
"random_studentt": { minArgs: 2, maxArgs: 3, signature: "random_studentt(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Student-t distributed random values", details: "", aliases: ["randt"] },
"perlin": { minArgs: 2, maxArgs: 5, signature: "perlin(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Perlin noise", details: "", aliases: ["perlin_noise"] },
"perlin_noise": { minArgs: 2, maxArgs: 5, signature: "perlin_noise(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Perlin noise", details: "", aliases: ["perlin"] },
"cellular": { minArgs: 2, maxArgs: 5, signature: "cellular(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise", details: "", aliases: ["voronoi", "worley", "cellular_noise", "voronoi_noise"] },
"voronoi": { minArgs: 2, maxArgs: 5, signature: "voronoi(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "worley", "cellular_noise", "voronoi_noise"] },
"worley": { minArgs: 2, maxArgs: 5, signature: "worley(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "voronoi", "cellular_noise", "voronoi_noise"] },
"cellular_noise": { minArgs: 2, maxArgs: 5, signature: "cellular_noise(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "voronoi", "worley", "voronoi_noise"] },
"voronoi_noise": { minArgs: 2, maxArgs: 5, signature: "voronoi_noise(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "voronoi", "worley", "cellular_noise"] },
"plasma": { minArgs: 2, maxArgs: 5, signature: "plasma(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4", details: "", aliases: ["turbulence", "plasma_noise"] },
"turbulence": { minArgs: 2, maxArgs: 5, signature: "turbulence(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4", details: "", aliases: ["plasma", "plasma_noise"] },
"plasma_noise": { minArgs: 2, maxArgs: 5, signature: "plasma_noise(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4", details: "", aliases: ["plasma", "turbulence"] },
"ridged": { minArgs: 2, maxArgs: 5, signature: "ridged(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates ridged multi-fractal noise", details: "", aliases: ["ridged_noise"] },
"ridged_noise": { minArgs: 2, maxArgs: 5, signature: "ridged_noise(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates ridged multi-fractal noise", details: "", aliases: ["ridged"] },
"domain_warp": { minArgs: 4, maxArgs: 8, signature: "domain_warp(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])", forms: [["seed", "scale", "warp_scale", "warp_strength", "[octaves]", "[warp_octaves]", "[offset]", "[shape]"]], description: "generates domain warped noise", details: "", aliases: ["domain_warp_noise"] },
"domain_warp_noise": { minArgs: 4, maxArgs: 8, signature: "domain_warp_noise(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])", forms: [["seed", "scale", "warp_scale", "warp_strength", "[octaves]", "[warp_octaves]", "[offset]", "[shape]"]], description: "generates domain warped noise", details: "", aliases: ["domain_warp"] },
};