better description

This commit is contained in:
mcDandy
2026-10-18 00:06:55 +02:00
parent 9526ea3bd8
commit 2e90d0e235
5 changed files with 876 additions and 598 deletions
+1 -1
View File
@@ -293,7 +293,7 @@ You can also get the node from comfy manager under the name of More math.
### 3) Imaging & Spatial Processing
#### 3.1 Filters & Convolution
- `blur(x, sigma, [reshape])` / `gaussian`: Gaussian blur using separable convolution. If `reshape` is truthy, tries orienting the input such that channel is in the direction of the filter; otherwise it expects the color dimension to be last.
- `blur(x, sigma, [auto_channels])` / `gaussian`: Gaussian blur using separable convolution. If `auto_channels` is truthy, tries orienting the input such that channel is in the direction of the filter; otherwise it expects the color dimension to be last.
- `edge(x, [kernel_size])`: Sobel-style edge detection.
- `ezconvolution(tensor, ...)` / `ezconv`: convolution with auto layout handling.
- `convolution(tensor, ...)` / `conv`: direct convolution. Expects [batch, channel, spatial...] layout.
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -386,13 +386,15 @@ $docEntries = Get-FunctionDocEntries -FuncSection $sections.FuncSection
$sigByToken = @{}
$detailsByToken = @{}
$paramsByToken = @{}
$paramTotal = 0
$paramDescribed = 0
foreach ($e in $docEntries) {
$sig = ConvertTo-FunctionSignature -Line $e.FirstLine
if (-not $sig) { continue }
$sigByToken[$e.Token] = $sig
# "- name: description" lines document one parameter; other lines are general details.
$argNames = @($sig.Forms | ForEach-Object { $_ } | ForEach-Object { $_.Trim('[', ']', ' ').Replace('...', '') })
$argNames = @($sig.Forms | ForEach-Object { $_ } | ForEach-Object { $_.Trim('[', ']', ' ').Replace('...', '') } | Where-Object { $_ })
$params = [ordered]@{}
$details = New-Object System.Collections.Generic.List[string]
foreach ($line in $e.Details) {
@@ -409,7 +411,10 @@ foreach ($e in $docEntries) {
}
$paramsByToken[$e.Token] = $params
$detailsByToken[$e.Token] = $details -join "`n"
$paramTotal += @($argNames | Select-Object -Unique).Count
$paramDescribed += @($argNames | Select-Object -Unique | Where-Object { $params.Contains($_) }).Count
}
Write-Host "[symbols] $paramDescribed of $paramTotal parameters have a description."
$functionTokens = @($functionTokenToWords.psbase.Keys)
$undocumented = @($functionTokens | Where-Object { -not $sigByToken.ContainsKey($_) })
+265 -265
View File
@@ -10,280 +10,280 @@ INBUILT_FUNCTIONS = {
}
INBUILT_FUNCTION_META = {
'sin': {'min_args': 1, 'max_args': 1, 'signature': 'sin(x)', 'forms': [['x']], 'description': 'applies sine function to value or each element of value', 'details': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, 'aliases': []},
'sin': {'min_args': 1, 'max_args': 1, 'signature': 'sin(x)', 'forms': [['x']], 'description': 'applies sine function to value or each element of value', 'details': '', 'params': {'x': 'angle in radians (number, list or tensor)'}, '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': '', 'params': {'x': 'angle in radians (number, list or tensor)'}, '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': '', 'params': {'x': 'angle in radians (number, list or tensor)'}, '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': '', 'params': {'x': 'value in -1..1 (number, list or tensor)'}, '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': '', 'params': {'x': 'value in -1..1 (number, list or tensor)'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'y': 'y coordinate (numerator)', 'x': 'x coordinate (denominator)'}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, 'aliases': []},
'exp': {'min_args': 1, 'max_args': 1, 'signature': 'exp(x)', 'forms': [['x']], 'description': 'applies e^x to value (per element)', 'details': '', 'params': {}, 'aliases': []},
'log1p': {'min_args': 1, 'max_args': 1, 'signature': 'log1p(x)', 'forms': [['x']], 'description': 'applies ln(1+x) accurately for values near zero', 'details': '', 'params': {}, 'aliases': []},
'expm1': {'min_args': 1, 'max_args': 1, 'signature': 'expm1(x)', 'forms': [['x']], 'description': 'applies exp(x)-1 accurately for values near zero', 'details': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, 'aliases': []},
'reciprocal': {'min_args': 1, 'max_args': 1, 'signature': 'reciprocal(x)', 'forms': [['x']], 'description': 'computes 1/x element-wise', 'details': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'p': 'norm order (default: 2)', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'p': 'norm order (default: 2)', 'dim': 'dimension to work along (default: last)', 'eps': 'smallest allowed divisor (default: 1e-12)'}, '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': '', 'params': {'groups': 'number of channel groups; must divide the channel count', 'weight': 'per-channel scale, length C (default: none)', 'bias': 'per-channel shift, length C (default: none)', 'eps': 'value added to the variance for stability (default: 1e-5)'}, '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': '', 'params': {}, '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': '', 'params': {}, 'aliases': []},
'det': {'min_args': 1, 'max_args': 1, 'signature': 'det(x)', 'forms': [['x']], 'description': 'computes the determinant of each square matrix in x', 'details': '', 'params': {}, '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': '', 'params': {'dim': 'dimension to transform (default: last)'}, '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': '', 'params': {'n': 'length of the output signal (default: 2 * (input length - 1))', 'dim': 'dimension to transform (default: last)'}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'dim': 'dimension whose slices are normalised (default: last)'}, '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': '', 'params': {'dim': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {}, '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': '', 'params': {}, 'aliases': []},
'round': {'min_args': 1, 'max_args': 1, 'signature': 'round(x)', 'forms': [['x']], 'description': 'rounds x to the nearest integer', 'details': '', 'params': {}, 'aliases': []},
'gamma': {'min_args': 1, 'max_args': 1, 'signature': 'gamma(x)', 'forms': [['x']], 'description': 'computes the gamma function (per element)', 'details': '', 'params': {}, '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': '', 'params': {'x': 'base', 'y': 'exponent'}, 'aliases': []},
'sigm': {'min_args': 1, 'max_args': 1, 'signature': 'sigm(x)', 'forms': [['x']], 'description': 'applies the sigmoid function: 1 / (1 + exp(-x))', 'details': '', 'params': {}, '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': '', 'params': {}, 'aliases': []},
'fft': {'min_args': 1, 'max_args': 1, 'signature': 'fft(x)', 'forms': [['x']], 'description': 'computes fast Fourier transform of x', 'details': '', 'params': {}, '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': '', 'params': {'shape': 'shape used for the K/Kx/Ky frequency variables (default: the node\'s input shape)'}, 'aliases': []},
'angle': {'min_args': 1, 'max_args': 1, 'signature': 'angle(x)', 'forms': [['x']], 'description': 'returns the angle of a complex number or vector', 'details': '', 'params': {}, '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': '', 'params': {}, 'aliases': []},
'print_shape': {'min_args': 1, 'max_args': 1, 'signature': 'print_shape(x)', 'forms': [['x']], 'description': 'prints the shape of the tensor x', 'details': '', 'params': {}, 'aliases': ['pshp']},
'pshp': {'min_args': 1, 'max_args': 1, 'signature': 'pshp(x)', 'forms': [['x']], 'description': 'prints the shape of the tensor x', 'details': '', 'params': {}, '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': '', 'params': {'nan': 'replacement for NaN', 'pos_inf': 'replacement for +infinity', 'neg_inf': 'replacement for -infinity'}, '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': '', 'params': {'nan': 'replacement for NaN', 'pos_inf': 'replacement for +infinity', 'neg_inf': 'replacement for -infinity'}, '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': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)', 'dim': 'dimension holding the vector components (default: all elements form one vector)'}, 'aliases': []},
'step': {'min_args': 2, 'max_args': 2, 'signature': 'step(x, edge)', 'forms': [['x', 'edge']], 'description': 'returns 0 if x < edge, else 1', 'details': '', 'params': {'edge': 'threshold; the result is 1 where x >= edge, otherwise 0'}, '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': '', 'params': {'edge0': 'value mapped to 0', 'edge1': 'value mapped to 1'}, 'aliases': []},
'fract': {'min_args': 1, 'max_args': 1, 'signature': 'fract(x)', 'forms': [['x']], 'description': 'returns the fractional part of x: x - floor(x)', 'details': '', 'params': {}, 'aliases': []},
'relu': {'min_args': 1, 'max_args': 1, 'signature': 'relu(x)', 'forms': [['x']], 'description': 'applies rectified linear unit function: max(0, x)', 'details': '', 'params': {}, 'aliases': []},
'softsign': {'min_args': 1, 'max_args': 1, 'signature': 'softsign(x)', 'forms': [['x']], 'description': 'applies x / (1 + abs(x)) element-wise', 'details': '', 'params': {}, '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': '', 'params': {'negative_slope': 'slope used for negative inputs (default: 0.01)'}, 'aliases': []},
'softplus': {'min_args': 1, 'max_args': 1, 'signature': 'softplus(x)', 'forms': [['x']], 'description': 'applies the softplus function: ln(1 + exp(x))', 'details': '', 'params': {}, 'aliases': []},
'gelu': {'min_args': 1, 'max_args': 1, 'signature': 'gelu(x)', 'forms': [['x']], 'description': 'applies the Gaussian Error Linear Unit (GELU) activation function', 'details': '', 'params': {}, 'aliases': []},
'silu': {'min_args': 1, 'max_args': 1, 'signature': 'silu(x)', 'forms': [['x']], 'description': 'applies the Sigmoid Linear Unit activation element-wise', 'details': '', 'params': {}, 'aliases': []},
'sign': {'min_args': 1, 'max_args': 1, 'signature': 'sign(x)', 'forms': [['x']], 'description': 'returns the sign of x: -1, 0, or 1', 'details': '', 'params': {}, 'aliases': []},
'degrees': {'min_args': 1, 'max_args': 1, 'signature': 'degrees(x)', 'forms': [['x']], 'description': 'converts radians to degrees (per element)', 'details': '', 'params': {}, 'aliases': []},
'radians': {'min_args': 1, 'max_args': 1, 'signature': 'radians(x)', 'forms': [['x']], 'description': 'converts degrees to radians (per element)', 'details': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'coord1': 'sample positions (element indices) along the first mapped dimension; mapped dimensions are the last ones of tensor', 'coord2': 'sample positions along the second mapped dimension', 'coord3': 'sample positions along the third mapped dimension'}, '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': '', 'params': {'tensor': 'input, channels first or last', 'size_x': 'kernel size along the first spatial dimension', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre'}, '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': '', 'params': {'tensor': 'input, channels first or last', 'size_x': 'kernel size along the first spatial dimension', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre'}, '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': '', 'params': {'tensor': 'input shaped [batch, channel, spatial...]', 'size_x': 'kernel size along the first spatial dimension', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre'}, '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': '', 'params': {'tensor': 'input shaped [batch, channel, spatial...]', 'size_x': 'kernel size along the first spatial dimension', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre'}, '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': '', 'params': {'dim': 'dimension to swap along', 'idx1': 'first position', 'idx2': 'second position'}, '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': '', 'params': {'dim0': 'first dimension to swap', 'dim1': 'second dimension to swap'}, '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': '', 'params': {'dim0': 'first dimension to swap', 'dim1': 'second dimension to swap'}, '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': '', 'params': {'dims': 'new order of the dimensions, e.g. [0, 2, 1]'}, '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': '', 'params': {'dims': 'new order of the dimensions, e.g. [0, 2, 1]'}, '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': '', 'params': {'shape': 'new shape; the total number of elements must stay the same'}, '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': '', 'params': {'shape': 'new shape; the total number of elements must stay the same'}, 'aliases': ['reshape']},
'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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'value >= 1 (number, list or tensor)'}, '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': '', 'params': {'x': 'value in -1..1 (number, list or tensor)'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'non-negative values (number, list or tensor)'}, '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': '', 'params': {'x': 'positive values (number, list or tensor)'}, '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': '', 'params': {'x': 'positive values (number, list or tensor)'}, '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': '', 'params': {'x': 'positive values (number, list or tensor)'}, 'aliases': []},
'exp': {'min_args': 1, 'max_args': 1, 'signature': 'exp(x)', 'forms': [['x']], 'description': 'applies e^x to value (per element)', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'log1p': {'min_args': 1, 'max_args': 1, 'signature': 'log1p(x)', 'forms': [['x']], 'description': 'applies ln(1+x) accurately for values near zero', 'details': '', 'params': {'x': 'values greater than -1 (number, list or tensor)'}, 'aliases': []},
'expm1': {'min_args': 1, 'max_args': 1, 'signature': 'expm1(x)', 'forms': [['x']], 'description': 'applies exp(x)-1 accurately for values near zero', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'reciprocal': {'min_args': 1, 'max_args': 1, 'signature': 'reciprocal(x)', 'forms': [['x']], 'description': 'computes 1/x element-wise', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'first log-space value (number, list or tensor)', 'y': 'second log-space value (number, list or tensor)'}, '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': '', 'params': {'x': 'values (list or tensor)', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'x': 'number, list or tensor', 'p': 'norm order (default: 2)', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'x': 'list or tensor', 'p': 'norm order (default: 2)', 'dim': 'dimension to work along (default: last)', 'eps': 'smallest allowed divisor (default: 1e-12)'}, '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': '', 'params': {'x': 'tensor shaped [N, C, ...]', 'groups': 'number of channel groups; must divide the channel count', 'weight': 'per-channel scale, length C (default: none)', 'bias': 'per-channel shift, length C (default: none)', 'eps': 'value added to the variance for stability (default: 1e-5)'}, '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': '', 'params': {'x': 'first tensor; flattened first', 'y': 'second tensor; flattened first'}, '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': '', 'params': {'x': 'matrix, or a batch of matrices in the last two dimensions'}, 'aliases': []},
'det': {'min_args': 1, 'max_args': 1, 'signature': 'det(x)', 'forms': [['x']], 'description': 'computes the determinant of each square matrix in x', 'details': '', 'params': {'x': 'matrix, or a batch of matrices in the last two dimensions'}, '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': '', 'params': {'x': 'real-valued signal', 'dim': 'dimension to transform (default: last)'}, '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': '', 'params': {'x': 'complex half-spectrum, e.g. from rfft()', 'n': 'length of the output signal (default: 2 * (input length - 1))', 'dim': 'dimension to transform (default: last)'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'values; one list or tensor gives its smallest element, several values give the smallest of all'}, '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': '', 'params': {'x': 'values; one list or tensor gives its largest element, several values give the largest of all'}, 'aliases': []},
'tmin': {'min_args': 2, 'max_args': 2, 'signature': 'tmin(a, b)', 'forms': [['a', 'b']], 'description': 'element-wise minimum of a and b; min(a, b) for plain numbers', 'details': '', 'params': {'a': 'first values; tensors broadcast', 'b': 'second values; tensors broadcast'}, 'aliases': []},
'tmax': {'min_args': 2, 'max_args': 2, 'signature': 'tmax(a, b)', 'forms': [['a', 'b']], 'description': 'element-wise maximum of a and b; max(a, b) for plain numbers', 'details': '', 'params': {'a': 'first values; tensors broadcast', 'b': 'second values; tensors broadcast'}, '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': '', 'params': {'x': 'tensor or list to normalise', 'dim': 'dimension whose slices are normalised (default: last)'}, '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': '', 'params': {'x': 'number, list or tensor', 'dim': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'round': {'min_args': 1, 'max_args': 1, 'signature': 'round(x)', 'forms': [['x']], 'description': 'rounds x to the nearest integer', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'gamma': {'min_args': 1, 'max_args': 1, 'signature': 'gamma(x)', 'forms': [['x']], 'description': 'computes the gamma function (per element)', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'pow': {'min_args': 2, 'max_args': 2, 'signature': 'pow(base, exponent)', 'forms': [['base', 'exponent']], 'description': 'computes base raised to the power of exponent', 'details': '', 'params': {'base': 'number, list or tensor to raise', 'exponent': 'power to raise base to; tensors broadcast'}, 'aliases': []},
'sigm': {'min_args': 1, 'max_args': 1, 'signature': 'sigm(x)', 'forms': [['x']], 'description': 'applies the sigmoid function: 1 / (1 + exp(-x))', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element', 'min': 'lower bound', 'max': 'upper bound'}, 'aliases': []},
'fft': {'min_args': 1, 'max_args': 1, 'signature': 'fft(x)', 'forms': [['x']], 'description': 'computes fast Fourier transform of x', 'details': '', 'params': {'x': 'tensor, transformed over all dimensions'}, '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': '', 'params': {'x': 'spectrum to transform back; may use the K/Kx/Ky/frequency variables', 'shape': 'shape used for the K/Kx/Ky frequency variables (default: the node\'s input shape)'}, 'aliases': []},
'angle': {'min_args': 1, 'max_args': 1, 'signature': 'angle(x)', 'forms': [['x']], 'description': 'returns the angle of a complex number or vector', 'details': '', 'params': {'x': 'complex or real values (number, list or tensor)'}, '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': '', 'params': {'x': 'value to print; it is also returned unchanged'}, 'aliases': []},
'print_shape': {'min_args': 1, 'max_args': 1, 'signature': 'print_shape(x)', 'forms': [['x']], 'description': 'prints the shape of the tensor x', 'details': '', 'params': {'x': 'value whose shape is printed; it is also returned unchanged'}, 'aliases': ['pshp']},
'pshp': {'min_args': 1, 'max_args': 1, 'signature': 'pshp(x)', 'forms': [['x']], 'description': 'prints the shape of the tensor x', 'details': '', 'params': {'x': 'value whose shape is printed; it is also returned unchanged'}, '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': '', 'params': {'x': 'values to clean', 'nan': 'replacement for NaN', 'pos_inf': 'replacement for +infinity', 'neg_inf': 'replacement for -infinity'}, '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': '', 'params': {'x': 'values to clean', 'nan': 'replacement for NaN', 'pos_inf': 'replacement for +infinity', 'neg_inf': 'replacement for -infinity'}, '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': '', 'params': {'a': 'value at t = 0', 'b': 'value at t = 1', 't': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'a': 'vectors at t = 0', 'b': 'vectors at t = 1', 't': 'progress from 0 (gives a) to 1 (gives b)', 'dim': 'dimension holding the vector components (default: all elements form one vector)'}, 'aliases': []},
'step': {'min_args': 2, 'max_args': 2, 'signature': 'step(x, edge)', 'forms': [['x', 'edge']], 'description': 'returns 0 if x < edge, else 1', 'details': '', 'params': {'x': 'values to test (number, list or tensor)', 'edge': 'threshold; the result is 1 where x >= edge, otherwise 0'}, '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': '', 'params': {'x': 'input values', 'edge0': 'value mapped to 0', 'edge1': 'value mapped to 1'}, 'aliases': []},
'fract': {'min_args': 1, 'max_args': 1, 'signature': 'fract(x)', 'forms': [['x']], 'description': 'returns the fractional part of x: x - floor(x)', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'relu': {'min_args': 1, 'max_args': 1, 'signature': 'relu(x)', 'forms': [['x']], 'description': 'applies rectified linear unit function: max(0, x)', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'softsign': {'min_args': 1, 'max_args': 1, 'signature': 'softsign(x)', 'forms': [['x']], 'description': 'applies x / (1 + abs(x)) element-wise', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, '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': '', 'params': {'x': 'number, list or tensor; applied to each element', 'negative_slope': 'slope used for negative inputs (default: 0.01)'}, 'aliases': []},
'softplus': {'min_args': 1, 'max_args': 1, 'signature': 'softplus(x)', 'forms': [['x']], 'description': 'applies the softplus function: ln(1 + exp(x))', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'gelu': {'min_args': 1, 'max_args': 1, 'signature': 'gelu(x)', 'forms': [['x']], 'description': 'applies the Gaussian Error Linear Unit (GELU) activation function', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'silu': {'min_args': 1, 'max_args': 1, 'signature': 'silu(x)', 'forms': [['x']], 'description': 'applies the Sigmoid Linear Unit activation element-wise', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'sign': {'min_args': 1, 'max_args': 1, 'signature': 'sign(x)', 'forms': [['x']], 'description': 'returns the sign of x: -1, 0, or 1', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'degrees': {'min_args': 1, 'max_args': 1, 'signature': 'degrees(x)', 'forms': [['x']], 'description': 'converts radians to degrees (per element)', 'details': '', 'params': {'x': 'angle in radians (number, list or tensor)'}, 'aliases': []},
'radians': {'min_args': 1, 'max_args': 1, 'signature': 'radians(x)', 'forms': [['x']], 'description': 'converts degrees to radians (per element)', 'details': '', 'params': {'x': 'angle in degrees (number, list or tensor)'}, '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': '', 'params': {'x': 'values; zero counts as false (number, list or tensor)'}, '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': '', 'params': {'x': 'values; non-zero counts as true', 'y': 'values; non-zero counts as true'}, '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': '', 'params': {'x': 'values; non-zero counts as true', 'y': 'values; non-zero counts as true'}, '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': '', 'params': {'x': 'first coordinate (number, list or tensor)', 'y': 'second coordinate (number, list or tensor)'}, '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': '', 'params': {'tensor': 'tensor to sample from', 'coord1': 'sample positions (element indices) along the first mapped dimension; mapped dimensions are the last ones of tensor', 'coord2': 'sample positions along the second mapped dimension', 'coord3': 'sample positions along the third mapped dimension'}, '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': '', 'params': {'tensor': 'input, channels first or last', 'size_x': 'kernel size along the first spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension'}, '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': '', 'params': {'tensor': 'input, channels first or last', 'size_x': 'kernel size along the first spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension'}, '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': '', 'params': {'tensor': 'input shaped [batch, channel, spatial...]', 'size_x': 'kernel size along the first spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension'}, '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': '', 'params': {'tensor': 'input shaped [batch, channel, spatial...]', 'size_x': 'kernel size along the first spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension'}, 'aliases': ['convolution']},
'swap': {'min_args': 4, 'max_args': 4, 'signature': 'swap(x, dim, index1, index2)', 'forms': [['x', 'dim', 'index1', 'index2']], 'description': 'swaps the elements at index1 and index2 along dim', 'details': '', 'params': {'x': 'tensor', 'dim': 'dimension to swap along', 'index1': 'first position', 'index2': 'second position'}, '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': '', 'params': {'x': 'tensor', 'dim0': 'first dimension to swap', 'dim1': 'second dimension to swap'}, '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': '', 'params': {'x': 'tensor', 'dim0': 'first dimension to swap', 'dim1': 'second dimension to swap'}, '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': '', 'params': {'x': 'tensor', 'dims': 'new order of the dimensions, e.g. [0, 2, 1]'}, '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': '', 'params': {'x': 'tensor', 'dims': 'new order of the dimensions, e.g. [0, 2, 1]'}, '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': '', 'params': {'x': 'tensor', 'shape': 'new shape; the total number of elements must stay the same'}, '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': '', 'params': {'x': 'tensor', 'shape': 'new shape; the total number of elements must stay the same'}, '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': '', 'params': {'start': 'first value', 'stop': 'end of the range (not included)', 'step': 'distance between consecutive values'}, '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': '', 'params': {'num': 'number of values'}, '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': '', 'params': {'start': 'exponent of the first value', 'stop': 'exponent of the last value', 'num': 'number of values', 'base': 'base of the exponent'}, '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': '', 'params': {'k': 'number of elements to keep', 'dim': 'dimension to select along (default: last)'}, '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': '', 'params': {'k': 'number of elements to keep', 'dim': 'dimension to select along (default: last)'}, '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': '', 'params': {}, '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': '', 'params': {'pseudo': 'truthy to compute the Moore-Penrose pseudoinverse, which also works for singular and non-square matrices (default: false)'}, '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': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'rtol': 'relative tolerance (default: 1e-5)', 'atol': 'absolute tolerance (default: 1e-8)'}, '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': '', 'params': {'rtol': 'relative tolerance (default: 1e-5)', 'atol': 'absolute tolerance (default: 1e-8)'}, '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': '', 'params': {'q': 'quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'q': 'quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'p': 'percentile 0-100', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'p': 'percentile 0-100', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'q': 'quantile 0-1', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {}, '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': '', 'params': {'a': 'centre the moment is taken around', 'k': 'order of the moment'}, 'aliases': []},
'erf': {'min_args': 1, 'max_args': 1, 'signature': 'erf(x)', 'forms': [['x']], 'description': 'computes the error function (torch.erf)', 'details': '', 'params': {}, 'aliases': []},
'erfc': {'min_args': 1, 'max_args': 1, 'signature': 'erfc(x)', 'forms': [['x']], 'description': 'computes the complementary error function (torch.special.erfc)', 'details': '', 'params': {}, 'aliases': []},
'erfinv': {'min_args': 1, 'max_args': 1, 'signature': 'erfinv(x)', 'forms': [['x']], 'description': 'computes the inverse error function (torch.erfinv)', 'details': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'kernel_size': 'odd Sobel kernel size, at least 3 (default: 3)'}, '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': '', 'params': {'sigma': 'blur strength as the standard deviation in elements; 0 or less returns x unchanged', 'reshape': 'truthy to find the channel dimension automatically; otherwise channels must be last (default: false)'}, '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': '', 'params': {'sigma': 'blur strength as the standard deviation in elements; 0 or less returns x unchanged', 'reshape': 'truthy to find the channel dimension automatically; otherwise channels must be last (default: false)'}, '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': '', 'params': {'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'dim': 'dimension to accumulate along (default: 0)'}, 'aliases': []},
'cumprod': {'min_args': 1, 'max_args': 1, 'signature': 'cumprod(x)', 'forms': [['x']], 'description': 'computes the cumulative product over first dimension.', 'details': '', 'params': {}, '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': '', 'params': {'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, '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': '', 'params': {'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, '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': '', 'params': {'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, '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': '', 'params': {'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, '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': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'edge0': 'value mapped to 0', 'edge1': 'value mapped to 1'}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'i_min': 'start of the input range', 'i_max': 'end of the input range', 'o_min': 'value i_min maps to', 'o_max': 'value i_max maps to'}, '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': '', 'params': {}, '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': '', 'params': {}, 'aliases': ['cossim']},
'count': {'min_args': 1, 'max_args': 1, 'signature': 'count(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'params': {}, 'aliases': ['cnt', 'length']},
'cnt': {'min_args': 1, 'max_args': 1, 'signature': 'cnt(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'params': {}, 'aliases': ['count', 'length']},
'length': {'min_args': 1, 'max_args': 1, 'signature': 'length(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'count': 'number of repeats, or a list with one count per dimension', 'dims': 'dimension or list of dimensions to repeat along; without it a number repeats each element of the flattened input and a list tiles the whole tensor'}, 'aliases': []},
'flatten': {'min_args': 1, 'max_args': 1, 'signature': 'flatten(x)', 'forms': [['x']], 'description': 'flattens tensor into a 1D tensor', 'details': '', 'params': {}, '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': '', 'params': {'y': 'item, list or tensor added to the end of x'}, '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': '', 'params': {'position': 'list with one index per dimension'}, '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': '', 'params': {}, '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': '', 'params': {'indices': 'batch indices to take, in order; batches may repeat or be skipped'}, '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': '', 'params': {'indices': 'batch indices to take, in order; batches may repeat or be skipped'}, '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': '', 'params': {'indices': 'batch indices to take, in order; batches may repeat or be skipped'}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'condition': 'non-zero selects x, zero selects y'}, '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': '', 'params': {'bins': 'number of equal-width bins', 'min': 'lower edge of the first bin', 'max': 'upper edge of the last bin'}, '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': '', 'params': {'bins': 'number of equal-width bins', 'min': 'lower edge of the first bin', 'max': 'upper edge of the last bin'}, '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': '', 'params': {'offset': 'position of the overlay\'s low corner in base, one value per dimension', 'opacity': '0-1 blend amount; a number or a tensor shaped like overlay (default: 1)'}, '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': '', 'params': {'padding': 'amounts as [dim0_before, dim0_after, dim1_before, dim1_after, ...]'}, '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': '', 'params': {}, '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': '', 'params': {}, 'aliases': []},
'linspace': {'min_args': 3, 'max_args': 3, 'signature': 'linspace(start, stop, count)', 'forms': [['start', 'stop', 'count']], 'description': 'creates count evenly spaced values from start to stop (both included). Use range to control the step instead.', 'details': '', 'params': {'start': 'first value', 'stop': 'last value (included)', 'count': 'number of values'}, 'aliases': []},
'logspace': {'min_args': 4, 'max_args': 4, 'signature': 'logspace(start, stop, count, base)', 'forms': [['start', 'stop', 'count', 'base']], 'description': 'creates count values from base^start to base^stop, evenly spaced in the exponent', 'details': '', 'params': {'start': 'exponent of the first value', 'stop': 'exponent of the last value', 'count': 'number of values', 'base': 'base of the exponent'}, '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': '', 'params': {'x': 'list or tensor', 'k': 'number of elements to keep', 'dim': 'dimension to select along (default: last)'}, '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': '', 'params': {'x': 'list or tensor', 'k': 'number of elements to keep', 'dim': 'dimension to select along (default: last)'}, 'aliases': []},
'pinv': {'min_args': 1, 'max_args': 1, 'signature': 'pinv(permutation)', 'forms': [['permutation']], 'description': 'computes the inverse permutation: where permutation[i] == j the result has result[j] == i. Not the matrix pseudoinverse; use inv(matrix, 1) for that', 'details': '', 'params': {'permutation': 'list or tensor holding each index exactly once'}, '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': '', 'params': {'x': 'matrix, or a batch of matrices in the last two dimensions', 'pseudo': 'truthy to compute the Moore-Penrose pseudoinverse, which also works for singular and non-square matrices (default: false)'}, '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': '', 'params': {'x': 'values to add up (number, list or tensor)', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'x': 'values to average (number, list or tensor)', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'x': 'values (number, list or tensor)', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'x': 'values (number, list or tensor)', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'x': 'values to multiply (number, list or tensor)', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'a': 'first values to compare', 'b': 'second values to compare', 'rtol': 'relative tolerance (default: 1e-5)', 'atol': 'absolute tolerance (default: 1e-8)'}, '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': '', 'params': {'a': 'first values to compare', 'b': 'second values to compare', 'rtol': 'relative tolerance (default: 1e-5)', 'atol': 'absolute tolerance (default: 1e-8)'}, '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': '', 'params': {'x': 'values (list or tensor)', 'q': 'quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'x': 'values (list or tensor)', 'q': 'quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'x': 'values (list or tensor)', 'p': 'percentile 0-100', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'x': 'values (list or tensor)', 'p': 'percentile 0-100', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'x': 'values (list or tensor)', 'q': 'quantile 0-1', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'x': 'first tensor; flattened before multiplying', 'y': 'second tensor with the same number of elements'}, 'aliases': []},
'moment': {'min_args': 3, 'max_args': 3, 'signature': 'moment(x, center, order)', 'forms': [['x', 'center', 'order']], 'description': 'computes the order-th moment of x around center: mean((x - center)^order)', 'details': '', 'params': {'x': 'values (list or tensor)', 'center': 'centre the moment is taken around', 'order': 'order of the moment'}, 'aliases': []},
'erf': {'min_args': 1, 'max_args': 1, 'signature': 'erf(x)', 'forms': [['x']], 'description': 'computes the error function (torch.erf)', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'erfc': {'min_args': 1, 'max_args': 1, 'signature': 'erfc(x)', 'forms': [['x']], 'description': 'computes the complementary error function (torch.special.erfc)', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
'erfinv': {'min_args': 1, 'max_args': 1, 'signature': 'erfinv(x)', 'forms': [['x']], 'description': 'computes the inverse error function (torch.erfinv)', 'details': '', 'params': {'x': 'value in -1..1 (number, list or tensor)'}, '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': '', 'params': {'x': 'values to test (number, list or tensor)'}, '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': '', 'params': {'x': 'values to test (number, list or tensor)'}, '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': '', 'params': {'x': 'image or tensor', 'kernel_size': 'odd Sobel kernel size, at least 3 (default: 3)'}, 'aliases': []},
'blur': {'min_args': 2, 'max_args': 3, 'signature': 'blur(x, sigma, [auto_channels])', 'forms': [['x', 'sigma', '[auto_channels]']], 'description': 'applies a separable Gaussian blur to x. Channels are expected last unless auto_channels is truthy', 'details': '', 'params': {'x': 'image or tensor to blur', 'sigma': 'blur strength as the standard deviation in elements; 0 or less returns x unchanged', 'auto_channels': 'truthy to find the channel dimension automatically; otherwise channels must be last (default: false)'}, 'aliases': ['gaussian']},
'gaussian': {'min_args': 2, 'max_args': 3, 'signature': 'gaussian(x, sigma, [auto_channels])', 'forms': [['x', 'sigma', '[auto_channels]']], 'description': 'applies a separable Gaussian blur to x. Channels are expected last unless auto_channels is truthy', 'details': '', 'params': {'x': 'image or tensor to blur', 'sigma': 'blur strength as the standard deviation in elements; 0 or less returns x unchanged', 'auto_channels': 'truthy to find the channel dimension automatically; otherwise channels must be last (default: false)'}, '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': '', 'params': {'x': 'values (list or tensor)', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'x': 'values (list or tensor)', 'dim': 'dimension to reduce (default: all elements)'}, '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': '', 'params': {'x': 'list or tensor', 'dim': 'dimension to accumulate along (default: 0)'}, 'aliases': []},
'cumprod': {'min_args': 1, 'max_args': 1, 'signature': 'cumprod(x)', 'forms': [['x']], 'description': 'computes the cumulative product over first dimension.', 'details': '', 'params': {'x': 'list or tensor'}, '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': '', 'params': {'x': 'list or tensor', 'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, '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': '', 'params': {'x': 'list or tensor', 'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, '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': '', 'params': {'x': 'list or tensor', 'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, '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': '', 'params': {'x': 'list or tensor', 'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, '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': '', 'params': {'a': 'value at t = 0', 'b': 'value at t = 1', 't': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'a': 'value at t = 0', 'b': 'value at t = 1', 't': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'a': 'value at t = 0', 'b': 'value at t = 1', 't': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'a': 'value at t = 0', 'b': 'value at t = 1', 't': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'a': 'value at t = 0', 'b': 'value at t = 1', 't': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'a': 'value at t = 0', 'b': 'value at t = 1', 't': 'progress from 0 (gives a) to 1 (gives b)'}, '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': '', 'params': {'x': 'input values', 'edge0': 'value mapped to 0', 'edge1': 'value mapped to 1'}, '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': '', 'params': {'x1': 'x of the first point', 'y1': 'y of the first point', 'x2': 'x of the second point', 'y2': 'y of the second point'}, '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': '', 'params': {'x1': 'x of the first point', 'y1': 'y of the first point', 'x2': 'x of the second point', 'y2': 'y of the second point'}, 'aliases': ['dist']},
'remap': {'min_args': 5, 'max_args': 5, 'signature': 'remap(x, in_min, in_max, out_min, out_max)', 'forms': [['x', 'in_min', 'in_max', 'out_min', 'out_max']], 'description': 'remaps values from input range to output range', 'details': '', 'params': {'x': 'values to remap (number, list or tensor)', 'in_min': 'start of the input range', 'in_max': 'end of the input range', 'out_min': 'value in_min maps to', 'out_max': 'value in_max maps to'}, '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': '', 'params': {'x': 'vectors along the last dimension', 'y': 'vectors along the last dimension'}, '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': '', 'params': {'x': 'vectors along the last dimension', 'y': 'vectors along the last dimension'}, 'aliases': ['cossim']},
'count': {'min_args': 1, 'max_args': 1, 'signature': 'count(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'params': {'x': 'list, tensor, dictionary or value'}, 'aliases': ['cnt', 'length']},
'cnt': {'min_args': 1, 'max_args': 1, 'signature': 'cnt(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'params': {'x': 'list, tensor, dictionary or value'}, 'aliases': ['count', 'length']},
'length': {'min_args': 1, 'max_args': 1, 'signature': 'length(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'params': {'x': 'list, tensor, dictionary or value'}, 'aliases': ['count', 'cnt']},
'keys': {'min_args': 1, 'max_args': 1, 'signature': 'keys(dict)', 'forms': [['dict']], 'description': 'returns a list of dictionary keys in insertion order', 'details': '', 'params': {'dict': 'dictionary'}, 'aliases': []},
'enable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'enable_tracking(dict)', 'forms': [['dict']], 'description': 'enables change tracking for a ChangeTrackingDict and returns it', 'details': '', 'params': {'dict': 'ChangeTrackingDict (other values are returned unchanged)'}, 'aliases': ['track_on']},
'track_on': {'min_args': 1, 'max_args': 1, 'signature': 'track_on(dict)', 'forms': [['dict']], 'description': 'enables change tracking for a ChangeTrackingDict and returns it', 'details': '', 'params': {'dict': 'ChangeTrackingDict (other values are returned unchanged)'}, 'aliases': ['enable_tracking']},
'disable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'disable_tracking(dict)', 'forms': [['dict']], 'description': 'disables change tracking for a ChangeTrackingDict and returns it', 'details': '', 'params': {'dict': 'ChangeTrackingDict (other values are returned unchanged)'}, 'aliases': ['track_off']},
'track_off': {'min_args': 1, 'max_args': 1, 'signature': 'track_off(dict)', 'forms': [['dict']], 'description': 'disables change tracking for a ChangeTrackingDict and returns it', 'details': '', 'params': {'dict': 'ChangeTrackingDict (other values are returned unchanged)'}, 'aliases': ['disable_tracking']},
'reset_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'reset_tracking(dict)', 'forms': [['dict']], 'description': 'resets the change tracking state of a ChangeTrackingDict and returns it', 'details': '', 'params': {'dict': 'ChangeTrackingDict (other values are returned unchanged)'}, 'aliases': ['track_reset']},
'track_reset': {'min_args': 1, 'max_args': 1, 'signature': 'track_reset(dict)', 'forms': [['dict']], 'description': 'resets the change tracking state of a ChangeTrackingDict and returns it', 'details': '', 'params': {'dict': 'ChangeTrackingDict (other values are returned unchanged)'}, 'aliases': ['reset_tracking']},
'get_changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_changed_keys(dict)', 'forms': [['dict']], 'description': 'returns the keys that were modified or added in a ChangeTrackingDict', 'details': '', 'params': {'dict': 'ChangeTrackingDict'}, 'aliases': ['changed_keys']},
'changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'changed_keys(dict)', 'forms': [['dict']], 'description': 'returns the keys that were modified or added in a ChangeTrackingDict', 'details': '', 'params': {'dict': 'ChangeTrackingDict'}, 'aliases': ['get_changed_keys']},
'get_added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_added_keys(dict)', 'forms': [['dict']], 'description': 'returns the keys that were newly added to a ChangeTrackingDict', 'details': '', 'params': {'dict': 'ChangeTrackingDict'}, 'aliases': ['added_keys']},
'added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'added_keys(dict)', 'forms': [['dict']], 'description': 'returns the keys that were newly added to a ChangeTrackingDict', 'details': '', 'params': {'dict': 'ChangeTrackingDict'}, 'aliases': ['get_added_keys']},
'get_removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_removed_keys(dict)', 'forms': [['dict']], 'description': 'returns the keys that were removed from a ChangeTrackingDict', 'details': '', 'params': {'dict': 'ChangeTrackingDict'}, 'aliases': ['removed_keys']},
'removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'removed_keys(dict)', 'forms': [['dict']], 'description': 'returns the keys that were removed from a ChangeTrackingDict', 'details': '', 'params': {'dict': 'ChangeTrackingDict'}, 'aliases': ['get_removed_keys']},
'get_unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_unchanged_keys(dict)', 'forms': [['dict']], 'description': 'returns the keys that are unchanged in a ChangeTrackingDict', 'details': '', 'params': {'dict': 'ChangeTrackingDict'}, 'aliases': ['unchanged_keys']},
'unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'unchanged_keys(dict)', 'forms': [['dict']], 'description': 'returns the keys that are unchanged in a ChangeTrackingDict', 'details': '', 'params': {'dict': 'ChangeTrackingDict'}, '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': '', 'params': {'x': 'text, list or tensor to repeat', 'count': 'number of repeats, or a list with one count per dimension', 'dims': 'dimension or list of dimensions to repeat along; without it a number repeats each element of the flattened input and a list tiles the whole tensor'}, 'aliases': []},
'flatten': {'min_args': 1, 'max_args': 1, 'signature': 'flatten(x)', 'forms': [['x']], 'description': 'flattens tensor into a 1D tensor', 'details': '', 'params': {'x': 'tensor or nested list'}, 'aliases': []},
'append': {'min_args': 2, 'max_args': 2, 'signature': 'append(list, item)', 'forms': [['list', 'item']], 'description': 'adds item to the end of list. To join tensors along a dimension use concatenate(...)', 'details': '', 'params': {'list': 'list, tensor or value to extend', 'item': 'item, list or tensor added to the end of list'}, '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': '', 'params': {'tensor': 'tensor to read from', 'position': 'list with one index per dimension'}, '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': '', 'params': {'image': 'image to warp', 'flow': 'per-pixel displacement [..., 2], e.g. from rife()'}, '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': '', 'params': {'x': 'tensor whose first dimension is the batch', 'indices': 'batch indices to take, in order; batches may repeat or be skipped'}, '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': '', 'params': {'x': 'tensor whose first dimension is the batch', 'indices': 'batch indices to take, in order; batches may repeat or be skipped'}, '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': '', 'params': {'x': 'tensor whose first dimension is the batch', 'indices': 'batch indices to take, in order; batches may repeat or be skipped'}, 'aliases': ['batch_shuffle', 'shuffle']},
'motion_mask': {'min_args': 1, 'max_args': 1, 'signature': 'motion_mask(flow)', 'forms': [['flow']], 'description': 'generates a motion mask from optical flow', 'details': '', 'params': {'flow': 'optical flow [..., 2], e.g. from rife()'}, 'aliases': []},
'flow_to_image': {'min_args': 1, 'max_args': 1, 'signature': 'flow_to_image(flow)', 'forms': [['flow']], 'description': 'converts optical flow to an RGB image. Up-down is blue-yellow, left-right is green-magenta.', 'details': '', 'params': {'flow': 'optical flow [..., 2], e.g. from rife()'}, 'aliases': []},
'flow_mag': {'min_args': 1, 'max_args': 1, 'signature': 'flow_mag(flow)', 'forms': [['flow']], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'params': {'flow': 'optical flow [..., 2], e.g. from rife()'}, 'aliases': ['flow_magnitude']},
'flow_magnitude': {'min_args': 1, 'max_args': 1, 'signature': 'flow_magnitude(flow)', 'forms': [['flow']], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'params': {'flow': 'optical flow [..., 2], e.g. from rife()'}, 'aliases': ['flow_mag']},
'flow_ang': {'min_args': 1, 'max_args': 1, 'signature': 'flow_ang(flow)', 'forms': [['flow']], 'description': 'computes the angle atan2(dy, dx) of optical flow (like angle(), with real and imaginary parts in the last dimension)', 'details': '', 'params': {'flow': 'optical flow [..., 2], e.g. from rife()'}, 'aliases': ['flow_angle']},
'flow_angle': {'min_args': 1, 'max_args': 1, 'signature': 'flow_angle(flow)', 'forms': [['flow']], 'description': 'computes the angle atan2(dy, dx) of optical flow (like angle(), with real and imaginary parts in the last dimension)', 'details': '', 'params': {'flow': 'optical flow [..., 2], e.g. from rife()'}, 'aliases': ['flow_ang']},
'where': {'min_args': 3, 'max_args': 3, 'signature': 'where(condition, if_true, if_false)', 'forms': [['condition', 'if_true', 'if_false']], 'description': 'returns if_true where condition is non-zero, otherwise if_false. Runs per element', 'details': '', 'params': {'condition': 'non-zero selects if_true, zero selects if_false', 'if_true': 'value used where condition is non-zero', 'if_false': 'value used where condition is zero'}, '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': '', 'params': {'x': 'values; flattened', 'bins': 'number of equal-width bins', 'min': 'lower edge of the first bin', 'max': 'upper edge of the last bin'}, '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': '', 'params': {'x': 'values; flattened', 'bins': 'number of equal-width bins', 'min': 'lower edge of the first bin', 'max': 'upper edge of the last bin'}, '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': '', 'params': {'base': 'background value, list, text or tensor', 'overlay': 'value placed on top of base', 'offset': 'position of the overlay\'s low corner in base, one value per dimension', 'opacity': '0-1 blend amount; a number or a tensor shaped like overlay (default: 1)'}, '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': '', 'params': {'x': 'tensor to pad', 'padding': 'amounts as [dim0_before, dim0_after, dim1_before, dim1_after, ...]'}, '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': '', 'params': {'x': 'vectors with 3 components in the last dimension', 'y': 'vectors with 3 components in the last dimension'}, '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': '', 'params': {'x': 'left matrix or batch of matrices', 'y': 'right matrix or batch of matrices'}, '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': '', 'params': {'A': 'square coefficient matrix', 'b': 'right-hand side'}, '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': '', 'params': {'tol': 'absolute tolerance below which singular values count as zero'}, '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': '', 'params': {'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'}, 'aliases': []},
'bnot': {'min_args': 1, 'max_args': 1, 'signature': 'bnot(x)', 'forms': [['x']], 'description': 'computes the bitwise NOT', 'details': '', 'params': {}, 'aliases': ['bitwise_not']},
'bitwise_not': {'min_args': 1, 'max_args': 1, 'signature': 'bitwise_not(x)', 'forms': [['x']], 'description': 'computes the bitwise NOT', 'details': '', 'params': {}, 'aliases': ['bnot']},
'bitcount': {'min_args': 1, 'max_args': 1, 'signature': 'bitcount(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'params': {}, 'aliases': ['popcount', 'popcnt']},
'popcount': {'min_args': 1, 'max_args': 1, 'signature': 'popcount(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'params': {}, 'aliases': ['bitcount', 'popcnt']},
'popcnt': {'min_args': 1, 'max_args': 1, 'signature': 'popcnt(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, 'aliases': ['bor']},
'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': '', 'params': {'x': 'matrix, or a batch of matrices in the last two dimensions', 'tol': 'absolute tolerance below which singular values count as zero'}, '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': '', 'params': {'image1': 'first frame', 'image2': 'second frame', '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'}, 'aliases': []},
'bnot': {'min_args': 1, 'max_args': 1, 'signature': 'bnot(x)', 'forms': [['x']], 'description': 'computes the bitwise NOT', 'details': '', 'params': {'x': 'integer values (number, list or tensor)'}, 'aliases': ['bitwise_not']},
'bitwise_not': {'min_args': 1, 'max_args': 1, 'signature': 'bitwise_not(x)', 'forms': [['x']], 'description': 'computes the bitwise NOT', 'details': '', 'params': {'x': 'integer values (number, list or tensor)'}, 'aliases': ['bnot']},
'bitcount': {'min_args': 1, 'max_args': 1, 'signature': 'bitcount(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'params': {'x': 'integer values (number, list or tensor)'}, 'aliases': ['popcount', 'popcnt']},
'popcount': {'min_args': 1, 'max_args': 1, 'signature': 'popcount(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'params': {'x': 'integer values (number, list or tensor)'}, 'aliases': ['bitcount', 'popcnt']},
'popcnt': {'min_args': 1, 'max_args': 1, 'signature': 'popcnt(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'params': {'x': 'integer values (number, list or tensor)'}, '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': '', 'params': {'x': 'tensor, list or value'}, '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': '', 'params': {'x': 'integer values (number, list or tensor)', 'y': 'integer values (number, list or tensor)'}, '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': '', 'params': {'x': 'integer values (number, list or tensor)', 'y': 'integer values (number, list or tensor)'}, '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': '', 'params': {'x': 'integer values (number, list or tensor)', 'y': 'integer values (number, list or tensor)'}, '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': '', 'params': {'x': 'integer values (number, list or tensor)', 'y': 'integer values (number, list or tensor)'}, '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': '', 'params': {'x': 'integer values (number, list or tensor)', 'y': 'integer values (number, list or tensor)'}, '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': '', 'params': {'x': 'integer values (number, list or tensor)', 'y': 'integer values (number, list or tensor)'}, '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': '', 'params': {'shape': 'list of dimension sizes', 'value': 'fill value (default: 0)', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, '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': '', 'params': {'shape': 'list of dimension sizes', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, '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': '', 'params': {'shape': 'list of dimension sizes', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, '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': '', 'params': {'n': 'number of rows and columns', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, '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': '', 'params': {'indices': 'integer class indices', 'classes': 'number of classes, i.e. the length of each one-hot vector'}, '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': '', 'params': {'reduction': '"mean" (default), "sum", or "none" for element-wise values'}, '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': '', 'params': {'reduction': '"mean" (default), "sum", or "none" for element-wise values'}, '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': '', 'params': {'data_range': 'difference between the largest and smallest possible value (default: 1)'}, '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': '', 'params': {'weights': 'weight of each element, broadcast against x', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'delta': 'error size where the loss changes from quadratic to linear (default: 1)', 'reduction': '"mean" (default), "sum", or "none" for element-wise values'}, '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': '', 'params': {'a': 'first values (broadcast against b)', 'b': 'second values', 'reduction': '"mean" (default), "sum", or "none" for element-wise values'}, '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': '', 'params': {'a': 'first values (broadcast against b)', 'b': 'second values', 'reduction': '"mean" (default), "sum", or "none" for element-wise values'}, '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': '', 'params': {'a': 'first image', 'b': 'second image', 'data_range': 'difference between the largest and smallest possible value (default: 1)'}, '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': '', 'params': {'x': 'values (list or tensor)', 'weights': 'weight of each element, broadcast against x', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, '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': '', 'params': {'prediction': 'predicted values', 'target': 'expected values', 'delta': 'error size where the loss changes from quadratic to linear (default: 1)', 'reduction': '"mean" (default), "sum", or "none" for element-wise values'}, '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': '', 'params': {'logits': 'unnormalised class scores', 'target': 'class indices, or class probabilities with the same shape as logits', 'dim': 'class dimension (default: 1, or 0 for a single vector)', 'reduction': '"mean" (default), "sum", or "none" for element-wise values'}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, 'aliases': ['remove_key']},
'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': '', 'params': {'dict': 'dictionary to change; it is also returned', 'key': 'entry name', 'value': 'entry value'}, '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': '', 'params': {'dict': 'dictionary to change; it is also returned', 'key': 'entry name to remove; missing keys are ignored'}, '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': '', 'params': {'dict': 'dictionary to change; it is also returned', 'key': 'entry name to remove; missing keys are ignored'}, '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': '', 'params': {'slot': 'stack number (any integer)', 'val': 'value to push; it is also returned'}, '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': '', 'params': {}, 'aliases': []},
'stack_clear': {'min_args': 1, 'max_args': 1, 'signature': 'stack_clear(slot)', 'forms': [['slot']], 'description': 'clears the contents of slot stack', 'details': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'dim': 'dimension to join along (the last argument)'}, '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': '', 'params': {'dim': 'dimension to join along (the last argument)'}, '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': '', 'params': {'dim': 'dimension to join along (the last argument)'}, 'aliases': ['cat', 'concat']},
'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': '', 'params': {'slot': 'stack number (any integer)'}, 'aliases': []},
'stack_clear': {'min_args': 1, 'max_args': 1, 'signature': 'stack_clear(slot)', 'forms': [['slot']], 'description': 'clears the contents of slot stack', 'details': '', 'params': {'slot': 'stack number (any integer)'}, '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': '', 'params': {'slot': 'stack number (any integer)'}, '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': '', 'params': {'slot': 'stack number (any integer)'}, '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': '', 'params': {'x': 'first tensor or list; more may follow before dim', 'dim': 'dimension to join along (the last argument)'}, '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': '', 'params': {'x': 'first tensor or list; more may follow before dim', 'dim': 'dimension to join along (the last argument)'}, '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': '', 'params': {'x': 'first tensor or list; more may follow before dim', 'dim': 'dimension to join along (the last argument)'}, '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': '', 'params': {'tensors': 'list of tensors with equal shapes', 'dim': 'position of the new dimension (default: 0)'}, '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': '', 'params': {}, 'aliases': []},
'int': {'min_args': 1, 'max_args': 1, 'signature': 'int(x)', 'forms': [['x']], 'description': 'casts x to integer', 'details': '', 'params': {}, 'aliases': []},
'float': {'min_args': 1, 'max_args': 1, 'signature': 'float(x)', 'forms': [['x']], 'description': 'casts x to float', 'details': '', 'params': {}, 'aliases': []},
'upper': {'min_args': 1, 'max_args': 1, 'signature': 'upper(x)', 'forms': [['x']], 'description': 'converts string to uppercase', 'details': '', 'params': {}, 'aliases': []},
'lower': {'min_args': 1, 'max_args': 1, 'signature': 'lower(x)', 'forms': [['x']], 'description': 'converts string to lowercase', 'details': '', 'params': {}, 'aliases': []},
'trim': {'min_args': 1, 'max_args': 1, 'signature': 'trim(x)', 'forms': [['x']], 'description': 'removes leading and trailing whitespace from string', 'details': '', 'params': {}, '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': '', 'params': {'delimiter': 'text to split on (default: a space)'}, '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': '', 'params': {'separator': 'text placed between the items (default: "")'}, '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': '', 'params': {'start': 'index of the first character', 'length': 'number of characters (default: the rest of the text)'}, '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': '', 'params': {'start': 'index of the first character', 'length': 'number of characters (default: the rest of the text)'}, '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': '', 'params': {}, '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': '', 'params': {'old': 'text or value to look for', 'new': 'replacement'}, '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': '', 'params': {'kernel_size': 'size of the square kernel (default: 3)'}, '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': '', 'params': {'kernel_size': 'size of the square kernel (default: 3)'}, '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': '', 'params': {'kernel_size': 'size of the square kernel (default: 3)'}, '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': '', 'params': {'kernel_size': 'size of the square kernel (default: 3)'}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'degrees': 'truthy to use hue in 0-360 instead of 0-1'}, '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': '', 'params': {'degrees': 'truthy to use hue in 0-360 instead of 0-1'}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, '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': '', 'params': {'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, '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': '', 'params': {'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, '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': '', 'params': {'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, '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': '', 'params': {'font': 'font name to look up in the system fonts, or a path to a font file', 'size': 'font size in pixels', 'max_width': 'wrap lines wider than this many pixels (default: 0, no wrapping)', 'weight': 'font weight 100-900 as in CSS (default: 400)', 'rotation_angle': 'rotation in degrees, counter-clockwise (default: 0)', 'line_spacing': 'line distance as a multiple of the line height (default: 1)', 'italic': 'truthy for italic text (default: false)', 'underline': 'truthy to underline the text (default: false)'}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'full_matrices': 'truthy to return full-size U and Vh (default: false)'}, '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': '', 'params': {'full_matrices': 'truthy to return full-size U and Vh (default: false)'}, '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': '', 'params': {'shape': 'shape of the result', 'offset': 'diagonal offset: positive above, negative below the main diagonal (default: 0)', 'dim1': 'first dimension of the matrix (default: -2)', 'dim2': 'second dimension of the matrix (default: -1)'}, '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': '', 'params': {'shape': 'shape of the result', 'offset': 'diagonal offset: positive above, negative below the main diagonal (default: 0)', 'dim1': 'first dimension of the matrix (default: -2)', 'dim2': 'second dimension of the matrix (default: -1)'}, 'aliases': ['diagonal_matrix']},
'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': '', 'params': {'x': 'tensor'}, 'aliases': []},
'int': {'min_args': 1, 'max_args': 1, 'signature': 'int(x)', 'forms': [['x']], 'description': 'casts x to integer', 'details': '', 'params': {'x': 'value to convert; lists convert each item and text is parsed'}, 'aliases': []},
'float': {'min_args': 1, 'max_args': 1, 'signature': 'float(x)', 'forms': [['x']], 'description': 'casts x to float', 'details': '', 'params': {'x': 'value to convert; lists convert each item and text is parsed'}, 'aliases': []},
'upper': {'min_args': 1, 'max_args': 1, 'signature': 'upper(text)', 'forms': [['text']], 'description': 'converts string to uppercase', 'details': '', 'params': {'text': 'text'}, 'aliases': []},
'lower': {'min_args': 1, 'max_args': 1, 'signature': 'lower(text)', 'forms': [['text']], 'description': 'converts string to lowercase', 'details': '', 'params': {'text': 'text'}, 'aliases': []},
'trim': {'min_args': 1, 'max_args': 1, 'signature': 'trim(text)', 'forms': [['text']], 'description': 'removes leading and trailing whitespace from string', 'details': '', 'params': {'text': 'text'}, 'aliases': []},
'split': {'min_args': 1, 'max_args': 2, 'signature': 'split(text, [delimiter])', 'forms': [['text', '[delimiter]']], 'description': 'splits string to list of strings based on delimiter. Default is space.', 'details': '', 'params': {'text': 'text to split', 'delimiter': 'text to split on (default: a space)'}, 'aliases': []},
'join': {'min_args': 1, 'max_args': 2, 'signature': 'join(items, [separator])', 'forms': [['items', '[separator]']], 'description': 'joins items as text using separator (default ""). Use concatenate(...) to join tensors', 'details': '', 'params': {'items': 'list or tensor of items to join', 'separator': 'text placed between the items (default: "")'}, 'aliases': []},
'substring': {'min_args': 2, 'max_args': 3, 'signature': 'substring(text, start, [length])', 'forms': [['text', 'start', '[length]']], 'description': 'returns length characters of text starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'params': {'text': 'source text', 'start': 'index of the first character', 'length': 'number of characters (default: the rest of the text)'}, 'aliases': ['substr']},
'substr': {'min_args': 2, 'max_args': 3, 'signature': 'substr(text, start, [length])', 'forms': [['text', 'start', '[length]']], 'description': 'returns length characters of text starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'params': {'text': 'source text', 'start': 'index of the first character', 'length': 'number of characters (default: the rest of the text)'}, 'aliases': ['substring']},
'find': {'min_args': 2, 'max_args': 2, 'signature': 'find(text, search)', 'forms': [['text', 'search']], 'description': 'returns the index of the first occurrence of search in text, or -1 if it is not found', 'details': '', 'params': {'text': 'text to search in', 'search': 'text to look for'}, 'aliases': []},
'replace': {'min_args': 3, 'max_args': 3, 'signature': 'replace(value, old, new)', 'forms': [['value', 'old', 'new']], 'description': 'replaces every occurrence of old with new; works on text, lists and tensors', 'details': '', 'params': {'value': 'text, list or tensor', 'old': 'text or value to look for', 'new': 'replacement'}, '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': '', 'params': {'x': 'mask or image with values 0-1', 'kernel_size': 'size of the square kernel (default: 3)'}, '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': '', 'params': {'x': 'mask or image with values 0-1', 'kernel_size': 'size of the square kernel (default: 3)'}, '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': '', 'params': {'x': 'mask or image with values 0-1', 'kernel_size': 'size of the square kernel (default: 3)'}, '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': '', 'params': {'x': 'mask or image with values 0-1', 'kernel_size': 'size of the square kernel (default: 3)'}, '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': '', 'params': {'rgb': 'sRGB colors (0-1) with R, G, B in the last dimension, or a 3-item list', 'r': 'red channel 0-1', 'g': 'green channel 0-1', 'b': 'blue channel 0-1'}, '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': '', 'params': {'rgb': 'sRGB colors (0-1) with R, G, B in the last dimension, or a 3-item list', 'r': 'red channel 0-1', 'g': 'green channel 0-1', 'b': 'blue channel 0-1'}, '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': '', 'params': {'oklab': 'OKLab colors with L, a, b in the last dimension, or a 3-item list', 'l': 'lightness', 'a': 'green-red axis', 'b': 'blue-yellow axis'}, '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': '', 'params': {'cielab': 'CIELAB colors / 100 with L, a, b in the last dimension, or a 3-item list', 'l': 'lightness / 100 (0-1)', 'a': 'green-red axis / 100', 'b': 'blue-yellow axis / 100'}, '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': '', 'params': {'rgb': 'colors (0-1) with R, G, B in the last dimension, or a 3-item list', 'degrees': 'truthy to use hue in 0-360 instead of 0-1', 'r': 'red channel 0-1', 'g': 'green channel 0-1', 'b': 'blue channel 0-1'}, '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': '', 'params': {'hsv': 'colors with H, S, V in the last dimension, or a 3-item list', 'degrees': 'truthy to use hue in 0-360 instead of 0-1', 'h': 'hue 0-1 (0-360 with degrees)', 's': 'saturation 0-1', 'v': 'value (brightness) 0-1'}, 'aliases': []},
'int_to_rgb': {'min_args': 1, 'max_args': 1, 'signature': 'int_to_rgb(color)', 'forms': [['color']], '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': '', 'params': {'color': 'packed 0xRRGGBB integer, list or tensor'}, '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': '', 'params': {'rgb': 'colors with R, G, B (0-1) in the last dimension, or a 3-item list', 'r': 'red channel 0-1', 'g': 'green channel 0-1', 'b': 'blue channel 0-1'}, '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': '', 'params': {'x': 'tensor shaped [N, C, ...] with 1-3 spatial dimensions', 'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, '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': '', 'params': {'x': 'tensor shaped [N, C, ...] with 1-3 spatial dimensions', 'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, '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': '', 'params': {'x': 'tensor shaped [N, C, ...] with 1-3 spatial dimensions', 'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, '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': '', 'params': {'x': 'tensor shaped [N, C, ...] with 1-3 spatial dimensions', 'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, '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': '', 'params': {'text': 'text to render; line breaks start new lines', 'font': 'font name to look up in the system fonts, or a path to a font file', 'size': 'font size in pixels', 'max_width': 'wrap lines wider than this many pixels (default: 0, no wrapping)', 'weight': 'font weight 100-900 as in CSS (default: 400)', 'rotation_angle': 'rotation in degrees, counter-clockwise (default: 0)', 'line_spacing': 'line distance as a multiple of the line height (default: 1)', 'italic': 'truthy for italic text (default: false)', 'underline': 'truthy to underline the text (default: false)'}, 'aliases': []},
'as_nested_tensor': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested_tensor(values)', 'forms': [['values']], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'params': {'values': 'list of tensors; their shapes may differ'}, 'aliases': ['as_nested']},
'as_nested': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested(values)', 'forms': [['values']], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'params': {'values': 'list of tensors; their shapes may differ'}, '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': '', 'params': {'x': 'matrix, or a batch of matrices in the last two dimensions', 'full_matrices': 'truthy to return full-size U and Vh (default: false)'}, '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': '', 'params': {'x': 'matrix, or a batch of matrices in the last two dimensions', 'full_matrices': 'truthy to return full-size U and Vh (default: false)'}, 'aliases': ['svd']},
'diagonal_matrix': {'min_args': 2, 'max_args': 5, 'signature': 'diagonal_matrix(values, shape, [offset], [dim1], [dim2])', 'forms': [['values', 'shape', '[offset]', '[dim1]', '[dim2]']], 'description': 'creates a tensor of the given shape with values on a diagonal and zeros elsewhere', 'details': '', 'params': {'values': 'values placed on the diagonal', 'shape': 'shape of the result', 'offset': 'diagonal offset: positive above, negative below the main diagonal (default: 0)', 'dim1': 'first dimension of the matrix (default: -2)', 'dim2': 'second dimension of the matrix (default: -1)'}, 'aliases': ['diag']},
'diag': {'min_args': 2, 'max_args': 5, 'signature': 'diag(values, shape, [offset], [dim1], [dim2])', 'forms': [['values', 'shape', '[offset]', '[dim1]', '[dim2]']], 'description': 'creates a tensor of the given shape with values on a diagonal and zeros elsewhere', 'details': '', 'params': {'values': 'values placed on the diagonal', 'shape': 'shape of the result', 'offset': 'diagonal offset: positive above, negative below the main diagonal (default: 0)', 'dim1': 'first dimension of the matrix (default: -2)', 'dim2': 'second dimension of the matrix (default: -1)'}, 'aliases': ['diagonal_matrix']},
'timestamp': {'min_args': 0, 'max_args': 0, 'signature': 'timestamp()', 'forms': [[]], 'description': 'returns the current system timestamp', 'details': '', 'params': {}, 'aliases': ['now']},
'now': {'min_args': 0, 'max_args': 0, 'signature': 'now()', 'forms': [[]], 'description': 'returns the current system timestamp', 'details': '', 'params': {}, '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': '', 'params': {'descending': 'truthy to sort from largest to smallest (default: false)', 'dim': 'dimension to sort along (default: last)'}, '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': '', 'params': {'descending': 'truthy to sort from largest to smallest (default: false)', 'dim': 'dimension to sort along (default: last)'}, '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': '', 'params': {'as_position': 'truthy to return the coordinates of the minimum instead of a flat index', 'dim': 'dimension to search along; cannot be combined with as_position'}, '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': '', 'params': {'as_position': 'truthy to return the coordinates of the maximum instead of a flat index', 'dim': 'dimension to search along; cannot be combined with as_position'}, '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': '', 'params': {'dim': 'dimension whose slices sum to 1 (default: last)'}, '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': '', 'params': {'dim': 'dimension whose slices sum to 1 (default: last)'}, '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': '', 'params': {}, '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': '', 'params': {'dims': 'dimension or list of dimensions to reverse'}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'dim': 'only remove this dimension, if it has size 1'}, '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': '', 'params': {'dim': 'position of the new size-1 dimension'}, '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': '', 'params': {'shifts': 'number of places to shift; elements pushed off one end come back at the other', 'dim': 'dimension to shift along (default: 0)'}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {}, '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': '', 'params': {'start': 'low corner of the region, one index per dimension', 'size': 'size of the result, one value per dimension'}, 'aliases': []},
'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': '', 'params': {'x': 'list or tensor to sort', 'descending': 'truthy to sort from largest to smallest (default: false)', 'dim': 'dimension to sort along (default: last)'}, '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': '', 'params': {'x': 'list or tensor', 'descending': 'truthy to sort from largest to smallest (default: false)', 'dim': 'dimension to sort along (default: last)'}, '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': '', 'params': {'x': 'list or tensor to search', 'as_position': 'truthy to return the coordinates of the minimum instead of a flat index', 'dim': 'dimension to search along; cannot be combined with as_position'}, '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': '', 'params': {'x': 'list or tensor to search', 'as_position': 'truthy to return the coordinates of the maximum instead of a flat index', 'dim': 'dimension to search along; cannot be combined with as_position'}, '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': '', 'params': {'x': 'scores (list or tensor)', 'dim': 'dimension whose slices sum to 1 (default: last)'}, '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': '', 'params': {'x': 'scores (list or tensor)', 'dim': 'dimension whose slices sum to 1 (default: last)'}, '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': '', 'params': {'x': 'list or tensor'}, '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': '', 'params': {'x': 'tensor, list or text', 'dims': 'dimension or list of dimensions to reverse'}, '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': '', 'params': {'text': 'text to check', 'prefix': 'start to look for'}, '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': '', 'params': {'text': 'text to check', 'suffix': 'ending to look for'}, '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': '', 'params': {'x': 'tensor', 'dim': 'only remove this dimension, if it has size 1'}, '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': '', 'params': {'x': 'tensor', 'dim': 'position of the new size-1 dimension'}, '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': '', 'params': {'x': 'tensor', 'shifts': 'number of places to shift; elements pushed off one end come back at the other', 'dim': 'dimension to shift along (default: 0)'}, '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': '', 'params': {'x': 'first values; flattened', 'y': 'second values with the same number of elements'}, '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': '', 'params': {'x': 'first values', 'y': 'second values'}, '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': '', 'params': {'x': 'first values', 'y': 'second values'}, 'aliases': ['corr']},
'entropy': {'min_args': 1, 'max_args': 1, 'signature': 'entropy(logits)', 'forms': [['logits']], 'description': 'computes the Shannon entropy (in nats) of softmax(logits) over all elements', 'details': '', 'params': {'logits': 'scores (list or tensor)'}, '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': '', 'params': {'x': 'tensor or text', 'start': 'low corner of the region, one index per dimension', 'size': 'size of the result, one value per dimension'}, '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': '', 'params': {'shape': 'list of dimension sizes', 'dim': 'dimension whose index becomes the value', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, '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': '', 'params': {'shape': 'list of dimension sizes', 'dim': 'dimension whose index becomes the value', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, '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': '', 'params': {'dim': 'dimension to gather along', 'idx': 'indices along dim; the result has the shape of idx'}, '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': '', 'params': {'dim': 'dimension to scatter along', 'idx': 'position along dim for each element of src', 'src': 'values to write'}, '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': '', 'params': {'dim': 'dimension to scatter along', 'idx': 'position along dim for each element of src', 'src': 'values to add'}, 'aliases': []},
'gather': {'min_args': 3, 'max_args': 3, 'signature': 'gather(x, dim, indices)', 'forms': [['x', 'dim', 'indices']], 'description': 'gathers elements of x along dim at the given indices. The result has the shape of indices.', 'details': '', 'params': {'x': 'source tensor', 'dim': 'dimension to gather along', 'indices': 'indices along dim; the result has their shape'}, 'aliases': []},
'scatter': {'min_args': 4, 'max_args': 4, 'signature': 'scatter(x, dim, indices, src)', 'forms': [['x', 'dim', 'indices', 'src']], 'description': 'writes the elements of src into x along dim at the given indices. The result has the shape of x.', 'details': '', 'params': {'x': 'tensor to write into', 'dim': 'dimension to scatter along', 'indices': 'position along dim for each element of src', 'src': 'values to write'}, 'aliases': []},
'scatter_add': {'min_args': 4, 'max_args': 4, 'signature': 'scatter_add(x, dim, indices, src)', 'forms': [['x', 'dim', 'indices', 'src']], 'description': 'adds the elements of src into x along dim at the given indices. The result has the shape of x.', 'details': '', 'params': {'x': 'tensor to add into', 'dim': 'dimension to scatter along', 'indices': 'position along dim for each element of src', 'src': 'values to add'}, 'aliases': []},
'noise': {'min_args': 1, 'max_args': 2, 'signature': 'noise(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates normally distributed random noise', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['noise', 'randn']},
@@ -296,16 +296,16 @@ INBUILT_FUNCTION_META = {
'random_uniform': {'min_args': 1, 'max_args': 2, 'signature': 'random_uniform(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates uniformly distributed random noise', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'median': 'centre of the distribution', 'sigma': 'half width at half maximum', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'median': 'centre of the distribution', 'sigma': 'half width at half maximum', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'lambda': 'rate; the mean is 1 / lambda', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'lambda': 'rate; the mean is 1 / lambda', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['rande']},
'rande': {'min_args': 2, 'max_args': 3, 'signature': 'rande(seed, rate, [shape])', 'forms': [['seed', 'rate', '[shape]']], 'description': 'generates exponentially distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'rate': 'events per unit; the mean is 1 / rate', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_exponential']},
'random_exponential': {'min_args': 2, 'max_args': 3, 'signature': 'random_exponential(seed, rate, [shape])', 'forms': [['seed', 'rate', '[shape]']], 'description': 'generates exponentially distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'rate': 'events per unit; the mean is 1 / rate', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'mean': 'mean of the underlying normal distribution', 'std': 'standard deviation of the underlying normal distribution', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'mean': 'mean of the underlying normal distribution', 'std': 'standard deviation of the underlying normal distribution', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'probability': 'chance of a 1; a tensor gives one probability per element and sets the shape', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'probability': 'chance of a 1; a tensor gives one probability per element and sets the shape', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'lambda': 'expected count; a tensor gives one rate per element and sets the shape', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'lambda': 'expected count; a tensor gives one rate per element and sets the shape', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape_param': 'shape (concentration) k', 'scale': 'scale theta; the mean is k * theta', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape_param': 'shape (concentration) k', 'scale': 'scale theta; the mean is k * theta', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randg']},
'randp': {'min_args': 2, 'max_args': 3, 'signature': 'randp(seed, rate, [shape])', 'forms': [['seed', 'rate', '[shape]']], 'description': 'generates Poisson distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'rate': 'expected count; a tensor gives one rate per element and sets the shape', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_poisson']},
'random_poisson': {'min_args': 2, 'max_args': 3, 'signature': 'random_poisson(seed, rate, [shape])', 'forms': [['seed', 'rate', '[shape]']], 'description': 'generates Poisson distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'rate': 'expected count; a tensor gives one rate per element and sets the shape', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randp']},
'randg': {'min_args': 3, 'max_args': 4, 'signature': 'randg(seed, concentration, scale, [shape])', 'forms': [['seed', 'concentration', 'scale', '[shape]']], 'description': 'generates Gamma distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'concentration': 'shape (concentration) k', 'scale': 'scale theta; the mean is k * theta', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_gamma']},
'random_gamma': {'min_args': 3, 'max_args': 4, 'signature': 'random_gamma(seed, concentration, scale, [shape])', 'forms': [['seed', 'concentration', 'scale', '[shape]']], 'description': 'generates Gamma distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'concentration': 'shape (concentration) k', 'scale': 'scale theta; the mean is k * theta', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'alpha': 'first concentration', 'beta': 'second concentration', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'alpha': 'first concentration', 'beta': 'second concentration', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, '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': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'loc': 'centre of the distribution', 'scale': 'spread (diversity)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_laplace']},
+265 -265
View File
@@ -13,280 +13,280 @@ export const FUNCTIONS = new Set([
]);
export const FUNCTION_META = {
"sin": { minArgs: 1, maxArgs: 1, signature: "sin(x)", forms: [["x"]], description: "applies sine function to value or each element of value", details: "", params: {}, aliases: [] },
"cos": { minArgs: 1, maxArgs: 1, signature: "cos(x)", forms: [["x"]], description: "applies cosine function to value or each element of value", details: "", params: {}, aliases: [] },
"tan": { minArgs: 1, maxArgs: 1, signature: "tan(x)", forms: [["x"]], description: "applies tangent function to value or each element of value", details: "", params: {}, aliases: [] },
"asin": { minArgs: 1, maxArgs: 1, signature: "asin(x)", forms: [["x"]], description: "applies arcus sine function to value or each element of value", details: "", params: {}, aliases: [] },
"acos": { minArgs: 1, maxArgs: 1, signature: "acos(x)", forms: [["x"]], description: "applies arcus cosine function to value or each element of value", details: "", params: {}, aliases: [] },
"atan": { minArgs: 1, maxArgs: 1, signature: "atan(x)", forms: [["x"]], description: "applies arcus tangent function to value or each element of value", details: "", params: {}, aliases: [] },
"sin": { minArgs: 1, maxArgs: 1, signature: "sin(x)", forms: [["x"]], description: "applies sine function to value or each element of value", details: "", params: {"x": "angle in radians (number, list or tensor)"}, aliases: [] },
"cos": { minArgs: 1, maxArgs: 1, signature: "cos(x)", forms: [["x"]], description: "applies cosine function to value or each element of value", details: "", params: {"x": "angle in radians (number, list or tensor)"}, aliases: [] },
"tan": { minArgs: 1, maxArgs: 1, signature: "tan(x)", forms: [["x"]], description: "applies tangent function to value or each element of value", details: "", params: {"x": "angle in radians (number, list or tensor)"}, aliases: [] },
"asin": { minArgs: 1, maxArgs: 1, signature: "asin(x)", forms: [["x"]], description: "applies arcus sine function to value or each element of value", details: "", params: {"x": "value in -1..1 (number, list or tensor)"}, aliases: [] },
"acos": { minArgs: 1, maxArgs: 1, signature: "acos(x)", forms: [["x"]], description: "applies arcus cosine function to value or each element of value", details: "", params: {"x": "value in -1..1 (number, list or tensor)"}, aliases: [] },
"atan": { minArgs: 1, maxArgs: 1, signature: "atan(x)", forms: [["x"]], description: "applies arcus tangent function to value or each element of value", details: "", params: {"x": "number, list or tensor; applied to each element"}, 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: "", params: {"y": "y coordinate (numerator)", "x": "x coordinate (denominator)"}, aliases: [] },
"sinh": { minArgs: 1, maxArgs: 1, signature: "sinh(x)", forms: [["x"]], description: "applies hyperbolic sine function to value or each element of value", details: "", params: {}, aliases: [] },
"cosh": { minArgs: 1, maxArgs: 1, signature: "cosh(x)", forms: [["x"]], description: "applies hyperbolic cosine function to value or each element of value", details: "", params: {}, aliases: [] },
"tanh": { minArgs: 1, maxArgs: 1, signature: "tanh(x)", forms: [["x"]], description: "applies hyperbolic tangent function to value or each element of value", details: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, aliases: [] },
"abs": { minArgs: 1, maxArgs: 1, signature: "abs(x)", forms: [["x"]], description: "applies per element absolute value function. Same as |x| for numbers.", details: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, aliases: [] },
"exp": { minArgs: 1, maxArgs: 1, signature: "exp(x)", forms: [["x"]], description: "applies e^x to value (per element)", details: "", params: {}, aliases: [] },
"log1p": { minArgs: 1, maxArgs: 1, signature: "log1p(x)", forms: [["x"]], description: "applies ln(1+x) accurately for values near zero", details: "", params: {}, aliases: [] },
"expm1": { minArgs: 1, maxArgs: 1, signature: "expm1(x)", forms: [["x"]], description: "applies exp(x)-1 accurately for values near zero", details: "", params: {}, 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: "", params: {}, aliases: [] },
"cbrt": { minArgs: 1, maxArgs: 1, signature: "cbrt(x)", forms: [["x"]], description: "computes the real cube root of each value, including negative values", details: "", params: {}, aliases: [] },
"reciprocal": { minArgs: 1, maxArgs: 1, signature: "reciprocal(x)", forms: [["x"]], description: "computes 1/x element-wise", details: "", params: {}, 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: "", params: {}, 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: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"p": "norm order (default: 2)", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"p": "norm order (default: 2)", "dim": "dimension to work along (default: last)", "eps": "smallest allowed divisor (default: 1e-12)"}, 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: "", params: {"groups": "number of channel groups; must divide the channel count", "weight": "per-channel scale, length C (default: none)", "bias": "per-channel shift, length C (default: none)", "eps": "value added to the variance for stability (default: 1e-5)"}, aliases: [] },
"outer": { minArgs: 2, maxArgs: 2, signature: "outer(x, y)", forms: [["x", "y"]], description: "computes the outer product of flattened x and y", details: "", params: {}, aliases: [] },
"trace": { minArgs: 1, maxArgs: 1, signature: "trace(x)", forms: [["x"]], description: "sums the main diagonal of each square matrix in x", details: "", params: {}, aliases: [] },
"det": { minArgs: 1, maxArgs: 1, signature: "det(x)", forms: [["x"]], description: "computes the determinant of each square matrix in x", details: "", params: {}, 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: "", params: {"dim": "dimension to transform (default: last)"}, 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: "", params: {"n": "length of the output signal (default: 2 * (input length - 1))", "dim": "dimension to transform (default: last)"}, aliases: [] },
"isnan": { minArgs: 1, maxArgs: 1, signature: "isnan(x)", forms: [["x"]], description: "returns 1.0 for NaN values and 0.0 otherwise", details: "", params: {}, aliases: [] },
"isinf": { minArgs: 1, maxArgs: 1, signature: "isinf(x)", forms: [["x"]], description: "returns 1.0 for infinite values and 0.0 otherwise", details: "", params: {}, aliases: [] },
"isfinite": { minArgs: 1, maxArgs: 1, signature: "isfinite(x)", forms: [["x"]], description: "returns 1.0 for finite values and 0.0 otherwise", details: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {"dim": "dimension whose slices are normalised (default: last)"}, 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: "", params: {"dim": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
"floor": { minArgs: 1, maxArgs: 1, signature: "floor(x)", forms: [["x"]], description: "returns the largest integer less than or equal to x", details: "", params: {}, aliases: [] },
"ceil": { minArgs: 1, maxArgs: 1, signature: "ceil(x)", forms: [["x"]], description: "returns the smallest integer greater than or equal to x", details: "", params: {}, aliases: [] },
"round": { minArgs: 1, maxArgs: 1, signature: "round(x)", forms: [["x"]], description: "rounds x to the nearest integer", details: "", params: {}, aliases: [] },
"gamma": { minArgs: 1, maxArgs: 1, signature: "gamma(x)", forms: [["x"]], description: "computes the gamma function (per element)", details: "", params: {}, aliases: [] },
"pow": { minArgs: 2, maxArgs: 2, signature: "pow(x, y)", forms: [["x", "y"]], description: "computes x raised to the power of y", details: "", params: {"x": "base", "y": "exponent"}, aliases: [] },
"sigm": { minArgs: 1, maxArgs: 1, signature: "sigm(x)", forms: [["x"]], description: "applies the sigmoid function: 1 / (1 + exp(-x))", details: "", params: {}, 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: "", params: {}, aliases: [] },
"fft": { minArgs: 1, maxArgs: 1, signature: "fft(x)", forms: [["x"]], description: "computes fast Fourier transform of x", details: "", params: {}, 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: "", params: {"shape": "shape used for the K/Kx/Ky frequency variables (default: the node's input shape)"}, aliases: [] },
"angle": { minArgs: 1, maxArgs: 1, signature: "angle(x)", forms: [["x"]], description: "returns the angle of a complex number or vector", details: "", params: {}, 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: "", params: {}, aliases: [] },
"print_shape": { minArgs: 1, maxArgs: 1, signature: "print_shape(x)", forms: [["x"]], description: "prints the shape of the tensor x", details: "", params: {}, aliases: ["pshp"] },
"pshp": { minArgs: 1, maxArgs: 1, signature: "pshp(x)", forms: [["x"]], description: "prints the shape of the tensor x", details: "", params: {}, 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: "", params: {"nan": "replacement for NaN", "pos_inf": "replacement for +infinity", "neg_inf": "replacement for -infinity"}, 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: "", params: {"nan": "replacement for NaN", "pos_inf": "replacement for +infinity", "neg_inf": "replacement for -infinity"}, 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: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, 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: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)", "dim": "dimension holding the vector components (default: all elements form one vector)"}, aliases: [] },
"step": { minArgs: 2, maxArgs: 2, signature: "step(x, edge)", forms: [["x", "edge"]], description: "returns 0 if x < edge, else 1", details: "", params: {"edge": "threshold; the result is 1 where x >= edge, otherwise 0"}, aliases: [] },
"smoothstep": { minArgs: 3, maxArgs: 3, signature: "smoothstep(x, edge0, edge1)", forms: [["x", "edge0", "edge1"]], description: "smooth interpolation between edge0 and edge1", details: "", params: {"edge0": "value mapped to 0", "edge1": "value mapped to 1"}, aliases: [] },
"fract": { minArgs: 1, maxArgs: 1, signature: "fract(x)", forms: [["x"]], description: "returns the fractional part of x: x - floor(x)", details: "", params: {}, aliases: [] },
"relu": { minArgs: 1, maxArgs: 1, signature: "relu(x)", forms: [["x"]], description: "applies rectified linear unit function: max(0, x)", details: "", params: {}, aliases: [] },
"softsign": { minArgs: 1, maxArgs: 1, signature: "softsign(x)", forms: [["x"]], description: "applies x / (1 + abs(x)) element-wise", details: "", params: {}, 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: "", params: {"negative_slope": "slope used for negative inputs (default: 0.01)"}, aliases: [] },
"softplus": { minArgs: 1, maxArgs: 1, signature: "softplus(x)", forms: [["x"]], description: "applies the softplus function: ln(1 + exp(x))", details: "", params: {}, aliases: [] },
"gelu": { minArgs: 1, maxArgs: 1, signature: "gelu(x)", forms: [["x"]], description: "applies the Gaussian Error Linear Unit (GELU) activation function", details: "", params: {}, aliases: [] },
"silu": { minArgs: 1, maxArgs: 1, signature: "silu(x)", forms: [["x"]], description: "applies the Sigmoid Linear Unit activation element-wise", details: "", params: {}, aliases: [] },
"sign": { minArgs: 1, maxArgs: 1, signature: "sign(x)", forms: [["x"]], description: "returns the sign of x: -1, 0, or 1", details: "", params: {}, aliases: [] },
"degrees": { minArgs: 1, maxArgs: 1, signature: "degrees(x)", forms: [["x"]], description: "converts radians to degrees (per element)", details: "", params: {}, aliases: [] },
"radians": { minArgs: 1, maxArgs: 1, signature: "radians(x)", forms: [["x"]], description: "converts degrees to radians (per element)", details: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, aliases: [] },
"hypot": { minArgs: 2, maxArgs: 2, signature: "hypot(x, y)", forms: [["x", "y"]], description: "computes the element-wise Euclidean distance from the origin", details: "", params: {}, 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: "", params: {"coord1": "sample positions (element indices) along the first mapped dimension; mapped dimensions are the last ones of tensor", "coord2": "sample positions along the second mapped dimension", "coord3": "sample positions along the third mapped dimension"}, 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: "", params: {"tensor": "input, channels first or last", "size_x": "kernel size along the first spatial dimension", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre"}, 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: "", params: {"tensor": "input, channels first or last", "size_x": "kernel size along the first spatial dimension", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre"}, 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: "", params: {"tensor": "input shaped [batch, channel, spatial...]", "size_x": "kernel size along the first spatial dimension", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre"}, 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: "", params: {"tensor": "input shaped [batch, channel, spatial...]", "size_x": "kernel size along the first spatial dimension", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre"}, 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: "", params: {"dim": "dimension to swap along", "idx1": "first position", "idx2": "second position"}, 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: "", params: {"dim0": "first dimension to swap", "dim1": "second dimension to swap"}, 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: "", params: {"dim0": "first dimension to swap", "dim1": "second dimension to swap"}, 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: "", params: {"dims": "new order of the dimensions, e.g. [0, 2, 1]"}, 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: "", params: {"dims": "new order of the dimensions, e.g. [0, 2, 1]"}, aliases: ["permute"] },
"reshape": { minArgs: 2, maxArgs: 2, signature: "reshape(x, shape)", forms: [["x", "shape"]], description: "reshapes tensor x to the specified shape", details: "", params: {"shape": "new shape; the total number of elements must stay the same"}, aliases: ["rshp"] },
"rshp": { minArgs: 2, maxArgs: 2, signature: "rshp(x, shape)", forms: [["x", "shape"]], description: "reshapes tensor x to the specified shape", details: "", params: {"shape": "new shape; the total number of elements must stay the same"}, aliases: ["reshape"] },
"sinh": { minArgs: 1, maxArgs: 1, signature: "sinh(x)", forms: [["x"]], description: "applies hyperbolic sine function to value or each element of value", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"cosh": { minArgs: 1, maxArgs: 1, signature: "cosh(x)", forms: [["x"]], description: "applies hyperbolic cosine function to value or each element of value", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"tanh": { minArgs: 1, maxArgs: 1, signature: "tanh(x)", forms: [["x"]], description: "applies hyperbolic tangent function to value or each element of value", details: "", params: {"x": "number, list or tensor; applied to each element"}, 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: "", params: {"x": "number, list or tensor; applied to each element"}, 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: "", params: {"x": "value >= 1 (number, list or tensor)"}, 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: "", params: {"x": "value in -1..1 (number, list or tensor)"}, aliases: [] },
"abs": { minArgs: 1, maxArgs: 1, signature: "abs(x)", forms: [["x"]], description: "applies per element absolute value function. Same as |x| for numbers.", details: "", params: {"x": "number, list or tensor; applied to each element"}, 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: "", params: {"x": "non-negative values (number, list or tensor)"}, 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: "", params: {"x": "positive values (number, list or tensor)"}, 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: "", params: {"x": "positive values (number, list or tensor)"}, 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: "", params: {"x": "positive values (number, list or tensor)"}, aliases: [] },
"exp": { minArgs: 1, maxArgs: 1, signature: "exp(x)", forms: [["x"]], description: "applies e^x to value (per element)", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"log1p": { minArgs: 1, maxArgs: 1, signature: "log1p(x)", forms: [["x"]], description: "applies ln(1+x) accurately for values near zero", details: "", params: {"x": "values greater than -1 (number, list or tensor)"}, aliases: [] },
"expm1": { minArgs: 1, maxArgs: 1, signature: "expm1(x)", forms: [["x"]], description: "applies exp(x)-1 accurately for values near zero", details: "", params: {"x": "number, list or tensor; applied to each element"}, 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: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"cbrt": { minArgs: 1, maxArgs: 1, signature: "cbrt(x)", forms: [["x"]], description: "computes the real cube root of each value, including negative values", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"reciprocal": { minArgs: 1, maxArgs: 1, signature: "reciprocal(x)", forms: [["x"]], description: "computes 1/x element-wise", details: "", params: {"x": "number, list or tensor; applied to each element"}, 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: "", params: {"x": "first log-space value (number, list or tensor)", "y": "second log-space value (number, list or tensor)"}, 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: "", params: {"x": "values (list or tensor)", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"x": "number, list or tensor", "p": "norm order (default: 2)", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"x": "list or tensor", "p": "norm order (default: 2)", "dim": "dimension to work along (default: last)", "eps": "smallest allowed divisor (default: 1e-12)"}, 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: "", params: {"x": "tensor shaped [N, C, ...]", "groups": "number of channel groups; must divide the channel count", "weight": "per-channel scale, length C (default: none)", "bias": "per-channel shift, length C (default: none)", "eps": "value added to the variance for stability (default: 1e-5)"}, aliases: [] },
"outer": { minArgs: 2, maxArgs: 2, signature: "outer(x, y)", forms: [["x", "y"]], description: "computes the outer product of flattened x and y", details: "", params: {"x": "first tensor; flattened first", "y": "second tensor; flattened first"}, aliases: [] },
"trace": { minArgs: 1, maxArgs: 1, signature: "trace(x)", forms: [["x"]], description: "sums the main diagonal of each square matrix in x", details: "", params: {"x": "matrix, or a batch of matrices in the last two dimensions"}, aliases: [] },
"det": { minArgs: 1, maxArgs: 1, signature: "det(x)", forms: [["x"]], description: "computes the determinant of each square matrix in x", details: "", params: {"x": "matrix, or a batch of matrices in the last two dimensions"}, 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: "", params: {"x": "real-valued signal", "dim": "dimension to transform (default: last)"}, 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: "", params: {"x": "complex half-spectrum, e.g. from rfft()", "n": "length of the output signal (default: 2 * (input length - 1))", "dim": "dimension to transform (default: last)"}, aliases: [] },
"isnan": { minArgs: 1, maxArgs: 1, signature: "isnan(x)", forms: [["x"]], description: "returns 1.0 for NaN values and 0.0 otherwise", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"isinf": { minArgs: 1, maxArgs: 1, signature: "isinf(x)", forms: [["x"]], description: "returns 1.0 for infinite values and 0.0 otherwise", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"isfinite": { minArgs: 1, maxArgs: 1, signature: "isfinite(x)", forms: [["x"]], description: "returns 1.0 for finite values and 0.0 otherwise", details: "", params: {"x": "number, list or tensor; applied to each element"}, 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: "", params: {"x": "values; one list or tensor gives its smallest element, several values give the smallest of all"}, 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: "", params: {"x": "values; one list or tensor gives its largest element, several values give the largest of all"}, aliases: [] },
"tmin": { minArgs: 2, maxArgs: 2, signature: "tmin(a, b)", forms: [["a", "b"]], description: "element-wise minimum of a and b; min(a, b) for plain numbers", details: "", params: {"a": "first values; tensors broadcast", "b": "second values; tensors broadcast"}, aliases: [] },
"tmax": { minArgs: 2, maxArgs: 2, signature: "tmax(a, b)", forms: [["a", "b"]], description: "element-wise maximum of a and b; max(a, b) for plain numbers", details: "", params: {"a": "first values; tensors broadcast", "b": "second values; tensors broadcast"}, 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: "", params: {"x": "tensor or list to normalise", "dim": "dimension whose slices are normalised (default: last)"}, 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: "", params: {"x": "number, list or tensor", "dim": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
"floor": { minArgs: 1, maxArgs: 1, signature: "floor(x)", forms: [["x"]], description: "returns the largest integer less than or equal to x", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"ceil": { minArgs: 1, maxArgs: 1, signature: "ceil(x)", forms: [["x"]], description: "returns the smallest integer greater than or equal to x", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"round": { minArgs: 1, maxArgs: 1, signature: "round(x)", forms: [["x"]], description: "rounds x to the nearest integer", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"gamma": { minArgs: 1, maxArgs: 1, signature: "gamma(x)", forms: [["x"]], description: "computes the gamma function (per element)", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"pow": { minArgs: 2, maxArgs: 2, signature: "pow(base, exponent)", forms: [["base", "exponent"]], description: "computes base raised to the power of exponent", details: "", params: {"base": "number, list or tensor to raise", "exponent": "power to raise base to; tensors broadcast"}, aliases: [] },
"sigm": { minArgs: 1, maxArgs: 1, signature: "sigm(x)", forms: [["x"]], description: "applies the sigmoid function: 1 / (1 + exp(-x))", details: "", params: {"x": "number, list or tensor; applied to each element"}, 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: "", params: {"x": "number, list or tensor; applied to each element", "min": "lower bound", "max": "upper bound"}, aliases: [] },
"fft": { minArgs: 1, maxArgs: 1, signature: "fft(x)", forms: [["x"]], description: "computes fast Fourier transform of x", details: "", params: {"x": "tensor, transformed over all dimensions"}, 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: "", params: {"x": "spectrum to transform back; may use the K/Kx/Ky/frequency variables", "shape": "shape used for the K/Kx/Ky frequency variables (default: the node's input shape)"}, aliases: [] },
"angle": { minArgs: 1, maxArgs: 1, signature: "angle(x)", forms: [["x"]], description: "returns the angle of a complex number or vector", details: "", params: {"x": "complex or real values (number, list or tensor)"}, 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: "", params: {"x": "value to print; it is also returned unchanged"}, aliases: [] },
"print_shape": { minArgs: 1, maxArgs: 1, signature: "print_shape(x)", forms: [["x"]], description: "prints the shape of the tensor x", details: "", params: {"x": "value whose shape is printed; it is also returned unchanged"}, aliases: ["pshp"] },
"pshp": { minArgs: 1, maxArgs: 1, signature: "pshp(x)", forms: [["x"]], description: "prints the shape of the tensor x", details: "", params: {"x": "value whose shape is printed; it is also returned unchanged"}, 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: "", params: {"x": "values to clean", "nan": "replacement for NaN", "pos_inf": "replacement for +infinity", "neg_inf": "replacement for -infinity"}, 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: "", params: {"x": "values to clean", "nan": "replacement for NaN", "pos_inf": "replacement for +infinity", "neg_inf": "replacement for -infinity"}, 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: "", params: {"a": "value at t = 0", "b": "value at t = 1", "t": "progress from 0 (gives a) to 1 (gives b)"}, 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: "", params: {"a": "vectors at t = 0", "b": "vectors at t = 1", "t": "progress from 0 (gives a) to 1 (gives b)", "dim": "dimension holding the vector components (default: all elements form one vector)"}, aliases: [] },
"step": { minArgs: 2, maxArgs: 2, signature: "step(x, edge)", forms: [["x", "edge"]], description: "returns 0 if x < edge, else 1", details: "", params: {"x": "values to test (number, list or tensor)", "edge": "threshold; the result is 1 where x >= edge, otherwise 0"}, aliases: [] },
"smoothstep": { minArgs: 3, maxArgs: 3, signature: "smoothstep(x, edge0, edge1)", forms: [["x", "edge0", "edge1"]], description: "smooth interpolation between edge0 and edge1", details: "", params: {"x": "input values", "edge0": "value mapped to 0", "edge1": "value mapped to 1"}, aliases: [] },
"fract": { minArgs: 1, maxArgs: 1, signature: "fract(x)", forms: [["x"]], description: "returns the fractional part of x: x - floor(x)", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"relu": { minArgs: 1, maxArgs: 1, signature: "relu(x)", forms: [["x"]], description: "applies rectified linear unit function: max(0, x)", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"softsign": { minArgs: 1, maxArgs: 1, signature: "softsign(x)", forms: [["x"]], description: "applies x / (1 + abs(x)) element-wise", details: "", params: {"x": "number, list or tensor; applied to each element"}, 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: "", params: {"x": "number, list or tensor; applied to each element", "negative_slope": "slope used for negative inputs (default: 0.01)"}, aliases: [] },
"softplus": { minArgs: 1, maxArgs: 1, signature: "softplus(x)", forms: [["x"]], description: "applies the softplus function: ln(1 + exp(x))", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"gelu": { minArgs: 1, maxArgs: 1, signature: "gelu(x)", forms: [["x"]], description: "applies the Gaussian Error Linear Unit (GELU) activation function", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"silu": { minArgs: 1, maxArgs: 1, signature: "silu(x)", forms: [["x"]], description: "applies the Sigmoid Linear Unit activation element-wise", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"sign": { minArgs: 1, maxArgs: 1, signature: "sign(x)", forms: [["x"]], description: "returns the sign of x: -1, 0, or 1", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"degrees": { minArgs: 1, maxArgs: 1, signature: "degrees(x)", forms: [["x"]], description: "converts radians to degrees (per element)", details: "", params: {"x": "angle in radians (number, list or tensor)"}, aliases: [] },
"radians": { minArgs: 1, maxArgs: 1, signature: "radians(x)", forms: [["x"]], description: "converts degrees to radians (per element)", details: "", params: {"x": "angle in degrees (number, list or tensor)"}, 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: "", params: {"x": "values; zero counts as false (number, list or tensor)"}, 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: "", params: {"x": "values; non-zero counts as true", "y": "values; non-zero counts as true"}, 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: "", params: {"x": "values; non-zero counts as true", "y": "values; non-zero counts as true"}, aliases: [] },
"hypot": { minArgs: 2, maxArgs: 2, signature: "hypot(x, y)", forms: [["x", "y"]], description: "computes the element-wise Euclidean distance from the origin", details: "", params: {"x": "first coordinate (number, list or tensor)", "y": "second coordinate (number, list or tensor)"}, 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: "", params: {"tensor": "tensor to sample from", "coord1": "sample positions (element indices) along the first mapped dimension; mapped dimensions are the last ones of tensor", "coord2": "sample positions along the second mapped dimension", "coord3": "sample positions along the third mapped dimension"}, 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: "", params: {"tensor": "input, channels first or last", "size_x": "kernel size along the first spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension"}, 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: "", params: {"tensor": "input, channels first or last", "size_x": "kernel size along the first spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension"}, 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: "", params: {"tensor": "input shaped [batch, channel, spatial...]", "size_x": "kernel size along the first spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension"}, 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: "", params: {"tensor": "input shaped [batch, channel, spatial...]", "size_x": "kernel size along the first spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension"}, aliases: ["convolution"] },
"swap": { minArgs: 4, maxArgs: 4, signature: "swap(x, dim, index1, index2)", forms: [["x", "dim", "index1", "index2"]], description: "swaps the elements at index1 and index2 along dim", details: "", params: {"x": "tensor", "dim": "dimension to swap along", "index1": "first position", "index2": "second position"}, 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: "", params: {"x": "tensor", "dim0": "first dimension to swap", "dim1": "second dimension to swap"}, 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: "", params: {"x": "tensor", "dim0": "first dimension to swap", "dim1": "second dimension to swap"}, 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: "", params: {"x": "tensor", "dims": "new order of the dimensions, e.g. [0, 2, 1]"}, 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: "", params: {"x": "tensor", "dims": "new order of the dimensions, e.g. [0, 2, 1]"}, aliases: ["permute"] },
"reshape": { minArgs: 2, maxArgs: 2, signature: "reshape(x, shape)", forms: [["x", "shape"]], description: "reshapes tensor x to the specified shape", details: "", params: {"x": "tensor", "shape": "new shape; the total number of elements must stay the same"}, aliases: ["rshp"] },
"rshp": { minArgs: 2, maxArgs: 2, signature: "rshp(x, shape)", forms: [["x", "shape"]], description: "reshapes tensor x to the specified shape", details: "", params: {"x": "tensor", "shape": "new shape; the total number of elements must stay the same"}, 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: "", params: {"start": "first value", "stop": "end of the range (not included)", "step": "distance between consecutive values"}, 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: "", params: {"num": "number of values"}, aliases: [] },
"logspace": { minArgs: 4, maxArgs: 4, signature: "logspace(start, stop, num, base)", forms: [["start", "stop", "num", "base"]], description: "creates logarithmically spaced values", details: "", params: {"start": "exponent of the first value", "stop": "exponent of the last value", "num": "number of values", "base": "base of the exponent"}, 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: "", params: {"k": "number of elements to keep", "dim": "dimension to select along (default: last)"}, 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: "", params: {"k": "number of elements to keep", "dim": "dimension to select along (default: last)"}, 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: "", params: {}, 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: "", params: {"pseudo": "truthy to compute the Moore-Penrose pseudoinverse, which also works for singular and non-square matrices (default: false)"}, 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: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
"isclose": { minArgs: 2, maxArgs: 4, signature: "isclose(a, b, [rtol], [atol])", forms: [["a", "b", "[rtol]", "[atol]"]], description: "elementwise approximate equality test", details: "", params: {"rtol": "relative tolerance (default: 1e-5)", "atol": "absolute tolerance (default: 1e-8)"}, 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: "", params: {"rtol": "relative tolerance (default: 1e-5)", "atol": "absolute tolerance (default: 1e-8)"}, 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: "", params: {"q": "quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)", "dim": "dimension to reduce (default: all elements)"}, 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: "", params: {"q": "quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)", "dim": "dimension to reduce (default: all elements)"}, 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: "", params: {"p": "percentile 0-100", "dim": "dimension to reduce (default: all elements)"}, 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: "", params: {"p": "percentile 0-100", "dim": "dimension to reduce (default: all elements)"}, 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: "", params: {"q": "quantile 0-1", "dim": "dimension to reduce (default: all elements)"}, 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: "", params: {}, 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: "", params: {"a": "centre the moment is taken around", "k": "order of the moment"}, aliases: [] },
"erf": { minArgs: 1, maxArgs: 1, signature: "erf(x)", forms: [["x"]], description: "computes the error function (torch.erf)", details: "", params: {}, aliases: [] },
"erfc": { minArgs: 1, maxArgs: 1, signature: "erfc(x)", forms: [["x"]], description: "computes the complementary error function (torch.special.erfc)", details: "", params: {}, aliases: [] },
"erfinv": { minArgs: 1, maxArgs: 1, signature: "erfinv(x)", forms: [["x"]], description: "computes the inverse error function (torch.erfinv)", details: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {"kernel_size": "odd Sobel kernel size, at least 3 (default: 3)"}, 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: "", params: {"sigma": "blur strength as the standard deviation in elements; 0 or less returns x unchanged", "reshape": "truthy to find the channel dimension automatically; otherwise channels must be last (default: false)"}, 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: "", params: {"sigma": "blur strength as the standard deviation in elements; 0 or less returns x unchanged", "reshape": "truthy to find the channel dimension automatically; otherwise channels must be last (default: false)"}, aliases: ["blur"] },
"median": { minArgs: 1, maxArgs: 2, signature: "median(x, [dim])", forms: [["x", "[dim]"]], description: "computes the median globally or along one dimension", details: "", params: {"dim": "dimension to reduce (default: all elements)"}, aliases: [] },
"mode": { minArgs: 1, maxArgs: 2, signature: "mode(x, [dim])", forms: [["x", "[dim]"]], description: "computes the mode globally or along one dimension", details: "", params: {"dim": "dimension to reduce (default: all elements)"}, aliases: [] },
"cumsum": { minArgs: 1, maxArgs: 2, signature: "cumsum(x, [dim])", forms: [["x", "[dim]"]], description: "computes the cumulative sum, defaulting to the first dimension.", details: "", params: {"dim": "dimension to accumulate along (default: 0)"}, aliases: [] },
"cumprod": { minArgs: 1, maxArgs: 1, signature: "cumprod(x)", forms: [["x"]], description: "computes the cumulative product over first dimension.", details: "", params: {}, 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: "", params: {"k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, 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: "", params: {"k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, 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: "", params: {"k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, 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: "", params: {"k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, 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: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["cubic"] },
"cubic": { minArgs: 3, maxArgs: 3, signature: "cubic(a, b, t)", forms: [["a", "b", "t"]], description: "cubic ease between a and b", details: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, 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: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["elastic"] },
"elastic": { minArgs: 3, maxArgs: 3, signature: "elastic(a, b, t)", forms: [["a", "b", "t"]], description: "elastic ease between a and b", details: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, 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: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["sine"] },
"sine": { minArgs: 3, maxArgs: 3, signature: "sine(a, b, t)", forms: [["a", "b", "t"]], description: "sine easing between a and b", details: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, 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: "", params: {"edge0": "value mapped to 0", "edge1": "value mapped to 1"}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {"i_min": "start of the input range", "i_max": "end of the input range", "o_min": "value i_min maps to", "o_max": "value i_max maps to"}, aliases: [] },
"cossim": { minArgs: 2, maxArgs: 2, signature: "cossim(x, y)", forms: [["x", "y"]], description: "computes the cosine similarity between x and y.", details: "", params: {}, 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: "", params: {}, aliases: ["cossim"] },
"count": { minArgs: 1, maxArgs: 1, signature: "count(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", params: {}, aliases: ["cnt", "length"] },
"cnt": { minArgs: 1, maxArgs: 1, signature: "cnt(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", params: {}, aliases: ["count", "length"] },
"length": { minArgs: 1, maxArgs: 1, signature: "length(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", params: {}, aliases: ["count", "cnt"] },
"keys": { minArgs: 1, maxArgs: 1, signature: "keys(x)", forms: [["x"]], description: "returns a list of dictionary keys in insertion order", details: "", params: {}, aliases: [] },
"enable_tracking": { minArgs: 1, maxArgs: 1, signature: "enable_tracking(d)", forms: [["d"]], description: "enables change tracking for ChangeTrackingDict d (returns d)", details: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {"count": "number of repeats, or a list with one count per dimension", "dims": "dimension or list of dimensions to repeat along; without it a number repeats each element of the flattened input and a list tiles the whole tensor"}, aliases: [] },
"flatten": { minArgs: 1, maxArgs: 1, signature: "flatten(x)", forms: [["x"]], description: "flattens tensor into a 1D tensor", details: "", params: {}, 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: "", params: {"y": "item, list or tensor added to the end of x"}, 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: "", params: {"position": "list with one index per dimension"}, aliases: [] },
"flow_apply": { minArgs: 2, maxArgs: 2, signature: "flow_apply(image, flow)", forms: [["image", "flow"]], description: "applies optical flow to an image", details: "", params: {}, 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: "", params: {"indices": "batch indices to take, in order; batches may repeat or be skipped"}, 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: "", params: {"indices": "batch indices to take, in order; batches may repeat or be skipped"}, 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: "", params: {"indices": "batch indices to take, in order; batches may repeat or be skipped"}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {"condition": "non-zero selects x, zero selects y"}, 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: "", params: {"bins": "number of equal-width bins", "min": "lower edge of the first bin", "max": "upper edge of the last bin"}, 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: "", params: {"bins": "number of equal-width bins", "min": "lower edge of the first bin", "max": "upper edge of the last bin"}, 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: "", params: {"offset": "position of the overlay's low corner in base, one value per dimension", "opacity": "0-1 blend amount; a number or a tensor shaped like overlay (default: 1)"}, 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: "", params: {"padding": "amounts as [dim0_before, dim0_after, dim1_before, dim1_after, ...]"}, 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: "", params: {}, aliases: [] },
"matmul": { minArgs: 2, maxArgs: 2, signature: "matmul(x, y)", forms: [["x", "y"]], description: "computes the matrix multiplication of x and y", details: "", params: {}, aliases: [] },
"linspace": { minArgs: 3, maxArgs: 3, signature: "linspace(start, stop, count)", forms: [["start", "stop", "count"]], description: "creates count evenly spaced values from start to stop (both included). Use range to control the step instead.", details: "", params: {"start": "first value", "stop": "last value (included)", "count": "number of values"}, aliases: [] },
"logspace": { minArgs: 4, maxArgs: 4, signature: "logspace(start, stop, count, base)", forms: [["start", "stop", "count", "base"]], description: "creates count values from base^start to base^stop, evenly spaced in the exponent", details: "", params: {"start": "exponent of the first value", "stop": "exponent of the last value", "count": "number of values", "base": "base of the exponent"}, 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: "", params: {"x": "list or tensor", "k": "number of elements to keep", "dim": "dimension to select along (default: last)"}, 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: "", params: {"x": "list or tensor", "k": "number of elements to keep", "dim": "dimension to select along (default: last)"}, aliases: [] },
"pinv": { minArgs: 1, maxArgs: 1, signature: "pinv(permutation)", forms: [["permutation"]], description: "computes the inverse permutation: where permutation[i] == j the result has result[j] == i. Not the matrix pseudoinverse; use inv(matrix, 1) for that", details: "", params: {"permutation": "list or tensor holding each index exactly once"}, 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: "", params: {"x": "matrix, or a batch of matrices in the last two dimensions", "pseudo": "truthy to compute the Moore-Penrose pseudoinverse, which also works for singular and non-square matrices (default: false)"}, 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: "", params: {"x": "values to add up (number, list or tensor)", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"x": "values to average (number, list or tensor)", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"x": "values (number, list or tensor)", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"x": "values (number, list or tensor)", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"x": "values to multiply (number, list or tensor)", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
"isclose": { minArgs: 2, maxArgs: 4, signature: "isclose(a, b, [rtol], [atol])", forms: [["a", "b", "[rtol]", "[atol]"]], description: "elementwise approximate equality test", details: "", params: {"a": "first values to compare", "b": "second values to compare", "rtol": "relative tolerance (default: 1e-5)", "atol": "absolute tolerance (default: 1e-8)"}, 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: "", params: {"a": "first values to compare", "b": "second values to compare", "rtol": "relative tolerance (default: 1e-5)", "atol": "absolute tolerance (default: 1e-8)"}, 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: "", params: {"x": "values (list or tensor)", "q": "quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)", "dim": "dimension to reduce (default: all elements)"}, 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: "", params: {"x": "values (list or tensor)", "q": "quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)", "dim": "dimension to reduce (default: all elements)"}, 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: "", params: {"x": "values (list or tensor)", "p": "percentile 0-100", "dim": "dimension to reduce (default: all elements)"}, 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: "", params: {"x": "values (list or tensor)", "p": "percentile 0-100", "dim": "dimension to reduce (default: all elements)"}, 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: "", params: {"x": "values (list or tensor)", "q": "quantile 0-1", "dim": "dimension to reduce (default: all elements)"}, 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: "", params: {"x": "first tensor; flattened before multiplying", "y": "second tensor with the same number of elements"}, aliases: [] },
"moment": { minArgs: 3, maxArgs: 3, signature: "moment(x, center, order)", forms: [["x", "center", "order"]], description: "computes the order-th moment of x around center: mean((x - center)^order)", details: "", params: {"x": "values (list or tensor)", "center": "centre the moment is taken around", "order": "order of the moment"}, aliases: [] },
"erf": { minArgs: 1, maxArgs: 1, signature: "erf(x)", forms: [["x"]], description: "computes the error function (torch.erf)", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"erfc": { minArgs: 1, maxArgs: 1, signature: "erfc(x)", forms: [["x"]], description: "computes the complementary error function (torch.special.erfc)", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
"erfinv": { minArgs: 1, maxArgs: 1, signature: "erfinv(x)", forms: [["x"]], description: "computes the inverse error function (torch.erfinv)", details: "", params: {"x": "value in -1..1 (number, list or tensor)"}, 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: "", params: {"x": "values to test (number, list or tensor)"}, 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: "", params: {"x": "values to test (number, list or tensor)"}, 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: "", params: {"x": "image or tensor", "kernel_size": "odd Sobel kernel size, at least 3 (default: 3)"}, aliases: [] },
"blur": { minArgs: 2, maxArgs: 3, signature: "blur(x, sigma, [auto_channels])", forms: [["x", "sigma", "[auto_channels]"]], description: "applies a separable Gaussian blur to x. Channels are expected last unless auto_channels is truthy", details: "", params: {"x": "image or tensor to blur", "sigma": "blur strength as the standard deviation in elements; 0 or less returns x unchanged", "auto_channels": "truthy to find the channel dimension automatically; otherwise channels must be last (default: false)"}, aliases: ["gaussian"] },
"gaussian": { minArgs: 2, maxArgs: 3, signature: "gaussian(x, sigma, [auto_channels])", forms: [["x", "sigma", "[auto_channels]"]], description: "applies a separable Gaussian blur to x. Channels are expected last unless auto_channels is truthy", details: "", params: {"x": "image or tensor to blur", "sigma": "blur strength as the standard deviation in elements; 0 or less returns x unchanged", "auto_channels": "truthy to find the channel dimension automatically; otherwise channels must be last (default: false)"}, aliases: ["blur"] },
"median": { minArgs: 1, maxArgs: 2, signature: "median(x, [dim])", forms: [["x", "[dim]"]], description: "computes the median globally or along one dimension", details: "", params: {"x": "values (list or tensor)", "dim": "dimension to reduce (default: all elements)"}, aliases: [] },
"mode": { minArgs: 1, maxArgs: 2, signature: "mode(x, [dim])", forms: [["x", "[dim]"]], description: "computes the mode globally or along one dimension", details: "", params: {"x": "values (list or tensor)", "dim": "dimension to reduce (default: all elements)"}, aliases: [] },
"cumsum": { minArgs: 1, maxArgs: 2, signature: "cumsum(x, [dim])", forms: [["x", "[dim]"]], description: "computes the cumulative sum, defaulting to the first dimension.", details: "", params: {"x": "list or tensor", "dim": "dimension to accumulate along (default: 0)"}, aliases: [] },
"cumprod": { minArgs: 1, maxArgs: 1, signature: "cumprod(x)", forms: [["x"]], description: "computes the cumulative product over first dimension.", details: "", params: {"x": "list or tensor"}, 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: "", params: {"x": "list or tensor", "k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, 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: "", params: {"x": "list or tensor", "k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, 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: "", params: {"x": "list or tensor", "k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, 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: "", params: {"x": "list or tensor", "k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, 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: "", params: {"a": "value at t = 0", "b": "value at t = 1", "t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["cubic"] },
"cubic": { minArgs: 3, maxArgs: 3, signature: "cubic(a, b, t)", forms: [["a", "b", "t"]], description: "cubic ease between a and b", details: "", params: {"a": "value at t = 0", "b": "value at t = 1", "t": "progress from 0 (gives a) to 1 (gives b)"}, 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: "", params: {"a": "value at t = 0", "b": "value at t = 1", "t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["elastic"] },
"elastic": { minArgs: 3, maxArgs: 3, signature: "elastic(a, b, t)", forms: [["a", "b", "t"]], description: "elastic ease between a and b", details: "", params: {"a": "value at t = 0", "b": "value at t = 1", "t": "progress from 0 (gives a) to 1 (gives b)"}, 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: "", params: {"a": "value at t = 0", "b": "value at t = 1", "t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["sine"] },
"sine": { minArgs: 3, maxArgs: 3, signature: "sine(a, b, t)", forms: [["a", "b", "t"]], description: "sine easing between a and b", details: "", params: {"a": "value at t = 0", "b": "value at t = 1", "t": "progress from 0 (gives a) to 1 (gives b)"}, 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: "", params: {"x": "input values", "edge0": "value mapped to 0", "edge1": "value mapped to 1"}, 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: "", params: {"x1": "x of the first point", "y1": "y of the first point", "x2": "x of the second point", "y2": "y of the second point"}, 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: "", params: {"x1": "x of the first point", "y1": "y of the first point", "x2": "x of the second point", "y2": "y of the second point"}, aliases: ["dist"] },
"remap": { minArgs: 5, maxArgs: 5, signature: "remap(x, in_min, in_max, out_min, out_max)", forms: [["x", "in_min", "in_max", "out_min", "out_max"]], description: "remaps values from input range to output range", details: "", params: {"x": "values to remap (number, list or tensor)", "in_min": "start of the input range", "in_max": "end of the input range", "out_min": "value in_min maps to", "out_max": "value in_max maps to"}, aliases: [] },
"cossim": { minArgs: 2, maxArgs: 2, signature: "cossim(x, y)", forms: [["x", "y"]], description: "computes the cosine similarity between x and y.", details: "", params: {"x": "vectors along the last dimension", "y": "vectors along the last dimension"}, 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: "", params: {"x": "vectors along the last dimension", "y": "vectors along the last dimension"}, aliases: ["cossim"] },
"count": { minArgs: 1, maxArgs: 1, signature: "count(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", params: {"x": "list, tensor, dictionary or value"}, aliases: ["cnt", "length"] },
"cnt": { minArgs: 1, maxArgs: 1, signature: "cnt(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", params: {"x": "list, tensor, dictionary or value"}, aliases: ["count", "length"] },
"length": { minArgs: 1, maxArgs: 1, signature: "length(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", params: {"x": "list, tensor, dictionary or value"}, aliases: ["count", "cnt"] },
"keys": { minArgs: 1, maxArgs: 1, signature: "keys(dict)", forms: [["dict"]], description: "returns a list of dictionary keys in insertion order", details: "", params: {"dict": "dictionary"}, aliases: [] },
"enable_tracking": { minArgs: 1, maxArgs: 1, signature: "enable_tracking(dict)", forms: [["dict"]], description: "enables change tracking for a ChangeTrackingDict and returns it", details: "", params: {"dict": "ChangeTrackingDict (other values are returned unchanged)"}, aliases: ["track_on"] },
"track_on": { minArgs: 1, maxArgs: 1, signature: "track_on(dict)", forms: [["dict"]], description: "enables change tracking for a ChangeTrackingDict and returns it", details: "", params: {"dict": "ChangeTrackingDict (other values are returned unchanged)"}, aliases: ["enable_tracking"] },
"disable_tracking": { minArgs: 1, maxArgs: 1, signature: "disable_tracking(dict)", forms: [["dict"]], description: "disables change tracking for a ChangeTrackingDict and returns it", details: "", params: {"dict": "ChangeTrackingDict (other values are returned unchanged)"}, aliases: ["track_off"] },
"track_off": { minArgs: 1, maxArgs: 1, signature: "track_off(dict)", forms: [["dict"]], description: "disables change tracking for a ChangeTrackingDict and returns it", details: "", params: {"dict": "ChangeTrackingDict (other values are returned unchanged)"}, aliases: ["disable_tracking"] },
"reset_tracking": { minArgs: 1, maxArgs: 1, signature: "reset_tracking(dict)", forms: [["dict"]], description: "resets the change tracking state of a ChangeTrackingDict and returns it", details: "", params: {"dict": "ChangeTrackingDict (other values are returned unchanged)"}, aliases: ["track_reset"] },
"track_reset": { minArgs: 1, maxArgs: 1, signature: "track_reset(dict)", forms: [["dict"]], description: "resets the change tracking state of a ChangeTrackingDict and returns it", details: "", params: {"dict": "ChangeTrackingDict (other values are returned unchanged)"}, aliases: ["reset_tracking"] },
"get_changed_keys": { minArgs: 1, maxArgs: 1, signature: "get_changed_keys(dict)", forms: [["dict"]], description: "returns the keys that were modified or added in a ChangeTrackingDict", details: "", params: {"dict": "ChangeTrackingDict"}, aliases: ["changed_keys"] },
"changed_keys": { minArgs: 1, maxArgs: 1, signature: "changed_keys(dict)", forms: [["dict"]], description: "returns the keys that were modified or added in a ChangeTrackingDict", details: "", params: {"dict": "ChangeTrackingDict"}, aliases: ["get_changed_keys"] },
"get_added_keys": { minArgs: 1, maxArgs: 1, signature: "get_added_keys(dict)", forms: [["dict"]], description: "returns the keys that were newly added to a ChangeTrackingDict", details: "", params: {"dict": "ChangeTrackingDict"}, aliases: ["added_keys"] },
"added_keys": { minArgs: 1, maxArgs: 1, signature: "added_keys(dict)", forms: [["dict"]], description: "returns the keys that were newly added to a ChangeTrackingDict", details: "", params: {"dict": "ChangeTrackingDict"}, aliases: ["get_added_keys"] },
"get_removed_keys": { minArgs: 1, maxArgs: 1, signature: "get_removed_keys(dict)", forms: [["dict"]], description: "returns the keys that were removed from a ChangeTrackingDict", details: "", params: {"dict": "ChangeTrackingDict"}, aliases: ["removed_keys"] },
"removed_keys": { minArgs: 1, maxArgs: 1, signature: "removed_keys(dict)", forms: [["dict"]], description: "returns the keys that were removed from a ChangeTrackingDict", details: "", params: {"dict": "ChangeTrackingDict"}, aliases: ["get_removed_keys"] },
"get_unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "get_unchanged_keys(dict)", forms: [["dict"]], description: "returns the keys that are unchanged in a ChangeTrackingDict", details: "", params: {"dict": "ChangeTrackingDict"}, aliases: ["unchanged_keys"] },
"unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "unchanged_keys(dict)", forms: [["dict"]], description: "returns the keys that are unchanged in a ChangeTrackingDict", details: "", params: {"dict": "ChangeTrackingDict"}, 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: "", params: {"x": "text, list or tensor to repeat", "count": "number of repeats, or a list with one count per dimension", "dims": "dimension or list of dimensions to repeat along; without it a number repeats each element of the flattened input and a list tiles the whole tensor"}, aliases: [] },
"flatten": { minArgs: 1, maxArgs: 1, signature: "flatten(x)", forms: [["x"]], description: "flattens tensor into a 1D tensor", details: "", params: {"x": "tensor or nested list"}, aliases: [] },
"append": { minArgs: 2, maxArgs: 2, signature: "append(list, item)", forms: [["list", "item"]], description: "adds item to the end of list. To join tensors along a dimension use concatenate(...)", details: "", params: {"list": "list, tensor or value to extend", "item": "item, list or tensor added to the end of list"}, 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: "", params: {"tensor": "tensor to read from", "position": "list with one index per dimension"}, aliases: [] },
"flow_apply": { minArgs: 2, maxArgs: 2, signature: "flow_apply(image, flow)", forms: [["image", "flow"]], description: "applies optical flow to an image", details: "", params: {"image": "image to warp", "flow": "per-pixel displacement [..., 2], e.g. from rife()"}, 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: "", params: {"x": "tensor whose first dimension is the batch", "indices": "batch indices to take, in order; batches may repeat or be skipped"}, 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: "", params: {"x": "tensor whose first dimension is the batch", "indices": "batch indices to take, in order; batches may repeat or be skipped"}, 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: "", params: {"x": "tensor whose first dimension is the batch", "indices": "batch indices to take, in order; batches may repeat or be skipped"}, aliases: ["batch_shuffle", "shuffle"] },
"motion_mask": { minArgs: 1, maxArgs: 1, signature: "motion_mask(flow)", forms: [["flow"]], description: "generates a motion mask from optical flow", details: "", params: {"flow": "optical flow [..., 2], e.g. from rife()"}, aliases: [] },
"flow_to_image": { minArgs: 1, maxArgs: 1, signature: "flow_to_image(flow)", forms: [["flow"]], description: "converts optical flow to an RGB image. Up-down is blue-yellow, left-right is green-magenta.", details: "", params: {"flow": "optical flow [..., 2], e.g. from rife()"}, aliases: [] },
"flow_mag": { minArgs: 1, maxArgs: 1, signature: "flow_mag(flow)", forms: [["flow"]], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", params: {"flow": "optical flow [..., 2], e.g. from rife()"}, aliases: ["flow_magnitude"] },
"flow_magnitude": { minArgs: 1, maxArgs: 1, signature: "flow_magnitude(flow)", forms: [["flow"]], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", params: {"flow": "optical flow [..., 2], e.g. from rife()"}, aliases: ["flow_mag"] },
"flow_ang": { minArgs: 1, maxArgs: 1, signature: "flow_ang(flow)", forms: [["flow"]], description: "computes the angle atan2(dy, dx) of optical flow (like angle(), with real and imaginary parts in the last dimension)", details: "", params: {"flow": "optical flow [..., 2], e.g. from rife()"}, aliases: ["flow_angle"] },
"flow_angle": { minArgs: 1, maxArgs: 1, signature: "flow_angle(flow)", forms: [["flow"]], description: "computes the angle atan2(dy, dx) of optical flow (like angle(), with real and imaginary parts in the last dimension)", details: "", params: {"flow": "optical flow [..., 2], e.g. from rife()"}, aliases: ["flow_ang"] },
"where": { minArgs: 3, maxArgs: 3, signature: "where(condition, if_true, if_false)", forms: [["condition", "if_true", "if_false"]], description: "returns if_true where condition is non-zero, otherwise if_false. Runs per element", details: "", params: {"condition": "non-zero selects if_true, zero selects if_false", "if_true": "value used where condition is non-zero", "if_false": "value used where condition is zero"}, 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: "", params: {"x": "values; flattened", "bins": "number of equal-width bins", "min": "lower edge of the first bin", "max": "upper edge of the last bin"}, 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: "", params: {"x": "values; flattened", "bins": "number of equal-width bins", "min": "lower edge of the first bin", "max": "upper edge of the last bin"}, 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: "", params: {"base": "background value, list, text or tensor", "overlay": "value placed on top of base", "offset": "position of the overlay's low corner in base, one value per dimension", "opacity": "0-1 blend amount; a number or a tensor shaped like overlay (default: 1)"}, 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: "", params: {"x": "tensor to pad", "padding": "amounts as [dim0_before, dim0_after, dim1_before, dim1_after, ...]"}, 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: "", params: {"x": "vectors with 3 components in the last dimension", "y": "vectors with 3 components in the last dimension"}, aliases: [] },
"matmul": { minArgs: 2, maxArgs: 2, signature: "matmul(x, y)", forms: [["x", "y"]], description: "computes the matrix multiplication of x and y", details: "", params: {"x": "left matrix or batch of matrices", "y": "right matrix or batch of matrices"}, 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: "", params: {"A": "square coefficient matrix", "b": "right-hand side"}, 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: "", params: {"tol": "absolute tolerance below which singular values count as zero"}, 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: "", params: {"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"}, aliases: [] },
"bnot": { minArgs: 1, maxArgs: 1, signature: "bnot(x)", forms: [["x"]], description: "computes the bitwise NOT", details: "", params: {}, aliases: ["bitwise_not"] },
"bitwise_not": { minArgs: 1, maxArgs: 1, signature: "bitwise_not(x)", forms: [["x"]], description: "computes the bitwise NOT", details: "", params: {}, aliases: ["bnot"] },
"bitcount": { minArgs: 1, maxArgs: 1, signature: "bitcount(x)", forms: [["x"]], description: "returns the number of set bits", details: "", params: {}, aliases: ["popcount", "popcnt"] },
"popcount": { minArgs: 1, maxArgs: 1, signature: "popcount(x)", forms: [["x"]], description: "returns the number of set bits", details: "", params: {}, aliases: ["bitcount", "popcnt"] },
"popcnt": { minArgs: 1, maxArgs: 1, signature: "popcnt(x)", forms: [["x"]], description: "returns the number of set bits", details: "", params: {}, aliases: ["bitcount", "popcount"] },
"shape": { minArgs: 1, maxArgs: 1, signature: "shape(x)", forms: [["x"]], description: "returns the shape of tensor as a list", details: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, aliases: ["bor"] },
"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: "", params: {"x": "matrix, or a batch of matrices in the last two dimensions", "tol": "absolute tolerance below which singular values count as zero"}, 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: "", params: {"image1": "first frame", "image2": "second frame", "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"}, aliases: [] },
"bnot": { minArgs: 1, maxArgs: 1, signature: "bnot(x)", forms: [["x"]], description: "computes the bitwise NOT", details: "", params: {"x": "integer values (number, list or tensor)"}, aliases: ["bitwise_not"] },
"bitwise_not": { minArgs: 1, maxArgs: 1, signature: "bitwise_not(x)", forms: [["x"]], description: "computes the bitwise NOT", details: "", params: {"x": "integer values (number, list or tensor)"}, aliases: ["bnot"] },
"bitcount": { minArgs: 1, maxArgs: 1, signature: "bitcount(x)", forms: [["x"]], description: "returns the number of set bits", details: "", params: {"x": "integer values (number, list or tensor)"}, aliases: ["popcount", "popcnt"] },
"popcount": { minArgs: 1, maxArgs: 1, signature: "popcount(x)", forms: [["x"]], description: "returns the number of set bits", details: "", params: {"x": "integer values (number, list or tensor)"}, aliases: ["bitcount", "popcnt"] },
"popcnt": { minArgs: 1, maxArgs: 1, signature: "popcnt(x)", forms: [["x"]], description: "returns the number of set bits", details: "", params: {"x": "integer values (number, list or tensor)"}, aliases: ["bitcount", "popcount"] },
"shape": { minArgs: 1, maxArgs: 1, signature: "shape(x)", forms: [["x"]], description: "returns the shape of tensor as a list", details: "", params: {"x": "tensor, list or value"}, 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: "", params: {"x": "integer values (number, list or tensor)", "y": "integer values (number, list or tensor)"}, 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: "", params: {"x": "integer values (number, list or tensor)", "y": "integer values (number, list or tensor)"}, 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: "", params: {"x": "integer values (number, list or tensor)", "y": "integer values (number, list or tensor)"}, 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: "", params: {"x": "integer values (number, list or tensor)", "y": "integer values (number, list or tensor)"}, 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: "", params: {"x": "integer values (number, list or tensor)", "y": "integer values (number, list or tensor)"}, 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: "", params: {"x": "integer values (number, list or tensor)", "y": "integer values (number, list or tensor)"}, 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: "", params: {"shape": "list of dimension sizes", "value": "fill value (default: 0)", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, 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: "", params: {"shape": "list of dimension sizes", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, 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: "", params: {"shape": "list of dimension sizes", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, aliases: [] },
"eye": { minArgs: 1, maxArgs: 2, signature: "eye(n, [dtype_template])", forms: [["n", "[dtype_template]"]], description: "creates an n-by-n identity matrix", details: "", params: {"n": "number of rows and columns", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, 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: "", params: {"indices": "integer class indices", "classes": "number of classes, i.e. the length of each one-hot vector"}, 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: "", params: {"reduction": "\"mean\" (default), \"sum\", or \"none\" for element-wise values"}, 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: "", params: {"reduction": "\"mean\" (default), \"sum\", or \"none\" for element-wise values"}, 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: "", params: {"data_range": "difference between the largest and smallest possible value (default: 1)"}, 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: "", params: {"weights": "weight of each element, broadcast against x", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"delta": "error size where the loss changes from quadratic to linear (default: 1)", "reduction": "\"mean\" (default), \"sum\", or \"none\" for element-wise values"}, 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: "", params: {"a": "first values (broadcast against b)", "b": "second values", "reduction": "\"mean\" (default), \"sum\", or \"none\" for element-wise values"}, 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: "", params: {"a": "first values (broadcast against b)", "b": "second values", "reduction": "\"mean\" (default), \"sum\", or \"none\" for element-wise values"}, 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: "", params: {"a": "first image", "b": "second image", "data_range": "difference between the largest and smallest possible value (default: 1)"}, 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: "", params: {"x": "values (list or tensor)", "weights": "weight of each element, broadcast against x", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, 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: "", params: {"prediction": "predicted values", "target": "expected values", "delta": "error size where the loss changes from quadratic to linear (default: 1)", "reduction": "\"mean\" (default), \"sum\", or \"none\" for element-wise values"}, 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: "", params: {"logits": "unnormalised class scores", "target": "class indices, or class probabilities with the same shape as logits", "dim": "class dimension (default: 1, or 0 for a single vector)", "reduction": "\"mean\" (default), \"sum\", or \"none\" for element-wise values"}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, aliases: ["remove_key"] },
"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: "", params: {"dict": "dictionary to change; it is also returned", "key": "entry name", "value": "entry value"}, 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: "", params: {"dict": "dictionary to change; it is also returned", "key": "entry name to remove; missing keys are ignored"}, 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: "", params: {"dict": "dictionary to change; it is also returned", "key": "entry name to remove; missing keys are ignored"}, 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: "", params: {"slot": "stack number (any integer)", "val": "value to push; it is also returned"}, aliases: [] },
"stack_pop": { minArgs: 1, maxArgs: 1, signature: "stack_pop(slot)", forms: [["slot"]], description: "removes and returns the last element of slot stack", details: "", params: {}, aliases: [] },
"stack_clear": { minArgs: 1, maxArgs: 1, signature: "stack_clear(slot)", forms: [["slot"]], description: "clears the contents of slot stack", details: "", params: {}, 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: "", params: {}, 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: "", params: {}, aliases: [] },
"cat": { minArgs: 2, maxArgs: null, signature: "cat(x, ..., dim)", forms: [["x", "...", "dim"]], description: "concatenates one or more tensors along the specified dimension", details: "", params: {"dim": "dimension to join along (the last argument)"}, 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: "", params: {"dim": "dimension to join along (the last argument)"}, 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: "", params: {"dim": "dimension to join along (the last argument)"}, aliases: ["cat", "concat"] },
"stack_pop": { minArgs: 1, maxArgs: 1, signature: "stack_pop(slot)", forms: [["slot"]], description: "removes and returns the last element of slot stack", details: "", params: {"slot": "stack number (any integer)"}, aliases: [] },
"stack_clear": { minArgs: 1, maxArgs: 1, signature: "stack_clear(slot)", forms: [["slot"]], description: "clears the contents of slot stack", details: "", params: {"slot": "stack number (any integer)"}, 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: "", params: {"slot": "stack number (any integer)"}, 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: "", params: {"slot": "stack number (any integer)"}, aliases: [] },
"cat": { minArgs: 2, maxArgs: null, signature: "cat(x, ..., dim)", forms: [["x", "...", "dim"]], description: "concatenates one or more tensors along the specified dimension", details: "", params: {"x": "first tensor or list; more may follow before dim", "dim": "dimension to join along (the last argument)"}, 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: "", params: {"x": "first tensor or list; more may follow before dim", "dim": "dimension to join along (the last argument)"}, 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: "", params: {"x": "first tensor or list; more may follow before dim", "dim": "dimension to join along (the last argument)"}, 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: "", params: {"tensors": "list of tensors with equal shapes", "dim": "position of the new dimension (default: 0)"}, aliases: [] },
"nonzero": { minArgs: 1, maxArgs: 1, signature: "nonzero(x)", forms: [["x"]], description: "returns an N-by-rank tensor of coordinates for nonzero elements", details: "", params: {}, aliases: [] },
"int": { minArgs: 1, maxArgs: 1, signature: "int(x)", forms: [["x"]], description: "casts x to integer", details: "", params: {}, aliases: [] },
"float": { minArgs: 1, maxArgs: 1, signature: "float(x)", forms: [["x"]], description: "casts x to float", details: "", params: {}, aliases: [] },
"upper": { minArgs: 1, maxArgs: 1, signature: "upper(x)", forms: [["x"]], description: "converts string to uppercase", details: "", params: {}, aliases: [] },
"lower": { minArgs: 1, maxArgs: 1, signature: "lower(x)", forms: [["x"]], description: "converts string to lowercase", details: "", params: {}, aliases: [] },
"trim": { minArgs: 1, maxArgs: 1, signature: "trim(x)", forms: [["x"]], description: "removes leading and trailing whitespace from string", details: "", params: {}, 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: "", params: {"delimiter": "text to split on (default: a space)"}, 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: "", params: {"separator": "text placed between the items (default: \"\")"}, 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: "", params: {"start": "index of the first character", "length": "number of characters (default: the rest of the text)"}, 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: "", params: {"start": "index of the first character", "length": "number of characters (default: the rest of the text)"}, 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: "", params: {}, 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: "", params: {"old": "text or value to look for", "new": "replacement"}, 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: "", params: {"kernel_size": "size of the square kernel (default: 3)"}, 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: "", params: {"kernel_size": "size of the square kernel (default: 3)"}, 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: "", params: {"kernel_size": "size of the square kernel (default: 3)"}, 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: "", params: {"kernel_size": "size of the square kernel (default: 3)"}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {"degrees": "truthy to use hue in 0-360 instead of 0-1"}, 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: "", params: {"degrees": "truthy to use hue in 0-360 instead of 0-1"}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {"scale": "a number scales every spatial dimension; a list gives the target spatial size"}, 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: "", params: {"scale": "a number scales every spatial dimension; a list gives the target spatial size"}, 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: "", params: {"scale": "a number scales every spatial dimension; a list gives the target spatial size"}, 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: "", params: {"scale": "a number scales every spatial dimension; a list gives the target spatial size"}, 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: "", params: {"font": "font name to look up in the system fonts, or a path to a font file", "size": "font size in pixels", "max_width": "wrap lines wider than this many pixels (default: 0, no wrapping)", "weight": "font weight 100-900 as in CSS (default: 400)", "rotation_angle": "rotation in degrees, counter-clockwise (default: 0)", "line_spacing": "line distance as a multiple of the line height (default: 1)", "italic": "truthy for italic text (default: false)", "underline": "truthy to underline the text (default: false)"}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {"full_matrices": "truthy to return full-size U and Vh (default: false)"}, 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: "", params: {"full_matrices": "truthy to return full-size U and Vh (default: false)"}, 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: "", params: {"shape": "shape of the result", "offset": "diagonal offset: positive above, negative below the main diagonal (default: 0)", "dim1": "first dimension of the matrix (default: -2)", "dim2": "second dimension of the matrix (default: -1)"}, 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: "", params: {"shape": "shape of the result", "offset": "diagonal offset: positive above, negative below the main diagonal (default: 0)", "dim1": "first dimension of the matrix (default: -2)", "dim2": "second dimension of the matrix (default: -1)"}, aliases: ["diagonal_matrix"] },
"nonzero": { minArgs: 1, maxArgs: 1, signature: "nonzero(x)", forms: [["x"]], description: "returns an N-by-rank tensor of coordinates for nonzero elements", details: "", params: {"x": "tensor"}, aliases: [] },
"int": { minArgs: 1, maxArgs: 1, signature: "int(x)", forms: [["x"]], description: "casts x to integer", details: "", params: {"x": "value to convert; lists convert each item and text is parsed"}, aliases: [] },
"float": { minArgs: 1, maxArgs: 1, signature: "float(x)", forms: [["x"]], description: "casts x to float", details: "", params: {"x": "value to convert; lists convert each item and text is parsed"}, aliases: [] },
"upper": { minArgs: 1, maxArgs: 1, signature: "upper(text)", forms: [["text"]], description: "converts string to uppercase", details: "", params: {"text": "text"}, aliases: [] },
"lower": { minArgs: 1, maxArgs: 1, signature: "lower(text)", forms: [["text"]], description: "converts string to lowercase", details: "", params: {"text": "text"}, aliases: [] },
"trim": { minArgs: 1, maxArgs: 1, signature: "trim(text)", forms: [["text"]], description: "removes leading and trailing whitespace from string", details: "", params: {"text": "text"}, aliases: [] },
"split": { minArgs: 1, maxArgs: 2, signature: "split(text, [delimiter])", forms: [["text", "[delimiter]"]], description: "splits string to list of strings based on delimiter. Default is space.", details: "", params: {"text": "text to split", "delimiter": "text to split on (default: a space)"}, aliases: [] },
"join": { minArgs: 1, maxArgs: 2, signature: "join(items, [separator])", forms: [["items", "[separator]"]], description: "joins items as text using separator (default \"\"). Use concatenate(...) to join tensors", details: "", params: {"items": "list or tensor of items to join", "separator": "text placed between the items (default: \"\")"}, aliases: [] },
"substring": { minArgs: 2, maxArgs: 3, signature: "substring(text, start, [length])", forms: [["text", "start", "[length]"]], description: "returns length characters of text starting at start. If length is not supplied, it returns the rest of the string", details: "", params: {"text": "source text", "start": "index of the first character", "length": "number of characters (default: the rest of the text)"}, aliases: ["substr"] },
"substr": { minArgs: 2, maxArgs: 3, signature: "substr(text, start, [length])", forms: [["text", "start", "[length]"]], description: "returns length characters of text starting at start. If length is not supplied, it returns the rest of the string", details: "", params: {"text": "source text", "start": "index of the first character", "length": "number of characters (default: the rest of the text)"}, aliases: ["substring"] },
"find": { minArgs: 2, maxArgs: 2, signature: "find(text, search)", forms: [["text", "search"]], description: "returns the index of the first occurrence of search in text, or -1 if it is not found", details: "", params: {"text": "text to search in", "search": "text to look for"}, aliases: [] },
"replace": { minArgs: 3, maxArgs: 3, signature: "replace(value, old, new)", forms: [["value", "old", "new"]], description: "replaces every occurrence of old with new; works on text, lists and tensors", details: "", params: {"value": "text, list or tensor", "old": "text or value to look for", "new": "replacement"}, 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: "", params: {"x": "mask or image with values 0-1", "kernel_size": "size of the square kernel (default: 3)"}, 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: "", params: {"x": "mask or image with values 0-1", "kernel_size": "size of the square kernel (default: 3)"}, 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: "", params: {"x": "mask or image with values 0-1", "kernel_size": "size of the square kernel (default: 3)"}, 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: "", params: {"x": "mask or image with values 0-1", "kernel_size": "size of the square kernel (default: 3)"}, 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: "", params: {"rgb": "sRGB colors (0-1) with R, G, B in the last dimension, or a 3-item list", "r": "red channel 0-1", "g": "green channel 0-1", "b": "blue channel 0-1"}, 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: "", params: {"rgb": "sRGB colors (0-1) with R, G, B in the last dimension, or a 3-item list", "r": "red channel 0-1", "g": "green channel 0-1", "b": "blue channel 0-1"}, 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: "", params: {"oklab": "OKLab colors with L, a, b in the last dimension, or a 3-item list", "l": "lightness", "a": "green-red axis", "b": "blue-yellow axis"}, 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: "", params: {"cielab": "CIELAB colors / 100 with L, a, b in the last dimension, or a 3-item list", "l": "lightness / 100 (0-1)", "a": "green-red axis / 100", "b": "blue-yellow axis / 100"}, 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: "", params: {"rgb": "colors (0-1) with R, G, B in the last dimension, or a 3-item list", "degrees": "truthy to use hue in 0-360 instead of 0-1", "r": "red channel 0-1", "g": "green channel 0-1", "b": "blue channel 0-1"}, 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: "", params: {"hsv": "colors with H, S, V in the last dimension, or a 3-item list", "degrees": "truthy to use hue in 0-360 instead of 0-1", "h": "hue 0-1 (0-360 with degrees)", "s": "saturation 0-1", "v": "value (brightness) 0-1"}, aliases: [] },
"int_to_rgb": { minArgs: 1, maxArgs: 1, signature: "int_to_rgb(color)", forms: [["color"]], 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: "", params: {"color": "packed 0xRRGGBB integer, list or tensor"}, 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: "", params: {"rgb": "colors with R, G, B (0-1) in the last dimension, or a 3-item list", "r": "red channel 0-1", "g": "green channel 0-1", "b": "blue channel 0-1"}, 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: "", params: {"x": "tensor shaped [N, C, ...] with 1-3 spatial dimensions", "scale": "a number scales every spatial dimension; a list gives the target spatial size"}, 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: "", params: {"x": "tensor shaped [N, C, ...] with 1-3 spatial dimensions", "scale": "a number scales every spatial dimension; a list gives the target spatial size"}, 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: "", params: {"x": "tensor shaped [N, C, ...] with 1-3 spatial dimensions", "scale": "a number scales every spatial dimension; a list gives the target spatial size"}, 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: "", params: {"x": "tensor shaped [N, C, ...] with 1-3 spatial dimensions", "scale": "a number scales every spatial dimension; a list gives the target spatial size"}, 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: "", params: {"text": "text to render; line breaks start new lines", "font": "font name to look up in the system fonts, or a path to a font file", "size": "font size in pixels", "max_width": "wrap lines wider than this many pixels (default: 0, no wrapping)", "weight": "font weight 100-900 as in CSS (default: 400)", "rotation_angle": "rotation in degrees, counter-clockwise (default: 0)", "line_spacing": "line distance as a multiple of the line height (default: 1)", "italic": "truthy for italic text (default: false)", "underline": "truthy to underline the text (default: false)"}, aliases: [] },
"as_nested_tensor": { minArgs: 1, maxArgs: 1, signature: "as_nested_tensor(values)", forms: [["values"]], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", params: {"values": "list of tensors; their shapes may differ"}, aliases: ["as_nested"] },
"as_nested": { minArgs: 1, maxArgs: 1, signature: "as_nested(values)", forms: [["values"]], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", params: {"values": "list of tensors; their shapes may differ"}, 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: "", params: {"x": "matrix, or a batch of matrices in the last two dimensions", "full_matrices": "truthy to return full-size U and Vh (default: false)"}, 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: "", params: {"x": "matrix, or a batch of matrices in the last two dimensions", "full_matrices": "truthy to return full-size U and Vh (default: false)"}, aliases: ["svd"] },
"diagonal_matrix": { minArgs: 2, maxArgs: 5, signature: "diagonal_matrix(values, shape, [offset], [dim1], [dim2])", forms: [["values", "shape", "[offset]", "[dim1]", "[dim2]"]], description: "creates a tensor of the given shape with values on a diagonal and zeros elsewhere", details: "", params: {"values": "values placed on the diagonal", "shape": "shape of the result", "offset": "diagonal offset: positive above, negative below the main diagonal (default: 0)", "dim1": "first dimension of the matrix (default: -2)", "dim2": "second dimension of the matrix (default: -1)"}, aliases: ["diag"] },
"diag": { minArgs: 2, maxArgs: 5, signature: "diag(values, shape, [offset], [dim1], [dim2])", forms: [["values", "shape", "[offset]", "[dim1]", "[dim2]"]], description: "creates a tensor of the given shape with values on a diagonal and zeros elsewhere", details: "", params: {"values": "values placed on the diagonal", "shape": "shape of the result", "offset": "diagonal offset: positive above, negative below the main diagonal (default: 0)", "dim1": "first dimension of the matrix (default: -2)", "dim2": "second dimension of the matrix (default: -1)"}, aliases: ["diagonal_matrix"] },
"timestamp": { minArgs: 0, maxArgs: 0, signature: "timestamp()", forms: [[]], description: "returns the current system timestamp", details: "", params: {}, aliases: ["now"] },
"now": { minArgs: 0, maxArgs: 0, signature: "now()", forms: [[]], description: "returns the current system timestamp", details: "", params: {}, 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: "", params: {"descending": "truthy to sort from largest to smallest (default: false)", "dim": "dimension to sort along (default: last)"}, 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: "", params: {"descending": "truthy to sort from largest to smallest (default: false)", "dim": "dimension to sort along (default: last)"}, 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: "", params: {"as_position": "truthy to return the coordinates of the minimum instead of a flat index", "dim": "dimension to search along; cannot be combined with as_position"}, 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: "", params: {"as_position": "truthy to return the coordinates of the maximum instead of a flat index", "dim": "dimension to search along; cannot be combined with as_position"}, 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: "", params: {"dim": "dimension whose slices sum to 1 (default: last)"}, 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: "", params: {"dim": "dimension whose slices sum to 1 (default: last)"}, aliases: [] },
"unique": { minArgs: 1, maxArgs: 1, signature: "unique(x)", forms: [["x"]], description: "returns the sorted unique elements of x (tensors are flattened first)", details: "", params: {}, 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: "", params: {"dims": "dimension or list of dimensions to reverse"}, aliases: [] },
"startswith": { minArgs: 2, maxArgs: 2, signature: "startswith(text, prefix)", forms: [["text", "prefix"]], description: "returns 1 if text starts with prefix, else 0", details: "", params: {}, aliases: [] },
"endswith": { minArgs: 2, maxArgs: 2, signature: "endswith(text, suffix)", forms: [["text", "suffix"]], description: "returns 1 if text ends with suffix, else 0", details: "", params: {}, 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: "", params: {"dim": "only remove this dimension, if it has size 1"}, 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: "", params: {"dim": "position of the new size-1 dimension"}, 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: "", params: {"shifts": "number of places to shift; elements pushed off one end come back at the other", "dim": "dimension to shift along (default: 0)"}, 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: "", params: {}, aliases: [] },
"corr": { minArgs: 2, maxArgs: 2, signature: "corr(x, y)", forms: [["x", "y"]], description: "computes the Pearson correlation coefficient between x and y", details: "", params: {}, 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: "", params: {}, 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: "", params: {}, 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: "", params: {"start": "low corner of the region, one index per dimension", "size": "size of the result, one value per dimension"}, aliases: [] },
"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: "", params: {"x": "list or tensor to sort", "descending": "truthy to sort from largest to smallest (default: false)", "dim": "dimension to sort along (default: last)"}, 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: "", params: {"x": "list or tensor", "descending": "truthy to sort from largest to smallest (default: false)", "dim": "dimension to sort along (default: last)"}, 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: "", params: {"x": "list or tensor to search", "as_position": "truthy to return the coordinates of the minimum instead of a flat index", "dim": "dimension to search along; cannot be combined with as_position"}, 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: "", params: {"x": "list or tensor to search", "as_position": "truthy to return the coordinates of the maximum instead of a flat index", "dim": "dimension to search along; cannot be combined with as_position"}, 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: "", params: {"x": "scores (list or tensor)", "dim": "dimension whose slices sum to 1 (default: last)"}, 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: "", params: {"x": "scores (list or tensor)", "dim": "dimension whose slices sum to 1 (default: last)"}, aliases: [] },
"unique": { minArgs: 1, maxArgs: 1, signature: "unique(x)", forms: [["x"]], description: "returns the sorted unique elements of x (tensors are flattened first)", details: "", params: {"x": "list or tensor"}, 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: "", params: {"x": "tensor, list or text", "dims": "dimension or list of dimensions to reverse"}, aliases: [] },
"startswith": { minArgs: 2, maxArgs: 2, signature: "startswith(text, prefix)", forms: [["text", "prefix"]], description: "returns 1 if text starts with prefix, else 0", details: "", params: {"text": "text to check", "prefix": "start to look for"}, aliases: [] },
"endswith": { minArgs: 2, maxArgs: 2, signature: "endswith(text, suffix)", forms: [["text", "suffix"]], description: "returns 1 if text ends with suffix, else 0", details: "", params: {"text": "text to check", "suffix": "ending to look for"}, 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: "", params: {"x": "tensor", "dim": "only remove this dimension, if it has size 1"}, 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: "", params: {"x": "tensor", "dim": "position of the new size-1 dimension"}, 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: "", params: {"x": "tensor", "shifts": "number of places to shift; elements pushed off one end come back at the other", "dim": "dimension to shift along (default: 0)"}, 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: "", params: {"x": "first values; flattened", "y": "second values with the same number of elements"}, aliases: [] },
"corr": { minArgs: 2, maxArgs: 2, signature: "corr(x, y)", forms: [["x", "y"]], description: "computes the Pearson correlation coefficient between x and y", details: "", params: {"x": "first values", "y": "second values"}, 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: "", params: {"x": "first values", "y": "second values"}, aliases: ["corr"] },
"entropy": { minArgs: 1, maxArgs: 1, signature: "entropy(logits)", forms: [["logits"]], description: "computes the Shannon entropy (in nats) of softmax(logits) over all elements", details: "", params: {"logits": "scores (list or tensor)"}, 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: "", params: {"x": "tensor or text", "start": "low corner of the region, one index per dimension", "size": "size of the result, one value per dimension"}, 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: "", params: {"shape": "list of dimension sizes", "dim": "dimension whose index becomes the value", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, 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: "", params: {"shape": "list of dimension sizes", "dim": "dimension whose index becomes the value", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, 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: "", params: {"dim": "dimension to gather along", "idx": "indices along dim; the result has the shape of idx"}, 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: "", params: {"dim": "dimension to scatter along", "idx": "position along dim for each element of src", "src": "values to write"}, 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: "", params: {"dim": "dimension to scatter along", "idx": "position along dim for each element of src", "src": "values to add"}, aliases: [] },
"gather": { minArgs: 3, maxArgs: 3, signature: "gather(x, dim, indices)", forms: [["x", "dim", "indices"]], description: "gathers elements of x along dim at the given indices. The result has the shape of indices.", details: "", params: {"x": "source tensor", "dim": "dimension to gather along", "indices": "indices along dim; the result has their shape"}, aliases: [] },
"scatter": { minArgs: 4, maxArgs: 4, signature: "scatter(x, dim, indices, src)", forms: [["x", "dim", "indices", "src"]], description: "writes the elements of src into x along dim at the given indices. The result has the shape of x.", details: "", params: {"x": "tensor to write into", "dim": "dimension to scatter along", "indices": "position along dim for each element of src", "src": "values to write"}, aliases: [] },
"scatter_add": { minArgs: 4, maxArgs: 4, signature: "scatter_add(x, dim, indices, src)", forms: [["x", "dim", "indices", "src"]], description: "adds the elements of src into x along dim at the given indices. The result has the shape of x.", details: "", params: {"x": "tensor to add into", "dim": "dimension to scatter along", "indices": "position along dim for each element of src", "src": "values to add"}, aliases: [] },
"noise": { minArgs: 1, maxArgs: 2, signature: "noise(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates normally distributed random noise", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randn", "random_normal"] },
"randn": { minArgs: 1, maxArgs: 2, signature: "randn(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates normally distributed random noise", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["noise", "randn"] },
@@ -299,16 +299,16 @@ export const FUNCTION_META = {
"random_uniform": { minArgs: 1, maxArgs: 2, signature: "random_uniform(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates uniformly distributed random noise", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "median": "centre of the distribution", "sigma": "half width at half maximum", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "median": "centre of the distribution", "sigma": "half width at half maximum", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randc"] },
"rande": { minArgs: 2, maxArgs: 3, signature: "rande(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates exponentially distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "lambda": "rate; the mean is 1 / lambda", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "lambda": "rate; the mean is 1 / lambda", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["rande"] },
"rande": { minArgs: 2, maxArgs: 3, signature: "rande(seed, rate, [shape])", forms: [["seed", "rate", "[shape]"]], description: "generates exponentially distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "rate": "events per unit; the mean is 1 / rate", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_exponential"] },
"random_exponential": { minArgs: 2, maxArgs: 3, signature: "random_exponential(seed, rate, [shape])", forms: [["seed", "rate", "[shape]"]], description: "generates exponentially distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "rate": "events per unit; the mean is 1 / rate", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "mean": "mean of the underlying normal distribution", "std": "standard deviation of the underlying normal distribution", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "mean": "mean of the underlying normal distribution", "std": "standard deviation of the underlying normal distribution", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "probability": "chance of a 1; a tensor gives one probability per element and sets the shape", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "probability": "chance of a 1; a tensor gives one probability per element and sets the shape", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randb"] },
"randp": { minArgs: 2, maxArgs: 3, signature: "randp(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates Poisson distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "lambda": "expected count; a tensor gives one rate per element and sets the shape", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "lambda": "expected count; a tensor gives one rate per element and sets the shape", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "shape_param": "shape (concentration) k", "scale": "scale theta; the mean is k * theta", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "shape_param": "shape (concentration) k", "scale": "scale theta; the mean is k * theta", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randg"] },
"randp": { minArgs: 2, maxArgs: 3, signature: "randp(seed, rate, [shape])", forms: [["seed", "rate", "[shape]"]], description: "generates Poisson distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "rate": "expected count; a tensor gives one rate per element and sets the shape", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_poisson"] },
"random_poisson": { minArgs: 2, maxArgs: 3, signature: "random_poisson(seed, rate, [shape])", forms: [["seed", "rate", "[shape]"]], description: "generates Poisson distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "rate": "expected count; a tensor gives one rate per element and sets the shape", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randp"] },
"randg": { minArgs: 3, maxArgs: 4, signature: "randg(seed, concentration, scale, [shape])", forms: [["seed", "concentration", "scale", "[shape]"]], description: "generates Gamma distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "concentration": "shape (concentration) k", "scale": "scale theta; the mean is k * theta", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_gamma"] },
"random_gamma": { minArgs: 3, maxArgs: 4, signature: "random_gamma(seed, concentration, scale, [shape])", forms: [["seed", "concentration", "scale", "[shape]"]], description: "generates Gamma distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "concentration": "shape (concentration) k", "scale": "scale theta; the mean is k * theta", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "alpha": "first concentration", "beta": "second concentration", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "alpha": "first concentration", "beta": "second concentration", "shape": "output shape as a list (default: the shape of the node's input)"}, 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: "", params: {"seed": "random seed; the same seed always gives the same values", "loc": "centre of the distribution", "scale": "spread (diversity)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_laplace"] },