From dfd78490b6410f6e10ec3207bdd954ea58a564a7 Mon Sep 17 00:00:00 2001 From: mcDandy Date: Sat, 17 Oct 2026 22:44:49 +0200 Subject: [PATCH] AI: Update the things which shows you what is in language --- more_math/Parser/MathExpr.g4 | 2 +- more_math/Parser/compile.ps1 | 137 ++++-- more_math/Parser/inbuilt_symbols.py | 644 ++++++++++++++-------------- web/autocomplete.js | 16 +- web/inbuilt_symbols.js | 644 ++++++++++++++-------------- 5 files changed, 762 insertions(+), 681 deletions(-) diff --git a/more_math/Parser/MathExpr.g4 b/more_math/Parser/MathExpr.g4 index a8e639d..61a21b2 100644 --- a/more_math/Parser/MathExpr.g4 +++ b/more_math/Parser/MathExpr.g4 @@ -692,7 +692,7 @@ func2: */ | PUSH LPAREN expr COMMA expr RPAREN # PushFunc /** - get_value(slot) - returns the value at slot from stack + get_value(tensor, position) - reads the value at an N-D position of tensor. Superseded by tensor[position] indexing */ | GET_VALUE LPAREN expr COMMA expr RPAREN # GetValueFunc /** diff --git a/more_math/Parser/compile.ps1 b/more_math/Parser/compile.ps1 index 1b27da9..00da744 100644 --- a/more_math/Parser/compile.ps1 +++ b/more_math/Parser/compile.ps1 @@ -238,32 +238,76 @@ function Get-FunctionDocEntries { $entries.Add([pscustomobject]@{ Token = $m.Groups['token'].Value FirstLine = $lines[0] + Details = @($lines | Select-Object -Skip 1) }) } return $entries } -function Split-ArgSpec { - # Parses a comma-separated arg list like "x, [dims]" or "x, ..." into - # min/max argument counts and display names (brackets/ellipsis stripped). +function Get-ProductionArity { + # Computes argument-count bounds from a call production's argument list, + # e.g. "expr COMMA expr (COMMA expr)?" -> 2..3. A `*`/`+` group makes the + # call variadic. This is what the parser actually accepts. param([string]$ArgsText) - if ([string]::IsNullOrWhiteSpace($ArgsText)) { - return [pscustomobject]@{ Min = 0; Max = 0; Variadic = $false; Display = @() } + $stack = New-Object System.Collections.Generic.List[hashtable] + $stack.Add(@{ Min = 0; Max = 0; Variadic = $false }) + foreach ($m in [regex]::Matches($ArgsText, '\(|\)[?*+]?|\b(?:expr|indexExpr)\b')) { + $t = $m.Value + if ($t -eq '(') { + $stack.Add(@{ Min = 0; Max = 0; Variadic = $false }) + continue + } + $top = $stack[$stack.Count - 1] + if ($t.StartsWith(')')) { + $stack.RemoveAt($stack.Count - 1) + $parent = $stack[$stack.Count - 1] + $q = $t.Substring(1) + if ($q -eq '' -or $q -eq '+') { $parent.Min += $top.Min } + $parent.Max += $top.Max + $parent.Variadic = $parent.Variadic -or $top.Variadic -or $q -eq '*' -or $q -eq '+' + continue + } + $top.Min += 1 + $top.Max += 1 } + $root = $stack[0] + [pscustomobject]@{ MinArgs = $root.Min; MaxArgs = $(if ($root.Variadic) { $null } else { $root.Max }) } +} + +function Get-ProductionArities { + # Maps each function token to the arity of its `TOKEN LPAREN ... RPAREN` production. + param([Parameter(Mandatory)][string]$FuncSection) + + $code = [regex]::Replace($FuncSection, '(?s)/\*.*?\*/', '') + $arities = @{} + foreach ($m in [regex]::Matches($code, '\b([A-Z][A-Z0-9_]*)\s+LPAREN(.*?)\bRPAREN\b')) { + $arities[$m.Groups[1].Value] = Get-ProductionArity -ArgsText $m.Groups[2].Value + } + return $arities +} + +function Split-ArgSpec { + # Parses a documented arg list like "x, [dims]", "r, [g, b]" or + # "tensor, [kernel_sizes...], kernel" into min/max argument counts and + # display names (kept as written, brackets included). Args inside [...] + # are optional; an arg containing "..." makes the call variadic. + param([string]$ArgsText) + $min = 0 $max = 0 $variadic = $false + $depth = 0 $display = New-Object System.Collections.Generic.List[string] foreach ($raw in ($ArgsText -split ',')) { $p = $raw.Trim() if ($p -eq '') { continue } - if ($p -eq '...') { $variadic = $true; [void]$display.Add('...'); continue } - $isOptional = $p.StartsWith('[') -and $p.EndsWith(']') - $clean = $p.Trim('[', ']').Trim() - [void]$display.Add($clean) + $isOptional = $depth -gt 0 -or $p.StartsWith('[') + $depth += ([regex]::Matches($p, '\[')).Count - ([regex]::Matches($p, '\]')).Count + [void]$display.Add($p) + if ($p.Contains('...')) { $variadic = $true; continue } $max++ if (-not $isOptional) { $min++ } } @@ -275,8 +319,8 @@ function ConvertTo-FunctionSignature { # Parses a doc-comment first line such as: # "sum(x, [dims]) - computes the sum of elements of x, ..." # "rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees]) - converts ..." - # into arg-count bounds, display arg names (from the first signature) and - # the trailing description text. + # into the signature text, arg-count bounds, display arg names (from the + # first signature) and the trailing description text. param([Parameter(Mandatory)][string]$Line) $sigMatch = [regex]::Match($Line, '^[a-zA-Z_][a-zA-Z0-9_]*\((?.*?)\)') @@ -293,6 +337,7 @@ function ConvertTo-FunctionSignature { $spec2 = Split-ArgSpec -ArgsText $altMatch.Groups['args'].Value $rest = $rest.Substring($altMatch.Index + $altMatch.Length) } + $signature = $Line.Substring(0, $Line.Length - $rest.Length).Trim() $descMatch = [regex]::Match($rest, '^\s*-\s*(?.*)$') $desc = if ($descMatch.Success) { $descMatch.Groups['desc'].Value.Trim() } else { $rest.Trim() } @@ -307,6 +352,7 @@ function ConvertTo-FunctionSignature { } [pscustomobject]@{ + Signature = $signature MinArgs = $min MaxArgs = if ($variadic) { $null } else { $max } ArgNames = $spec1.Display @@ -346,9 +392,13 @@ $FUNCTIONS = @($functionWords | Sort-Object -Unique -CaseSensitive) $docEntries = Get-FunctionDocEntries -FuncSection $sections.FuncSection $sigByToken = @{} +$detailsByToken = @{} foreach ($e in $docEntries) { $sig = ConvertTo-FunctionSignature -Line $e.FirstLine - if ($sig) { $sigByToken[$e.Token] = $sig } + if ($sig) { + $sigByToken[$e.Token] = $sig + $detailsByToken[$e.Token] = $e.Details -join "`n" + } } $functionTokens = @($functionTokenToWords.psbase.Keys) @@ -357,25 +407,34 @@ if ($undocumented.Count -gt 0) { Write-Warning "No parsable doc comment found for function token(s): $($undocumented -join ', '). They will get placeholder metadata." } +# The grammar production is authoritative for argument counts; the doc +# comment only describes them, so report where the two disagree. +$arityByToken = Get-ProductionArities -FuncSection $sections.FuncSection +function Format-Arity { param($Min, $Max) "$Min..$(if ($null -eq $Max) { 'n' } else { $Max })" } +foreach ($token in $functionTokens) { + $sig = $sigByToken[$token] + $arity = $arityByToken[$token] + if ($sig -and $arity -and ($sig.MinArgs -ne $arity.MinArgs -or $sig.MaxArgs -ne $arity.MaxArgs)) { + Write-Warning "Doc comment for $token ('$($sig.Signature)') documents $(Format-Arity $sig.MinArgs $sig.MaxArgs) args, grammar accepts $(Format-Arity $arity.MinArgs $arity.MaxArgs)." + } +} + $FUNCTION_META = [ordered]@{} foreach ($token in $functionTokens) { $sig = $sigByToken[$token] - foreach ($alias in $functionTokenToWords[$token]) { - if ($sig) { - $snippet = if ($sig.ArgNames.Count -gt 0) { "$alias($($sig.ArgNames -join ', '))" } else { "$alias()" } - $FUNCTION_META[$alias] = [pscustomobject]@{ - MinArgs = $sig.MinArgs - MaxArgs = $sig.MaxArgs - Snippet = $snippet - Description = $sig.Description - } - } else { - $FUNCTION_META[$alias] = [pscustomobject]@{ - MinArgs = 0 - MaxArgs = $null - Snippet = "$alias()" - Description = '' - } + $arity = $arityByToken[$token] + $words = $functionTokenToWords[$token] + foreach ($alias in $words) { + # Show the signature under the spelling being completed (e.g. conv vs convolution). + $signature = if ($sig) { [regex]::Replace($sig.Signature, '(^|/\s*)[a-zA-Z_][a-zA-Z0-9_]*(?=\()', "`${1}$alias") } else { "$alias()" } + $FUNCTION_META[$alias] = [pscustomobject]@{ + MinArgs = if ($arity) { $arity.MinArgs } else { 0 } + MaxArgs = if ($arity) { $arity.MaxArgs } else { $null } + Signature = $signature + Args = if ($sig) { @($sig.ArgNames) } else { @() } + Description = if ($sig) { $sig.Description } else { '' } + Details = if ($sig) { $detailsByToken[$token] } else { '' } + Aliases = @($words | Where-Object { $_ -ne $alias }) } } } @@ -394,16 +453,30 @@ function Set-Utf8NoBom { function ConvertTo-JsString { param([string]$Value) - $escaped = $Value.Replace('\', '\\').Replace('"', '\"') + $escaped = $Value.Replace('\', '\\').Replace('"', '\"').Replace("`n", '\n') return '"' + $escaped + '"' } function ConvertTo-PyString { param([string]$Value) - $escaped = $Value.Replace('\', '\\').Replace("'", "\'") + $escaped = $Value.Replace('\', '\\').Replace("'", "\'").Replace("`n", '\n') return "'" + $escaped + "'" } +function ConvertTo-JsArray { + param([string[]]$Values) + # An empty array arrives as $null after passing through an if-expression. + if (-not $Values) { return '[]' } + return '[' + (@($Values | ForEach-Object { ConvertTo-JsString $_ }) -join ', ') + ']' +} + +function ConvertTo-PyList { + param([string[]]$Values) + # An empty array arrives as $null after passing through an if-expression. + if (-not $Values) { return '[]' } + return '[' + (@($Values | ForEach-Object { ConvertTo-PyString $_ }) -join ', ') + ']' +} + function Write-JsSymbols { param( [string]$Path, @@ -432,7 +505,7 @@ function Write-JsSymbols { foreach ($name in @($FunctionMeta.psbase.Keys)) { $meta = $FunctionMeta[$name] $maxArgsJs = if ($null -eq $meta.MaxArgs) { 'null' } else { $meta.MaxArgs } - [void]$sb.AppendLine(" $(ConvertTo-JsString $name): { minArgs: $($meta.MinArgs), maxArgs: $maxArgsJs, snippet: $(ConvertTo-JsString $meta.Snippet), description: $(ConvertTo-JsString $meta.Description) },") + [void]$sb.AppendLine(" $(ConvertTo-JsString $name): { minArgs: $($meta.MinArgs), maxArgs: $maxArgsJs, signature: $(ConvertTo-JsString $meta.Signature), args: $(ConvertTo-JsArray $meta.Args), description: $(ConvertTo-JsString $meta.Description), details: $(ConvertTo-JsString $meta.Details), aliases: $(ConvertTo-JsArray $meta.Aliases) },") } [void]$sb.AppendLine('};') @@ -464,7 +537,7 @@ function Write-PySymbols { foreach ($name in @($FunctionMeta.psbase.Keys)) { $meta = $FunctionMeta[$name] $maxArgsPy = if ($null -eq $meta.MaxArgs) { 'None' } else { $meta.MaxArgs } - [void]$sb.AppendLine(" $(ConvertTo-PyString $name): {'min_args': $($meta.MinArgs), 'max_args': $maxArgsPy, 'snippet': $(ConvertTo-PyString $meta.Snippet), 'description': $(ConvertTo-PyString $meta.Description)},") + [void]$sb.AppendLine(" $(ConvertTo-PyString $name): {'min_args': $($meta.MinArgs), 'max_args': $maxArgsPy, 'signature': $(ConvertTo-PyString $meta.Signature), 'args': $(ConvertTo-PyList $meta.Args), 'description': $(ConvertTo-PyString $meta.Description), 'details': $(ConvertTo-PyString $meta.Details), 'aliases': $(ConvertTo-PyList $meta.Aliases)},") } [void]$sb.AppendLine('}') diff --git a/more_math/Parser/inbuilt_symbols.py b/more_math/Parser/inbuilt_symbols.py index d2137f8..60fdf14 100644 --- a/more_math/Parser/inbuilt_symbols.py +++ b/more_math/Parser/inbuilt_symbols.py @@ -10,326 +10,326 @@ INBUILT_FUNCTIONS = { } INBUILT_FUNCTION_META = { - 'sin': {'min_args': 1, 'max_args': 1, 'snippet': 'sin(x)', 'description': 'applies sinus function to value or each element of value'}, - 'cos': {'min_args': 1, 'max_args': 1, 'snippet': 'cos(x)', 'description': 'applies cosinus function to value or each element of value'}, - 'tan': {'min_args': 1, 'max_args': 1, 'snippet': 'tan(x)', 'description': 'applies tangents function to value or each element of value'}, - 'asin': {'min_args': 1, 'max_args': 1, 'snippet': 'asin(x)', 'description': 'applies arcus sinus function to value or each element of value'}, - 'acos': {'min_args': 1, 'max_args': 1, 'snippet': 'acos(x)', 'description': 'applies arcus cosinus function to value or each element of value'}, - 'atan': {'min_args': 1, 'max_args': 1, 'snippet': 'atan(x)', 'description': 'applies arcus tangents function to value or each element of value'}, - 'atan2': {'min_args': 2, 'max_args': 2, 'snippet': 'atan2(y, x)', 'description': 'computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant'}, - 'sinh': {'min_args': 1, 'max_args': 1, 'snippet': 'sinh(x)', 'description': 'applies hyperbolic sinus function to value or each element of value'}, - 'cosh': {'min_args': 1, 'max_args': 1, 'snippet': 'cosh(x)', 'description': 'applies hyperbolic cosinus function to value or each element of value'}, - 'tanh': {'min_args': 1, 'max_args': 1, 'snippet': 'tanh(x)', 'description': 'applies hyperbolic tangents function to value or each element of value'}, - 'asinh': {'min_args': 1, 'max_args': 1, 'snippet': 'asinh(x)', 'description': 'applies hyperbolic arcus sinus function to value or each element of value'}, - 'acosh': {'min_args': 1, 'max_args': 1, 'snippet': 'acosh(x)', 'description': 'applies hyperbolic arcus cosinus function to value or each element of value'}, - 'atanh': {'min_args': 1, 'max_args': 1, 'snippet': 'atanh(x)', 'description': 'applies hyperbolic arcus tangents function to value or each element of value'}, - 'abs': {'min_args': 1, 'max_args': 1, 'snippet': 'abs(x)', 'description': 'applies per element absolute value function. Same as |x| for numbers.'}, - 'sqrt': {'min_args': 1, 'max_args': 1, 'snippet': 'sqrt(x)', 'description': 'applies sqere root per element. Negative numbers return NaN (not a number)'}, - 'ln': {'min_args': 1, 'max_args': 1, 'snippet': 'ln(x)', 'description': 'applies natural logarithm to value (per element). Negative numbers return NaN (not a number)'}, - 'log': {'min_args': 1, 'max_args': 1, 'snippet': 'log(x)', 'description': 'applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)'}, - 'log2': {'min_args': 1, 'max_args': 1, 'snippet': 'log2(x)', 'description': 'applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)'}, - 'exp': {'min_args': 1, 'max_args': 1, 'snippet': 'exp(x)', 'description': 'applies e^x to value (per element)'}, - 'log1p': {'min_args': 1, 'max_args': 1, 'snippet': 'log1p(x)', 'description': 'applies ln(1+x) accurately for values near zero'}, - 'expm1': {'min_args': 1, 'max_args': 1, 'snippet': 'expm1(x)', 'description': 'applies exp(x)-1 accurately for values near zero'}, - 'sinc': {'min_args': 1, 'max_args': 1, 'snippet': 'sinc(x)', 'description': 'computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1'}, - 'cbrt': {'min_args': 1, 'max_args': 1, 'snippet': 'cbrt(x)', 'description': 'computes the real cube root of each value, including negative values'}, - 'reciprocal': {'min_args': 1, 'max_args': 1, 'snippet': 'reciprocal(x)', 'description': 'computes 1/x element-wise'}, - 'logaddexp': {'min_args': 2, 'max_args': 2, 'snippet': 'logaddexp(x, y)', 'description': 'computes log(exp(x) + exp(y)) element-wise using a numerically stable method'}, - 'logsumexp': {'min_args': 1, 'max_args': 2, 'snippet': 'logsumexp(x, dims)', 'description': 'computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions'}, - 'norm': {'min_args': 1, 'max_args': 3, 'snippet': 'norm(x, p, dims)', 'description': 'computes the p-norm globally or along one or more dimensions (default p=2)'}, - 'normalize': {'min_args': 1, 'max_args': 4, 'snippet': 'normalize(x, p, dim, eps)', 'description': 'normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)'}, - 'group_norm': {'min_args': 2, 'max_args': 5, 'snippet': 'group_norm(x, groups, weight, bias, eps)', 'description': 'applies channel-first GroupNorm to [N, C, ...] input'}, - 'outer': {'min_args': 2, 'max_args': 2, 'snippet': 'outer(x, y)', 'description': 'computes the outer product of flattened x and y'}, - 'trace': {'min_args': 1, 'max_args': 1, 'snippet': 'trace(x)', 'description': 'sums the main diagonal of each square matrix in x'}, - 'det': {'min_args': 1, 'max_args': 1, 'snippet': 'det(x)', 'description': 'computes the determinant of each square matrix in x'}, - 'rfft': {'min_args': 1, 'max_args': 2, 'snippet': 'rfft(x, dim)', 'description': 'computes the one-dimensional real-input FFT along dim (default: last dimension)'}, - 'irfft': {'min_args': 1, 'max_args': 3, 'snippet': 'irfft(x, n, dim)', 'description': 'computes the inverse one-dimensional real FFT along dim (default: last dimension)'}, - 'isnan': {'min_args': 1, 'max_args': 1, 'snippet': 'isnan(x)', 'description': 'returns 1.0 for NaN values and 0.0 otherwise'}, - 'isinf': {'min_args': 1, 'max_args': 1, 'snippet': 'isinf(x)', 'description': 'returns 1.0 for infinite values and 0.0 otherwise'}, - 'isfinite': {'min_args': 1, 'max_args': 1, 'snippet': 'isfinite(x)', 'description': 'returns 1.0 for finite values and 0.0 otherwise'}, - 'smin': {'min_args': 1, 'max_args': None, 'snippet': 'smin(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.'}, - 'smax': {'min_args': 1, 'max_args': None, 'snippet': 'smax(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.'}, - 'tmin': {'min_args': 2, 'max_args': 2, 'snippet': 'tmin(x, y)', 'description': 'elementwise minimum of tensor or list. min(x,y) when inputs are floats'}, - 'tmax': {'min_args': 2, 'max_args': 2, 'snippet': 'tmax(x, y)', 'description': 'elementwise maximum of tensor or list. max(x,y) when inputs are floats'}, - 'tnorm': {'min_args': 1, 'max_args': 2, 'snippet': 'tnorm(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.'}, - 'snorm': {'min_args': 1, 'max_args': 2, 'snippet': 'snorm(x, dim)', 'description': 'frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.'}, - 'floor': {'min_args': 1, 'max_args': 1, 'snippet': 'floor(x)', 'description': 'returns the largest integer less than or equal to x'}, - 'ceil': {'min_args': 1, 'max_args': 1, 'snippet': 'ceil(x)', 'description': 'returns the smallest integer greater than or equal to x'}, - 'round': {'min_args': 1, 'max_args': 1, 'snippet': 'round(x)', 'description': 'rounds x to the nearest integer'}, - 'gamma': {'min_args': 1, 'max_args': 1, 'snippet': 'gamma(x)', 'description': 'computes the gamma function (per element)'}, - 'pow': {'min_args': 2, 'max_args': 2, 'snippet': 'pow(x, y)', 'description': 'computes x raised to the power of y'}, - 'sigm': {'min_args': 1, 'max_args': 1, 'snippet': 'sigm(x)', 'description': 'applies the sigmoid function: 1 / (1 + exp(-x))'}, - 'clamp': {'min_args': 3, 'max_args': 3, 'snippet': 'clamp(x, min, max)', 'description': 'clamps x between min and max per element'}, - 'fft': {'min_args': 1, 'max_args': 1, 'snippet': 'fft(x)', 'description': 'computes fast Fourier transform of x'}, - 'ifft': {'min_args': 1, 'max_args': 2, 'snippet': 'ifft(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.'}, - 'angle': {'min_args': 1, 'max_args': 1, 'snippet': 'angle(x)', 'description': 'returns the angle of a complex number or vector'}, - 'print': {'min_args': 1, 'max_args': 1, 'snippet': 'print(x)', 'description': 'prints the value of x to the console while passing output unchanged'}, - 'print_shape': {'min_args': 1, 'max_args': 1, 'snippet': 'print_shape(x)', 'description': 'prints the shape of the tensor x'}, - 'pshp': {'min_args': 1, 'max_args': 1, 'snippet': 'pshp(x)', 'description': 'prints the shape of the tensor x'}, - 'nvl': {'min_args': 4, 'max_args': 4, 'snippet': 'nvl(x, nan, pos_inf, neg_inf)', 'description': 'null value replacement - inspired by NVL'}, - 'nan_to_num': {'min_args': 4, 'max_args': 4, 'snippet': 'nan_to_num(x, nan, pos_inf, neg_inf)', 'description': 'null value replacement - inspired by NVL'}, - 'lerp': {'min_args': 3, 'max_args': 3, 'snippet': 'lerp(a, b, t)', 'description': 'linear interpolation between a and b by t per element. t can be float or tensor.'}, - 'slerp': {'min_args': 3, 'max_args': 4, 'snippet': 'slerp(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.'}, - 'step': {'min_args': 2, 'max_args': 2, 'snippet': 'step(x, edge)', 'description': 'returns 0 if x < edge, else 1'}, - 'smoothstep': {'min_args': 3, 'max_args': 3, 'snippet': 'smoothstep(x, edge0, edge1)', 'description': 'smooth interpolation between edge0 and edge1'}, - 'fract': {'min_args': 1, 'max_args': 1, 'snippet': 'fract(x)', 'description': 'returns the fractional part of x: x - floor(x)'}, - 'relu': {'min_args': 1, 'max_args': 1, 'snippet': 'relu(x)', 'description': 'applies rectified linear unit function: max(0, x)'}, - 'softsign': {'min_args': 1, 'max_args': 1, 'snippet': 'softsign(x)', 'description': 'applies x / (1 + abs(x)) element-wise'}, - 'leaky_relu': {'min_args': 1, 'max_args': 2, 'snippet': 'leaky_relu(x, negative_slope)', 'description': 'applies leaky ReLU element-wise; negative_slope defaults to 0.01'}, - 'softplus': {'min_args': 1, 'max_args': 1, 'snippet': 'softplus(x)', 'description': 'applies the softplus function: ln(1 + exp(x))'}, - 'gelu': {'min_args': 1, 'max_args': 1, 'snippet': 'gelu(x)', 'description': 'applies the Gaussian Error Linear Unit (GELU) activation function'}, - 'silu': {'min_args': 1, 'max_args': 1, 'snippet': 'silu(x)', 'description': 'applies the Sigmoid Linear Unit activation element-wise'}, - 'sign': {'min_args': 1, 'max_args': 1, 'snippet': 'sign(x)', 'description': 'returns the sign of x: -1, 0, or 1'}, - 'degrees': {'min_args': 1, 'max_args': 1, 'snippet': 'degrees(x)', 'description': 'converts radians to degrees (per element)'}, - 'radians': {'min_args': 1, 'max_args': 1, 'snippet': 'radians(x)', 'description': 'converts degrees to radians (per element)'}, - 'logical_not': {'min_args': 1, 'max_args': 1, 'snippet': 'logical_not(x)', 'description': 'returns 1.0 where x is zero and 0.0 otherwise'}, - 'logical_and': {'min_args': 2, 'max_args': 2, 'snippet': 'logical_and(x, y)', 'description': 'returns 1.0 if both values are non-zero, else 0.0'}, - 'logical_or': {'min_args': 2, 'max_args': 2, 'snippet': 'logical_or(x, y)', 'description': 'returns 1.0 if either value is non-zero, else 0.0'}, - 'hypot': {'min_args': 2, 'max_args': 2, 'snippet': 'hypot(x, y)', 'description': 'computes the element-wise Euclidean distance from the origin'}, - 'map': {'min_args': 2, 'max_args': 4, 'snippet': 'map(tensor, coord1, coord2, coord3)', 'description': 'samples/remaps input tensor using coordinates'}, - 'ezconvolution': {'min_args': 2, 'max_args': 3, 'snippet': 'ezconvolution(tensor, kernel_sizes..., kernel)', 'description': 'applies convolution with kernel. Attempts to correctly convolve over size dimensions.'}, - 'ezconv': {'min_args': 2, 'max_args': 3, 'snippet': 'ezconv(tensor, kernel_sizes..., kernel)', 'description': 'applies convolution with kernel. Attempts to correctly convolve over size dimensions.'}, - 'convolution': {'min_args': 2, 'max_args': 3, 'snippet': 'convolution(tensor, kernel_sizes..., kernel)', 'description': 'applies convolution with kernel. Expects [batch,channel, ...]'}, - 'conv': {'min_args': 2, 'max_args': 3, 'snippet': 'conv(tensor, kernel_sizes..., kernel)', 'description': 'applies convolution with kernel. Expects [batch,channel, ...]'}, - 'swap': {'min_args': 4, 'max_args': 4, 'snippet': 'swap(x, dim, idx1, idx2)', 'description': 'swaps elements along dim between idx1 and idx2'}, - 'transpose': {'min_args': 3, 'max_args': 3, 'snippet': 'transpose(x, dim0, dim1)', 'description': 'swaps two tensor dimensions'}, - 'swapaxes': {'min_args': 3, 'max_args': 3, 'snippet': 'swapaxes(x, dim0, dim1)', 'description': 'swaps two tensor dimensions'}, - 'permute': {'min_args': 2, 'max_args': 2, 'snippet': 'permute(x, dims)', 'description': 'permutes the dimensions of tensor x according to dims'}, - 'perm': {'min_args': 2, 'max_args': 2, 'snippet': 'perm(x, dims)', 'description': 'permutes the dimensions of tensor x according to dims'}, - 'reshape': {'min_args': 2, 'max_args': 2, 'snippet': 'reshape(x, shape)', 'description': 'reshapes tensor x to the specified shape'}, - 'rshp': {'min_args': 2, 'max_args': 2, 'snippet': 'rshp(x, shape)', 'description': 'reshapes tensor x to the specified shape'}, - 'range': {'min_args': 3, 'max_args': 3, 'snippet': 'range(start, stop, step)', 'description': 'creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.'}, - 'linspace': {'min_args': 3, 'max_args': 3, 'snippet': 'linspace(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.'}, - 'logspace': {'min_args': 4, 'max_args': 4, 'snippet': 'logspace(start, stop, num, base)', 'description': 'creates logarithmically spaced values'}, - 'topk': {'min_args': 2, 'max_args': 3, 'snippet': 'topk(x, k, dim)', 'description': 'returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.'}, - 'botk': {'min_args': 2, 'max_args': 3, 'snippet': 'botk(x, k, dim)', 'description': 'returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.'}, - 'pinv': {'min_args': 1, 'max_args': 1, 'snippet': 'pinv(x)', 'description': 'computes the permutative inverse of a list x (list must have uniqe elements) -- TODO: CHECK --'}, - 'inv': {'min_args': 1, 'max_args': 2, 'snippet': 'inv(x, pseudo)', 'description': 'computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead'}, - 'sum': {'min_args': 1, 'max_args': 2, 'snippet': 'sum(x, dims)', 'description': 'computes the sum of elements of x, optionally along one or more dimensions'}, - 'mean': {'min_args': 1, 'max_args': 2, 'snippet': 'mean(x, dims)', 'description': 'computes the arithmetic mean of elements of x globally or along one or more dimensions'}, - 'std': {'min_args': 1, 'max_args': 2, 'snippet': 'std(x, dims)', 'description': 'computes the sample standard deviation of elements of x globally or along one or more dimensions'}, - 'var': {'min_args': 1, 'max_args': 2, 'snippet': 'var(x, dims)', 'description': 'computes the sample variance of elements of x globally or along one or more dimensions'}, - 'prod': {'min_args': 1, 'max_args': 2, 'snippet': 'prod(x, dims)', 'description': 'computes the product of elements of x globally or along one or more dimensions'}, - 'isclose': {'min_args': 2, 'max_args': 4, 'snippet': 'isclose(a, b, rtol, atol)', 'description': 'elementwise approximate equality test'}, - 'allclose': {'min_args': 2, 'max_args': 4, 'snippet': 'allclose(a, b, rtol, atol)', 'description': 'returns 1.0 if all elements are approximately equal, else 0.0'}, - 'quartile': {'min_args': 2, 'max_args': 3, 'snippet': 'quartile(x, q, dim)', 'description': 'computes the q-th quartile globally or along dim'}, - 'quartil': {'min_args': 2, 'max_args': 3, 'snippet': 'quartil(x, q, dim)', 'description': 'computes the q-th quartile globally or along dim'}, - 'percentile': {'min_args': 2, 'max_args': 3, 'snippet': 'percentile(x, p, dim)', 'description': 'computes the p-th percentile globally or along dim'}, - 'prcnt': {'min_args': 2, 'max_args': 3, 'snippet': 'prcnt(x, p, dim)', 'description': 'computes the p-th percentile globally or along dim'}, - 'quantile': {'min_args': 2, 'max_args': 3, 'snippet': 'quantile(x, q, dim)', 'description': 'computes the q-th quantile globally or along dim'}, - 'dot': {'min_args': 2, 'max_args': 2, 'snippet': 'dot(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.'}, - 'moment': {'min_args': 3, 'max_args': 3, 'snippet': 'moment(x, a, k)', 'description': 'computes the k-th moment of x around a'}, - 'erf': {'min_args': 1, 'max_args': 1, 'snippet': 'erf(x)', 'description': 'computes the error function (torch.erf)'}, - 'erfc': {'min_args': 1, 'max_args': 1, 'snippet': 'erfc(x)', 'description': 'computes the complementary error function (torch.special.erfc)'}, - 'erfinv': {'min_args': 1, 'max_args': 1, 'snippet': 'erfinv(x)', 'description': 'computes the inverse error function (torch.erfinv)'}, - 'any': {'min_args': 1, 'max_args': 1, 'snippet': 'any(x)', 'description': 'returns 1 if any element of x is non-zero otherwise 0'}, - 'all': {'min_args': 1, 'max_args': 1, 'snippet': 'all(x)', 'description': 'returns 1 if all elements of x are non-zero otherwise 0'}, - 'edge': {'min_args': 1, 'max_args': 2, 'snippet': 'edge(x, matrix_size)', 'description': 'detects edges in x. Matrix size denotes the size of edge detection matrix.'}, - 'blur': {'min_args': 2, 'max_args': 3, 'snippet': 'blur(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.'}, - 'gaussian': {'min_args': 2, 'max_args': 3, 'snippet': 'gaussian(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.'}, - 'median': {'min_args': 1, 'max_args': 2, 'snippet': 'median(x, dim)', 'description': 'computes the median globally or along one dimension'}, - 'mode': {'min_args': 1, 'max_args': 2, 'snippet': 'mode(x, dim)', 'description': 'computes the mode globally or along one dimension'}, - 'cumsum': {'min_args': 1, 'max_args': 2, 'snippet': 'cumsum(x, dim)', 'description': 'computes the cumulative sum, defaulting to the first dimension.'}, - 'cumprod': {'min_args': 1, 'max_args': 1, 'snippet': 'cumprod(x)', 'description': 'computes the cumulative product over first dimension.'}, - 'topk_ind': {'min_args': 2, 'max_args': 3, 'snippet': 'topk_ind(x, k, dim)', 'description': 'returns the indices of the k largest elements along dim; dim defaults to the last'}, - 'topk_indices': {'min_args': 2, 'max_args': 3, 'snippet': 'topk_indices(x, k, dim)', 'description': 'returns the indices of the k largest elements along dim; dim defaults to the last'}, - 'botk_ind': {'min_args': 2, 'max_args': 3, 'snippet': 'botk_ind(x, k, dim)', 'description': 'returns the indices of the k smallest elements along dim; dim defaults to the last'}, - 'botk_indices': {'min_args': 2, 'max_args': 3, 'snippet': 'botk_indices(x, k, dim)', 'description': 'returns the indices of the k smallest elements along dim; dim defaults to the last'}, - 'cubic_ease': {'min_args': 3, 'max_args': 3, 'snippet': 'cubic_ease(a, b, t)', 'description': 'cubic ease between a and b'}, - 'cubic': {'min_args': 3, 'max_args': 3, 'snippet': 'cubic(a, b, t)', 'description': 'cubic ease between a and b'}, - 'elastic_ease': {'min_args': 3, 'max_args': 3, 'snippet': 'elastic_ease(a, b, t)', 'description': 'elastic ease between a and b'}, - 'elastic': {'min_args': 3, 'max_args': 3, 'snippet': 'elastic(a, b, t)', 'description': 'elastic ease between a and b'}, - 'sine_ease': {'min_args': 3, 'max_args': 3, 'snippet': 'sine_ease(a, b, t)', 'description': 'sine easing between a and b'}, - 'sine': {'min_args': 3, 'max_args': 3, 'snippet': 'sine(a, b, t)', 'description': 'sine easing between a and b'}, - 'smootherstep': {'min_args': 3, 'max_args': 3, 'snippet': 'smootherstep(x, edge0, edge1)', 'description': 'smoother interpolation between edge0 and edge1'}, - 'dist': {'min_args': 4, 'max_args': 4, 'snippet': 'dist(x1, y1, x2, y2)', 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)'}, - 'distance': {'min_args': 4, 'max_args': 4, 'snippet': 'distance(x1, y1, x2, y2)', 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)'}, - 'remap': {'min_args': 5, 'max_args': 5, 'snippet': 'remap(v, i_min, i_max, o_min, o_max)', 'description': 'remaps values from input range to output range'}, - 'cossim': {'min_args': 2, 'max_args': 2, 'snippet': 'cossim(x, y)', 'description': 'computes the cosine similarity between x and y.'}, - 'cosine_similarity': {'min_args': 2, 'max_args': 2, 'snippet': 'cosine_similarity(x, y)', 'description': 'computes the cosine similarity between x and y.'}, - 'count': {'min_args': 1, 'max_args': 1, 'snippet': 'count(x)', 'description': 'returns the number of elements in x'}, - 'cnt': {'min_args': 1, 'max_args': 1, 'snippet': 'cnt(x)', 'description': 'returns the number of elements in x'}, - 'length': {'min_args': 1, 'max_args': 1, 'snippet': 'length(x)', 'description': 'returns the number of elements in x'}, - 'keys': {'min_args': 1, 'max_args': 1, 'snippet': 'keys(x)', 'description': 'returns a list of dictionary keys in insertion order'}, - 'enable_tracking': {'min_args': 1, 'max_args': 1, 'snippet': 'enable_tracking(d)', 'description': 'enables change tracking for ChangeTrackingDict d (returns d)'}, - 'track_on': {'min_args': 1, 'max_args': 1, 'snippet': 'track_on(d)', 'description': 'enables change tracking for ChangeTrackingDict d (returns d)'}, - 'disable_tracking': {'min_args': 1, 'max_args': 1, 'snippet': 'disable_tracking(d)', 'description': 'disables change tracking for ChangeTrackingDict d (returns d)'}, - 'track_off': {'min_args': 1, 'max_args': 1, 'snippet': 'track_off(d)', 'description': 'disables change tracking for ChangeTrackingDict d (returns d)'}, - 'reset_tracking': {'min_args': 1, 'max_args': 1, 'snippet': 'reset_tracking(d)', 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)'}, - 'track_reset': {'min_args': 1, 'max_args': 1, 'snippet': 'track_reset(d)', 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)'}, - 'get_changed_keys': {'min_args': 1, 'max_args': 1, 'snippet': 'get_changed_keys(d)', 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d'}, - 'changed_keys': {'min_args': 1, 'max_args': 1, 'snippet': 'changed_keys(d)', 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d'}, - 'get_added_keys': {'min_args': 1, 'max_args': 1, 'snippet': 'get_added_keys(d)', 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d'}, - 'added_keys': {'min_args': 1, 'max_args': 1, 'snippet': 'added_keys(d)', 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d'}, - 'get_removed_keys': {'min_args': 1, 'max_args': 1, 'snippet': 'get_removed_keys(d)', 'description': 'returns list of keys that were removed from ChangeTrackingDict d'}, - 'removed_keys': {'min_args': 1, 'max_args': 1, 'snippet': 'removed_keys(d)', 'description': 'returns list of keys that were removed from ChangeTrackingDict d'}, - 'get_unchanged_keys': {'min_args': 1, 'max_args': 1, 'snippet': 'get_unchanged_keys(d)', 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d'}, - 'unchanged_keys': {'min_args': 1, 'max_args': 1, 'snippet': 'unchanged_keys(d)', 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d'}, - 'repeat': {'min_args': 2, 'max_args': 3, 'snippet': 'repeat(x, count, dims)', 'description': 'repeats tensor elements; count may be scalar or per-dim list'}, - 'flatten': {'min_args': 1, 'max_args': 1, 'snippet': 'flatten(x)', 'description': 'flattens tensor into a 1D tensor'}, - 'append': {'min_args': 2, 'max_args': 2, 'snippet': 'append(x, y)', 'description': 'appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)'}, - 'get_value': {'min_args': 1, 'max_args': 1, 'snippet': 'get_value(slot)', 'description': 'returns the value at slot from stack'}, - 'flow_apply': {'min_args': 2, 'max_args': 2, 'snippet': 'flow_apply(image, flow)', 'description': 'applies optical flow to an image'}, - 'batch_shuffle': {'min_args': 2, 'max_args': 2, 'snippet': 'batch_shuffle(x, indices)', 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices'}, - 'shuffle': {'min_args': 2, 'max_args': 2, 'snippet': 'shuffle(x, indices)', 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices'}, - 'select': {'min_args': 2, 'max_args': 2, 'snippet': 'select(x, indices)', 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices'}, - 'motion_mask': {'min_args': 1, 'max_args': 1, 'snippet': 'motion_mask(x)', 'description': 'generates a motion mask from optical flow'}, - 'flow_to_image': {'min_args': 1, 'max_args': 1, 'snippet': 'flow_to_image(x)', 'description': 'converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta.'}, - 'flow_mag': {'min_args': 1, 'max_args': 1, 'snippet': 'flow_mag(x)', 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)'}, - 'flow_magnitude': {'min_args': 1, 'max_args': 1, 'snippet': 'flow_magnitude(x)', 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)'}, - 'flow_ang': {'min_args': 1, 'max_args': 1, 'snippet': 'flow_ang(x)', 'description': 'computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)'}, - 'flow_angle': {'min_args': 1, 'max_args': 1, 'snippet': 'flow_angle(x)', 'description': 'computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)'}, - 'where': {'min_args': 3, 'max_args': 3, 'snippet': 'where(condition, x, y)', 'description': 'returns x if condition is true, else y. Runs per element.'}, - 'histogram': {'min_args': 4, 'max_args': 4, 'snippet': 'histogram(x, bins, min, max)', 'description': 'computes histogram'}, - 'hist': {'min_args': 4, 'max_args': 4, 'snippet': 'hist(x, bins, min, max)', 'description': 'computes histogram'}, - 'overlay': {'min_args': 3, 'max_args': 4, 'snippet': 'overlay(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.'}, - 'pad': {'min_args': 2, 'max_args': 2, 'snippet': 'pad(x, padding)', 'description': 'pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)'}, - 'cross': {'min_args': 2, 'max_args': 2, 'snippet': 'cross(x, y)', 'description': 'computes the cross product of x and y. Last dimension must be 3'}, - 'matmul': {'min_args': 2, 'max_args': 2, 'snippet': 'matmul(x, y)', 'description': 'computes the matrix multiplication of x and y'}, - 'solve': {'min_args': 2, 'max_args': 2, 'snippet': 'solve(A, b)', 'description': 'solves the square linear system A*x=b without explicitly forming A inverse'}, - 'matrix_rank': {'min_args': 1, 'max_args': 2, 'snippet': 'matrix_rank(x, tol)', 'description': 'computes the numerical rank of each matrix using optional absolute tolerance tol'}, - 'rife': {'min_args': 2, 'max_args': 5, 'snippet': 'rife(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'}, - 'bnot': {'min_args': 1, 'max_args': 1, 'snippet': 'bnot(x)', 'description': 'computes the bitwise NOT'}, - 'bitwise_not': {'min_args': 1, 'max_args': 1, 'snippet': 'bitwise_not(x)', 'description': 'computes the bitwise NOT'}, - 'bitcount': {'min_args': 1, 'max_args': 1, 'snippet': 'bitcount(x)', 'description': 'returns the number of set bits'}, - 'popcount': {'min_args': 1, 'max_args': 1, 'snippet': 'popcount(x)', 'description': 'returns the number of set bits'}, - 'popcnt': {'min_args': 1, 'max_args': 1, 'snippet': 'popcnt(x)', 'description': 'returns the number of set bits'}, - 'shape': {'min_args': 1, 'max_args': 1, 'snippet': 'shape(x)', 'description': 'returns the shape of tensor as a list'}, - 'band': {'min_args': 2, 'max_args': 2, 'snippet': 'band(x, y)', 'description': 'computes the element-wise bitwise AND of x and y'}, - 'bitwise_and': {'min_args': 2, 'max_args': 2, 'snippet': 'bitwise_and(x, y)', 'description': 'computes the element-wise bitwise AND of x and y'}, - 'bxor': {'min_args': 2, 'max_args': 2, 'snippet': 'bxor(x, y)', 'description': 'computes the element-wise bitwise XOR of x and y'}, - 'bitwise_xor': {'min_args': 2, 'max_args': 2, 'snippet': 'bitwise_xor(x, y)', 'description': 'computes the element-wise bitwise XOR of x and y'}, - 'bor': {'min_args': 2, 'max_args': 2, 'snippet': 'bor(x, y)', 'description': 'computes the element-wise bitwise OR of x and y'}, - 'bitwise_or': {'min_args': 2, 'max_args': 2, 'snippet': 'bitwise_or(x, y)', 'description': 'computes the element-wise bitwise OR of x and y'}, - 'tensor': {'min_args': 1, 'max_args': 3, 'snippet': 'tensor(shape, value, dtype_template)', 'description': 'creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32'}, - 'zeros': {'min_args': 1, 'max_args': 2, 'snippet': 'zeros(shape, dtype_template)', 'description': 'creates a zero-filled tensor on the current device'}, - 'ones': {'min_args': 1, 'max_args': 2, 'snippet': 'ones(shape, dtype_template)', 'description': 'creates a one-filled tensor on the current device'}, - 'eye': {'min_args': 1, 'max_args': 2, 'snippet': 'eye(n, dtype_template)', 'description': 'creates an n-by-n identity matrix'}, - 'one_hot': {'min_args': 2, 'max_args': 2, 'snippet': 'one_hot(indices, classes)', 'description': 'converts integer class indices to float32 one-hot vectors'}, - 'mse': {'min_args': 2, 'max_args': 3, 'snippet': 'mse(a, b, reduction)', 'description': 'mean squared error; reduction is mean (default), sum, or none'}, - 'mae': {'min_args': 2, 'max_args': 3, 'snippet': 'mae(a, b, reduction)', 'description': 'mean absolute error; reduction is mean (default), sum, or none'}, - 'psnr': {'min_args': 2, 'max_args': 3, 'snippet': 'psnr(a, b, data_range)', 'description': 'peak signal-to-noise ratio in dB; data_range defaults to 1'}, - 'weighted_mean': {'min_args': 2, 'max_args': 3, 'snippet': 'weighted_mean(x, weights, dims)', 'description': 'computes the weighted mean globally or along one or more dimensions'}, - 'huber_loss': {'min_args': 2, 'max_args': 4, 'snippet': 'huber_loss(prediction, target, delta, reduction)', 'description': 'computes Huber loss; delta defaults to 1 and reduction to mean'}, - 'cross_entropy': {'min_args': 2, 'max_args': 4, 'snippet': 'cross_entropy(logits, target, dim, reduction)', 'description': 'computes cross-entropy from class logits and class indices or target probabilities'}, - 'add_key': {'min_args': 3, 'max_args': 3, 'snippet': 'add_key(dict, key, value)', 'description': 'adds or replaces a dictionary entry and returns the updated dictionary'}, - 'remove_key': {'min_args': 2, 'max_args': 2, 'snippet': 'remove_key(dict, key)', 'description': 'removes a dictionary entry and returns the updated dictionary'}, - 'rm_key': {'min_args': 2, 'max_args': 2, 'snippet': 'rm_key(dict, key)', 'description': 'removes a dictionary entry and returns the updated dictionary'}, - 'stack_push': {'min_args': 2, 'max_args': 2, 'snippet': 'stack_push(slot, val)', 'description': 'pushes val onto the end of slot stack'}, - 'stack_pop': {'min_args': 1, 'max_args': 1, 'snippet': 'stack_pop(slot)', 'description': 'removes and returns the last element of slot stack'}, - 'stack_clear': {'min_args': 1, 'max_args': 1, 'snippet': 'stack_clear(slot)', 'description': 'clears the contents of slot stack'}, - 'stack_has': {'min_args': 1, 'max_args': 1, 'snippet': 'stack_has(slot)', 'description': 'returns 1.0 if slot exists in stack and is not empty else returns 0.0'}, - 'stack_get': {'min_args': 1, 'max_args': 1, 'snippet': 'stack_get(slot)', 'description': 'returns the last pushed value in slot without popping it'}, - 'cat': {'min_args': 2, 'max_args': None, 'snippet': 'cat(x, ..., dim)', 'description': 'concatenates one or more tensors along the specified dimension'}, - 'concat': {'min_args': 2, 'max_args': None, 'snippet': 'concat(x, ..., dim)', 'description': 'concatenates one or more tensors along the specified dimension'}, - 'concatenate': {'min_args': 2, 'max_args': None, 'snippet': 'concatenate(x, ..., dim)', 'description': 'concatenates one or more tensors along the specified dimension'}, - 'stack': {'min_args': 1, 'max_args': 2, 'snippet': 'stack(tensors, dim)', 'description': 'stacks a list of tensors along a new dimension'}, - 'nonzero': {'min_args': 1, 'max_args': 1, 'snippet': 'nonzero(x)', 'description': 'returns an N-by-rank tensor of coordinates for nonzero elements'}, - 'int': {'min_args': 1, 'max_args': 1, 'snippet': 'int(x)', 'description': 'casts x to integer'}, - 'float': {'min_args': 1, 'max_args': 1, 'snippet': 'float(x)', 'description': 'casts x to float'}, - 'upper': {'min_args': 1, 'max_args': 1, 'snippet': 'upper(x)', 'description': 'converts string to uppercase'}, - 'lower': {'min_args': 1, 'max_args': 1, 'snippet': 'lower(x)', 'description': 'converts string to lowercase'}, - 'trim': {'min_args': 1, 'max_args': 1, 'snippet': 'trim(x)', 'description': 'removes leading and trailing whitespace from string'}, - 'split': {'min_args': 1, 'max_args': 2, 'snippet': 'split(x, delimiter)', 'description': 'splits string to list of strings based on delimiter. Default is space.'}, - 'join': {'min_args': 1, 'max_args': 2, 'snippet': 'join(x, separator)', 'description': 'joins strings in list using separator. Defalut separator is "". If you want to join tensors use concatinate(...)'}, - 'substring': {'min_args': 2, 'max_args': 3, 'snippet': 'substring(s, start, length)', 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string'}, - 'substr': {'min_args': 2, 'max_args': 3, 'snippet': 'substr(s, start, length)', 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string'}, - 'find': {'min_args': 2, 'max_args': 2, 'snippet': 'find(s, sub)', 'description': 'returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings.'}, - 'replace': {'min_args': 3, 'max_args': 3, 'snippet': 'replace(s, old, new)', 'description': 'replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.'}, - 'dilate': {'min_args': 1, 'max_args': 2, 'snippet': 'dilate(x, kernel)', 'description': 'applies dilation to x. kernel is optional.'}, - 'erode': {'min_args': 1, 'max_args': 2, 'snippet': 'erode(x, kernel)', 'description': 'applies erosion to x. kernel is size of used matrix.'}, - 'morph_open': {'min_args': 1, 'max_args': 2, 'snippet': 'morph_open(x, kernel)', 'description': 'applies morphological opening to x. kernel is size of used matrix.'}, - 'morph_close': {'min_args': 1, 'max_args': 2, 'snippet': 'morph_close(x, kernel)', 'description': 'applies morphological closing to x. kernel is size of used matrix.'}, - 'rgb_to_oklab': {'min_args': 1, 'max_args': 3, 'snippet': 'rgb_to_oklab(r, g, b)', 'description': 'converts RGB to OKLab. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.'}, - 'rgb_to_cielab': {'min_args': 1, 'max_args': 3, 'snippet': 'rgb_to_cielab(r, g, b)', 'description': 'converts RGB to CIELAB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.'}, - 'oklab_to_rgb': {'min_args': 1, 'max_args': 3, 'snippet': 'oklab_to_rgb(oklab)', 'description': 'converts OKLab to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.'}, - 'cielab_to_rgb': {'min_args': 1, 'max_args': 3, 'snippet': 'cielab_to_rgb(cielab)', 'description': 'converts CIELAB to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.'}, - 'rgb_to_hsv': {'min_args': 1, 'max_args': 4, 'snippet': 'rgb_to_hsv(rgb, degrees)', 'description': 'converts RGB to HSV. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting. If degrees is specified and nonzero it returns hue as 0-360 instead of 0-1'}, - 'hsv_to_rgb': {'min_args': 1, 'max_args': 4, 'snippet': 'hsv_to_rgb(hsv, degrees)', 'description': 'converts HSV to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.'}, - 'int_to_rgb': {'min_args': 1, 'max_args': 1, 'snippet': 'int_to_rgb(val)', 'description': 'converts an integer to an RGB color. If input is tensor it stacks the resulting R, G and B tensors using last dimension. If It is list, List of lists is returned and if value, 3 long list is returned.'}, - 'rgb_to_int': {'min_args': 3, 'max_args': 3, 'snippet': 'rgb_to_int(r, g, b)', 'description': 'converts RGB components to an integer It uses last dimension of tensor (or list) as R,G,B if one value. Othervise uses whole thing as channel.'}, - 'interpolate_linear': {'min_args': 2, 'max_args': 2, 'snippet': 'interpolate_linear(x, y)', 'description': 'performs linear interpolation on X. Assumes that dim 0 is batch and dim 1 = channel'}, - 'interpolate_area': {'min_args': 2, 'max_args': 2, 'snippet': 'interpolate_area(x, y)', 'description': 'performs area interpolation X. Assumes that dim 0 is batch and dim 1 = channel'}, - 'interpolate_nearest': {'min_args': 2, 'max_args': 2, 'snippet': 'interpolate_nearest(x, y)', 'description': 'performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel'}, - 'interpolate_nearest_exact': {'min_args': 2, 'max_args': 2, 'snippet': 'interpolate_nearest_exact(x, y)', 'description': 'performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel'}, - 'text_image': {'min_args': 3, 'max_args': 9, 'snippet': 'text_image(text, font, size, max_width, weight, rotation_angle, line_spacing, italic, underline)', 'description': 'renders text to an 2D tensor'}, - 'as_nested_tensor': {'min_args': 1, 'max_args': 1, 'snippet': 'as_nested_tensor(x)', 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)'}, - 'as_nested': {'min_args': 1, 'max_args': 1, 'snippet': 'as_nested(x)', 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)'}, - 'svd': {'min_args': 1, 'max_args': 2, 'snippet': 'svd(x, full_matrices)', 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)'}, - 'singular_value_decomposition': {'min_args': 1, 'max_args': 2, 'snippet': 'singular_value_decomposition(x, full_matrices)', 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)'}, - 'diagonal_matrix': {'min_args': 2, 'max_args': 5, 'snippet': 'diagonal_matrix(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.'}, - 'diag': {'min_args': 2, 'max_args': 5, 'snippet': 'diag(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.'}, - 'timestamp': {'min_args': 0, 'max_args': 0, 'snippet': 'timestamp()', 'description': 'returns the current system timestamp'}, - 'now': {'min_args': 0, 'max_args': 0, 'snippet': 'now()', 'description': 'returns the current system timestamp'}, - 'sort': {'min_args': 1, 'max_args': 3, 'snippet': 'sort(x, desc, dim)', 'description': 'returns a sorted version of x (If input is tensor, it sorts the last dimension)'}, - 'argsort': {'min_args': 1, 'max_args': 3, 'snippet': 'argsort(x, desc, dim)', 'description': 'returns the indices that would sort x. desc defaults to ascending and dim defaults to the last dimension.'}, - 'argmin': {'min_args': 1, 'max_args': 3, 'snippet': 'argmin(x, as_position, dim)', 'description': 'returns the minimum index globally or along dim; as_position returns global coordinates'}, - 'argmax': {'min_args': 1, 'max_args': 3, 'snippet': 'argmax(x, as_position, dim)', 'description': 'returns the maximum index globally or along dim; as_position returns global coordinates'}, - 'softmax': {'min_args': 1, 'max_args': 2, 'snippet': 'softmax(x, axis)', 'description': 'applies the softmax function to x (sum of slice == 1.0 and max value <= 1.0). axis defaults to last.'}, - 'softmin': {'min_args': 1, 'max_args': 2, 'snippet': 'softmin(x, axis)', 'description': 'applies the softmin function to x (same as softmax(-x,[axis])). axis defaults to last.'}, - 'unique': {'min_args': 1, 'max_args': 1, 'snippet': 'unique(x)', 'description': 'returns the unique elements (sorted, flatened)'}, - 'flip': {'min_args': 2, 'max_args': 2, 'snippet': 'flip(x, dims)', 'description': 'reverses the order of elements along the specified dimensions. Works also for text and list with dims=0'}, - 'startswith': {'min_args': 2, 'max_args': 2, 'snippet': 'startswith(text, prefix)', 'description': 'returns 1 if text starts with prefix, else 0'}, - 'endswith': {'min_args': 2, 'max_args': 2, 'snippet': 'endswith(text, suffix)', 'description': 'returns 1 if text ends with suffix, else 0'}, - 'squeeze': {'min_args': 1, 'max_args': 2, 'snippet': 'squeeze(x, dim)', 'description': 'removes size-1 dimensions from tensor x, optionally at dim'}, - 'unsqueeze': {'min_args': 2, 'max_args': 2, 'snippet': 'unsqueeze(x, dim)', 'description': 'inserts a size-1 dimension into tensor x at dim'}, - 'roll': {'min_args': 2, 'max_args': 3, 'snippet': 'roll(x, shifts, axis)', 'description': 'rolls tensor x along axis'}, - 'cov': {'min_args': 2, 'max_args': 2, 'snippet': 'cov(x, y)', 'description': 'computes the covariance matrix of x and y'}, - 'corr': {'min_args': 2, 'max_args': 2, 'snippet': 'corr(x, y)', 'description': 'computes the correlation between x and y'}, - 'correlation': {'min_args': 2, 'max_args': 2, 'snippet': 'correlation(x, y)', 'description': 'computes the correlation between x and y'}, - 'entropy': {'min_args': 1, 'max_args': 1, 'snippet': 'entropy(x)', 'description': 'computes shanon entropy'}, - 'crop': {'min_args': 3, 'max_args': 3, 'snippet': 'crop(x, start, size)', 'description': 'crops tensor x. Take size and begin at start. start should be the low corner. The result is at most size (if size is bigger then rest of tensor).'}, - 'coords': {'min_args': 2, 'max_args': 3, 'snippet': 'coords(shape, dim, dtype)', 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor.'}, - 'coordinates': {'min_args': 2, 'max_args': 3, 'snippet': 'coordinates(shape, dim, dtype)', 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor.'}, - 'gather': {'min_args': 3, 'max_args': 3, 'snippet': 'gather(x, dim, idx)', 'description': 'gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.'}, - 'scatter': {'min_args': 4, 'max_args': 4, 'snippet': 'scatter(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.'}, - 'scatter_add': {'min_args': 4, 'max_args': 4, 'snippet': 'scatter_add(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.'}, - 'noise': {'min_args': 1, 'max_args': 2, 'snippet': 'noise(seed, shape)', 'description': 'generates normally distributed random noise'}, - 'randn': {'min_args': 1, 'max_args': 2, 'snippet': 'randn(seed, shape)', 'description': 'generates normally distributed random noise'}, - 'random_normal': {'min_args': 1, 'max_args': 2, 'snippet': 'random_normal(seed, shape)', 'description': 'generates normally distributed random noise'}, - 'pink_noise': {'min_args': 1, 'max_args': 2, 'snippet': 'pink_noise(seed, shape)', 'description': 'generates deterministic pink noise (approximately 1/f power spectrum), normalised per row'}, - 'pink': {'min_args': 1, 'max_args': 2, 'snippet': 'pink(seed, shape)', 'description': 'generates deterministic pink noise (approximately 1/f power spectrum), normalised per row'}, - 'brown_noise': {'min_args': 1, 'max_args': 2, 'snippet': 'brown_noise(seed, shape)', 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row'}, - 'brown': {'min_args': 1, 'max_args': 2, 'snippet': 'brown(seed, shape)', 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row'}, - 'rand': {'min_args': 1, 'max_args': 2, 'snippet': 'rand(seed, shape)', 'description': 'generates uniformly distributed random noise'}, - 'randu': {'min_args': 1, 'max_args': 2, 'snippet': 'randu(seed, shape)', 'description': 'generates uniformly distributed random noise'}, - 'random_uniform': {'min_args': 1, 'max_args': 2, 'snippet': 'random_uniform(seed, shape)', 'description': 'generates uniformly distributed random noise'}, - 'randc': {'min_args': 3, 'max_args': 4, 'snippet': 'randc(seed, median, sigma, shape)', 'description': 'generates Cauchy distributed random values.'}, - 'random_cauchy': {'min_args': 3, 'max_args': 4, 'snippet': 'random_cauchy(seed, median, sigma, shape)', 'description': 'generates Cauchy distributed random values.'}, - 'rande': {'min_args': 2, 'max_args': 3, 'snippet': 'rande(seed, lambda, shape)', 'description': 'generates exponentially distributed random values'}, - 'random_exponential': {'min_args': 2, 'max_args': 3, 'snippet': 'random_exponential(seed, lambda, shape)', 'description': 'generates exponentially distributed random values'}, - 'randln': {'min_args': 3, 'max_args': 4, 'snippet': 'randln(seed, mean, std, shape)', 'description': 'generates log-normally distributed random values.'}, - 'random_log_normal': {'min_args': 3, 'max_args': 4, 'snippet': 'random_log_normal(seed, mean, std, shape)', 'description': 'generates log-normally distributed random values.'}, - 'randb': {'min_args': 2, 'max_args': 3, 'snippet': 'randb(seed, probability, shape)', 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor'}, - 'random_bernoulli': {'min_args': 2, 'max_args': 3, 'snippet': 'random_bernoulli(seed, probability, shape)', 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor'}, - 'randp': {'min_args': 2, 'max_args': 3, 'snippet': 'randp(seed, lambda, shape)', 'description': 'generates Poisson distributed random values.'}, - 'random_poisson': {'min_args': 2, 'max_args': 3, 'snippet': 'random_poisson(seed, lambda, shape)', 'description': 'generates Poisson distributed random values.'}, - 'randg': {'min_args': 3, 'max_args': 4, 'snippet': 'randg(seed, shape_param, scale, shape)', 'description': 'generates Gamma distributed random values.'}, - 'random_gamma': {'min_args': 3, 'max_args': 4, 'snippet': 'random_gamma(seed, shape_param, scale, shape)', 'description': 'generates Gamma distributed random values.'}, - 'randbeta': {'min_args': 3, 'max_args': 4, 'snippet': 'randbeta(seed, alpha, beta, shape)', 'description': 'generates Beta distributed random values'}, - 'random_beta': {'min_args': 3, 'max_args': 4, 'snippet': 'random_beta(seed, alpha, beta, shape)', 'description': 'generates Beta distributed random values'}, - 'randl': {'min_args': 3, 'max_args': 4, 'snippet': 'randl(seed, loc, scale, shape)', 'description': 'generates Laplace distributed random values'}, - 'random_laplace': {'min_args': 3, 'max_args': 4, 'snippet': 'random_laplace(seed, loc, scale, shape)', 'description': 'generates Laplace distributed random values'}, - 'randgumbel': {'min_args': 3, 'max_args': 4, 'snippet': 'randgumbel(seed, loc, scale, shape)', 'description': 'generates Gumbel distributed random values'}, - 'random_gumbel': {'min_args': 3, 'max_args': 4, 'snippet': 'random_gumbel(seed, loc, scale, shape)', 'description': 'generates Gumbel distributed random values'}, - 'randw': {'min_args': 3, 'max_args': 4, 'snippet': 'randw(seed, scale, concentration, shape)', 'description': 'generates Weibull distributed random values'}, - 'random_weibull': {'min_args': 3, 'max_args': 4, 'snippet': 'random_weibull(seed, scale, concentration, shape)', 'description': 'generates Weibull distributed random values'}, - 'randchi2': {'min_args': 2, 'max_args': 3, 'snippet': 'randchi2(seed, df, shape)', 'description': 'generates Chi-squared distributed random values'}, - 'random_chi2': {'min_args': 2, 'max_args': 3, 'snippet': 'random_chi2(seed, df, shape)', 'description': 'generates Chi-squared distributed random values'}, - 'randt': {'min_args': 2, 'max_args': 3, 'snippet': 'randt(seed, df, shape)', 'description': 'generates Student-t distributed random values'}, - 'random_studentt': {'min_args': 2, 'max_args': 3, 'snippet': 'random_studentt(seed, df, shape)', 'description': 'generates Student-t distributed random values'}, - 'perlin': {'min_args': 2, 'max_args': 5, 'snippet': 'perlin(seed, scale, octaves, offset, shape)', 'description': 'generates Perlin noise'}, - 'perlin_noise': {'min_args': 2, 'max_args': 5, 'snippet': 'perlin_noise(seed, scale, octaves, offset, shape)', 'description': 'generates Perlin noise'}, - 'cellular': {'min_args': 2, 'max_args': 5, 'snippet': 'cellular(seed, scale, jitter, offset, shape)', 'description': 'generates Cellular/Voronoi noise'}, - 'voronoi': {'min_args': 2, 'max_args': 5, 'snippet': 'voronoi(seed, scale, jitter, offset, shape)', 'description': 'generates Cellular/Voronoi noise'}, - 'worley': {'min_args': 2, 'max_args': 5, 'snippet': 'worley(seed, scale, jitter, offset, shape)', 'description': 'generates Cellular/Voronoi noise'}, - 'cellular_noise': {'min_args': 2, 'max_args': 5, 'snippet': 'cellular_noise(seed, scale, jitter, offset, shape)', 'description': 'generates Cellular/Voronoi noise'}, - 'voronoi_noise': {'min_args': 2, 'max_args': 5, 'snippet': 'voronoi_noise(seed, scale, jitter, offset, shape)', 'description': 'generates Cellular/Voronoi noise'}, - 'plasma': {'min_args': 2, 'max_args': 5, 'snippet': 'plasma(seed, scale, octaves, offset, shape)', 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4'}, - 'turbulence': {'min_args': 2, 'max_args': 5, 'snippet': 'turbulence(seed, scale, octaves, offset, shape)', 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4'}, - 'plasma_noise': {'min_args': 2, 'max_args': 5, 'snippet': 'plasma_noise(seed, scale, octaves, offset, shape)', 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4'}, - 'ridged': {'min_args': 2, 'max_args': 5, 'snippet': 'ridged(seed, scale, octaves, offset, shape)', 'description': 'generates ridged multi-fractal noise'}, - 'ridged_noise': {'min_args': 2, 'max_args': 5, 'snippet': 'ridged_noise(seed, scale, octaves, offset, shape)', 'description': 'generates ridged multi-fractal noise'}, - 'domain_warp': {'min_args': 4, 'max_args': 8, 'snippet': 'domain_warp(seed, scale, warp_scale, warp_strength, octaves, warp_octaves, offset, shape)', 'description': 'generates domain warped noise'}, - 'domain_warp_noise': {'min_args': 4, 'max_args': 8, 'snippet': 'domain_warp_noise(seed, scale, warp_scale, warp_strength, octaves, warp_octaves, offset, shape)', 'description': 'generates domain warped noise'}, + 'sin': {'min_args': 1, 'max_args': 1, 'signature': 'sin(x)', 'args': ['x'], 'description': 'applies sinus function to value or each element of value', 'details': '', 'aliases': []}, + 'cos': {'min_args': 1, 'max_args': 1, 'signature': 'cos(x)', 'args': ['x'], 'description': 'applies cosinus function to value or each element of value', 'details': '', 'aliases': []}, + 'tan': {'min_args': 1, 'max_args': 1, 'signature': 'tan(x)', 'args': ['x'], 'description': 'applies tangents function to value or each element of value', 'details': '', 'aliases': []}, + 'asin': {'min_args': 1, 'max_args': 1, 'signature': 'asin(x)', 'args': ['x'], 'description': 'applies arcus sinus function to value or each element of value', 'details': '', 'aliases': []}, + 'acos': {'min_args': 1, 'max_args': 1, 'signature': 'acos(x)', 'args': ['x'], 'description': 'applies arcus cosinus function to value or each element of value', 'details': '', 'aliases': []}, + 'atan': {'min_args': 1, 'max_args': 1, 'signature': 'atan(x)', 'args': ['x'], 'description': 'applies arcus tangents function to value or each element of value', 'details': '', 'aliases': []}, + 'atan2': {'min_args': 2, 'max_args': 2, 'signature': 'atan2(y, x)', 'args': ['y', 'x'], 'description': 'computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant', 'details': '', 'aliases': []}, + 'sinh': {'min_args': 1, 'max_args': 1, 'signature': 'sinh(x)', 'args': ['x'], 'description': 'applies hyperbolic sinus function to value or each element of value', 'details': '', 'aliases': []}, + 'cosh': {'min_args': 1, 'max_args': 1, 'signature': 'cosh(x)', 'args': ['x'], 'description': 'applies hyperbolic cosinus function to value or each element of value', 'details': '', 'aliases': []}, + 'tanh': {'min_args': 1, 'max_args': 1, 'signature': 'tanh(x)', 'args': ['x'], 'description': 'applies hyperbolic tangents function to value or each element of value', 'details': '', 'aliases': []}, + 'asinh': {'min_args': 1, 'max_args': 1, 'signature': 'asinh(x)', 'args': ['x'], 'description': 'applies hyperbolic arcus sinus function to value or each element of value', 'details': '', 'aliases': []}, + 'acosh': {'min_args': 1, 'max_args': 1, 'signature': 'acosh(x)', 'args': ['x'], 'description': 'applies hyperbolic arcus cosinus function to value or each element of value', 'details': '', 'aliases': []}, + 'atanh': {'min_args': 1, 'max_args': 1, 'signature': 'atanh(x)', 'args': ['x'], 'description': 'applies hyperbolic arcus tangents function to value or each element of value', 'details': '', 'aliases': []}, + 'abs': {'min_args': 1, 'max_args': 1, 'signature': 'abs(x)', 'args': ['x'], 'description': 'applies per element absolute value function. Same as |x| for numbers.', 'details': '', 'aliases': []}, + 'sqrt': {'min_args': 1, 'max_args': 1, 'signature': 'sqrt(x)', 'args': ['x'], 'description': 'applies sqere root per element. Negative numbers return NaN (not a number)', 'details': '', 'aliases': []}, + 'ln': {'min_args': 1, 'max_args': 1, 'signature': 'ln(x)', 'args': ['x'], 'description': 'applies natural logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []}, + 'log': {'min_args': 1, 'max_args': 1, 'signature': 'log(x)', 'args': ['x'], 'description': 'applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []}, + 'log2': {'min_args': 1, 'max_args': 1, 'signature': 'log2(x)', 'args': ['x'], 'description': 'applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []}, + 'exp': {'min_args': 1, 'max_args': 1, 'signature': 'exp(x)', 'args': ['x'], 'description': 'applies e^x to value (per element)', 'details': '', 'aliases': []}, + 'log1p': {'min_args': 1, 'max_args': 1, 'signature': 'log1p(x)', 'args': ['x'], 'description': 'applies ln(1+x) accurately for values near zero', 'details': '', 'aliases': []}, + 'expm1': {'min_args': 1, 'max_args': 1, 'signature': 'expm1(x)', 'args': ['x'], 'description': 'applies exp(x)-1 accurately for values near zero', 'details': '', 'aliases': []}, + 'sinc': {'min_args': 1, 'max_args': 1, 'signature': 'sinc(x)', 'args': ['x'], 'description': 'computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1', 'details': '', 'aliases': []}, + 'cbrt': {'min_args': 1, 'max_args': 1, 'signature': 'cbrt(x)', 'args': ['x'], 'description': 'computes the real cube root of each value, including negative values', 'details': '', 'aliases': []}, + 'reciprocal': {'min_args': 1, 'max_args': 1, 'signature': 'reciprocal(x)', 'args': ['x'], 'description': 'computes 1/x element-wise', 'details': '', 'aliases': []}, + 'logaddexp': {'min_args': 2, 'max_args': 2, 'signature': 'logaddexp(x, y)', 'args': ['x', 'y'], 'description': 'computes log(exp(x) + exp(y)) element-wise using a numerically stable method', 'details': '', 'aliases': []}, + 'logsumexp': {'min_args': 1, 'max_args': 2, 'signature': 'logsumexp(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions', 'details': '', 'aliases': []}, + 'norm': {'min_args': 1, 'max_args': 3, 'signature': 'norm(x, [p], [dims])', 'args': ['x', '[p]', '[dims]'], 'description': 'computes the p-norm globally or along one or more dimensions (default p=2)', 'details': '', 'aliases': []}, + 'normalize': {'min_args': 1, 'max_args': 4, 'signature': 'normalize(x, [p], [dim], [eps])', 'args': ['x', '[p]', '[dim]', '[eps]'], 'description': 'normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)', 'details': '', 'aliases': []}, + 'group_norm': {'min_args': 2, 'max_args': 5, 'signature': 'group_norm(x, groups, [weight], [bias], [eps])', 'args': ['x', 'groups', '[weight]', '[bias]', '[eps]'], 'description': 'applies channel-first GroupNorm to [N, C, ...] input', 'details': '', 'aliases': []}, + 'outer': {'min_args': 2, 'max_args': 2, 'signature': 'outer(x, y)', 'args': ['x', 'y'], 'description': 'computes the outer product of flattened x and y', 'details': '', 'aliases': []}, + 'trace': {'min_args': 1, 'max_args': 1, 'signature': 'trace(x)', 'args': ['x'], 'description': 'sums the main diagonal of each square matrix in x', 'details': '', 'aliases': []}, + 'det': {'min_args': 1, 'max_args': 1, 'signature': 'det(x)', 'args': ['x'], 'description': 'computes the determinant of each square matrix in x', 'details': '', 'aliases': []}, + 'rfft': {'min_args': 1, 'max_args': 2, 'signature': 'rfft(x, [dim])', 'args': ['x', '[dim]'], 'description': 'computes the one-dimensional real-input FFT along dim (default: last dimension)', 'details': '', 'aliases': []}, + 'irfft': {'min_args': 1, 'max_args': 3, 'signature': 'irfft(x, [n], [dim])', 'args': ['x', '[n]', '[dim]'], 'description': 'computes the inverse one-dimensional real FFT along dim (default: last dimension)', 'details': '', 'aliases': []}, + 'isnan': {'min_args': 1, 'max_args': 1, 'signature': 'isnan(x)', 'args': ['x'], 'description': 'returns 1.0 for NaN values and 0.0 otherwise', 'details': '', 'aliases': []}, + 'isinf': {'min_args': 1, 'max_args': 1, 'signature': 'isinf(x)', 'args': ['x'], 'description': 'returns 1.0 for infinite values and 0.0 otherwise', 'details': '', 'aliases': []}, + 'isfinite': {'min_args': 1, 'max_args': 1, 'signature': 'isfinite(x)', 'args': ['x'], 'description': 'returns 1.0 for finite values and 0.0 otherwise', 'details': '', 'aliases': []}, + 'smin': {'min_args': 1, 'max_args': None, 'signature': 'smin(x, ...)', 'args': ['x', '...'], 'description': 'computes the minimum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smin(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.', 'details': '', 'aliases': []}, + 'smax': {'min_args': 1, 'max_args': None, 'signature': 'smax(x, ...)', 'args': ['x', '...'], 'description': 'computes the maximum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smax(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.', 'details': '', 'aliases': []}, + 'tmin': {'min_args': 2, 'max_args': 2, 'signature': 'tmin(x, y)', 'args': ['x', 'y'], 'description': 'elementwise minimum of tensor or list. min(x,y) when inputs are floats', 'details': '', 'aliases': []}, + 'tmax': {'min_args': 2, 'max_args': 2, 'signature': 'tmax(x,y)', 'args': ['x', 'y'], 'description': 'elementwise maximum of tensor or list. max(x,y) when inputs are floats', 'details': '', 'aliases': []}, + 'tnorm': {'min_args': 1, 'max_args': 2, 'signature': 'tnorm(x, [dim])', 'args': ['x', '[dim]'], 'description': 'normalises tensor or list by multiplication such that sum(x^2)==1.0 for each slice. Defaults to the last dimension; dim selects a different slicing dimension.', 'details': '', 'aliases': []}, + 'snorm': {'min_args': 1, 'max_args': 2, 'signature': 'snorm(x,[dim])', 'args': ['x', '[dim]'], 'description': 'frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.', 'details': '', 'aliases': []}, + 'floor': {'min_args': 1, 'max_args': 1, 'signature': 'floor(x)', 'args': ['x'], 'description': 'returns the largest integer less than or equal to x', 'details': '', 'aliases': []}, + 'ceil': {'min_args': 1, 'max_args': 1, 'signature': 'ceil(x)', 'args': ['x'], 'description': 'returns the smallest integer greater than or equal to x', 'details': '', 'aliases': []}, + 'round': {'min_args': 1, 'max_args': 1, 'signature': 'round(x)', 'args': ['x'], 'description': 'rounds x to the nearest integer', 'details': '', 'aliases': []}, + 'gamma': {'min_args': 1, 'max_args': 1, 'signature': 'gamma(x)', 'args': ['x'], 'description': 'computes the gamma function (per element)', 'details': '', 'aliases': []}, + 'pow': {'min_args': 2, 'max_args': 2, 'signature': 'pow(x, y)', 'args': ['x', 'y'], 'description': 'computes x raised to the power of y', 'details': '', 'aliases': []}, + 'sigm': {'min_args': 1, 'max_args': 1, 'signature': 'sigm(x)', 'args': ['x'], 'description': 'applies the sigmoid function: 1 / (1 + exp(-x))', 'details': '', 'aliases': []}, + 'clamp': {'min_args': 3, 'max_args': 3, 'signature': 'clamp(x, min, max)', 'args': ['x', 'min', 'max'], 'description': 'clamps x between min and max per element', 'details': '', 'aliases': []}, + 'fft': {'min_args': 1, 'max_args': 1, 'signature': 'fft(x)', 'args': ['x'], 'description': 'computes fast Fourier transform of x', 'details': '', 'aliases': []}, + 'ifft': {'min_args': 1, 'max_args': 2, 'signature': 'ifft(x, [shape])', 'args': ['x', '[shape]'], 'description': 'inverse fast Fourier transform of x. shape (defaults to the node\'s tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.', 'details': '', 'aliases': []}, + 'angle': {'min_args': 1, 'max_args': 1, 'signature': 'angle(x)', 'args': ['x'], 'description': 'returns the angle of a complex number or vector', 'details': '', 'aliases': []}, + 'print': {'min_args': 1, 'max_args': 1, 'signature': 'print(x)', 'args': ['x'], 'description': 'prints the value of x to the console while passing output unchanged', 'details': '', 'aliases': []}, + 'print_shape': {'min_args': 1, 'max_args': 1, 'signature': 'print_shape(x)', 'args': ['x'], 'description': 'prints the shape of the tensor x', 'details': '', 'aliases': ['pshp']}, + 'pshp': {'min_args': 1, 'max_args': 1, 'signature': 'pshp(x)', 'args': ['x'], 'description': 'prints the shape of the tensor x', 'details': '', 'aliases': ['print_shape']}, + 'nvl': {'min_args': 4, 'max_args': 4, 'signature': 'nvl(x, nan, pos_inf, neg_inf)', 'args': ['x', 'nan', 'pos_inf', 'neg_inf'], 'description': 'null value replacement - inspired by NVL', 'details': '', 'aliases': ['nan_to_num']}, + 'nan_to_num': {'min_args': 4, 'max_args': 4, 'signature': 'nan_to_num(x, nan, pos_inf, neg_inf)', 'args': ['x', 'nan', 'pos_inf', 'neg_inf'], 'description': 'null value replacement - inspired by NVL', 'details': '', 'aliases': ['nvl']}, + 'lerp': {'min_args': 3, 'max_args': 3, 'signature': 'lerp(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'linear interpolation between a and b by t per element. t can be float or tensor.', 'details': '', 'aliases': []}, + 'slerp': {'min_args': 3, 'max_args': 4, 'signature': 'slerp(a, b, t, [dim])', 'args': ['a', 'b', 't', '[dim]'], 'description': 'interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.', 'details': '', 'aliases': []}, + 'step': {'min_args': 2, 'max_args': 2, 'signature': 'step(x, edge)', 'args': ['x', 'edge'], 'description': 'returns 0 if x < edge, else 1', 'details': '', 'aliases': []}, + 'smoothstep': {'min_args': 3, 'max_args': 3, 'signature': 'smoothstep(x, edge0, edge1)', 'args': ['x', 'edge0', 'edge1'], 'description': 'smooth interpolation between edge0 and edge1', 'details': '', 'aliases': []}, + 'fract': {'min_args': 1, 'max_args': 1, 'signature': 'fract(x)', 'args': ['x'], 'description': 'returns the fractional part of x: x - floor(x)', 'details': '', 'aliases': []}, + 'relu': {'min_args': 1, 'max_args': 1, 'signature': 'relu(x)', 'args': ['x'], 'description': 'applies rectified linear unit function: max(0, x)', 'details': '', 'aliases': []}, + 'softsign': {'min_args': 1, 'max_args': 1, 'signature': 'softsign(x)', 'args': ['x'], 'description': 'applies x / (1 + abs(x)) element-wise', 'details': '', 'aliases': []}, + 'leaky_relu': {'min_args': 1, 'max_args': 2, 'signature': 'leaky_relu(x, [negative_slope])', 'args': ['x', '[negative_slope]'], 'description': 'applies leaky ReLU element-wise; negative_slope defaults to 0.01', 'details': '', 'aliases': []}, + 'softplus': {'min_args': 1, 'max_args': 1, 'signature': 'softplus(x)', 'args': ['x'], 'description': 'applies the softplus function: ln(1 + exp(x))', 'details': '', 'aliases': []}, + 'gelu': {'min_args': 1, 'max_args': 1, 'signature': 'gelu(x)', 'args': ['x'], 'description': 'applies the Gaussian Error Linear Unit (GELU) activation function', 'details': '', 'aliases': []}, + 'silu': {'min_args': 1, 'max_args': 1, 'signature': 'silu(x)', 'args': ['x'], 'description': 'applies the Sigmoid Linear Unit activation element-wise', 'details': '', 'aliases': []}, + 'sign': {'min_args': 1, 'max_args': 1, 'signature': 'sign(x)', 'args': ['x'], 'description': 'returns the sign of x: -1, 0, or 1', 'details': '', 'aliases': []}, + 'degrees': {'min_args': 1, 'max_args': 1, 'signature': 'degrees(x)', 'args': ['x'], 'description': 'converts radians to degrees (per element)', 'details': '', 'aliases': []}, + 'radians': {'min_args': 1, 'max_args': 1, 'signature': 'radians(x)', 'args': ['x'], 'description': 'converts degrees to radians (per element)', 'details': '', 'aliases': []}, + 'logical_not': {'min_args': 1, 'max_args': 1, 'signature': 'logical_not(x)', 'args': ['x'], 'description': 'returns 1.0 where x is zero and 0.0 otherwise', 'details': '', 'aliases': []}, + 'logical_and': {'min_args': 2, 'max_args': 2, 'signature': 'logical_and(x, y)', 'args': ['x', 'y'], 'description': 'returns 1.0 if both values are non-zero, else 0.0', 'details': '', 'aliases': []}, + 'logical_or': {'min_args': 2, 'max_args': 2, 'signature': 'logical_or(x, y)', 'args': ['x', 'y'], 'description': 'returns 1.0 if either value is non-zero, else 0.0', 'details': '', 'aliases': []}, + 'hypot': {'min_args': 2, 'max_args': 2, 'signature': 'hypot(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise Euclidean distance from the origin', 'details': '', 'aliases': []}, + 'map': {'min_args': 2, 'max_args': 4, 'signature': 'map(tensor, coord1, [coord2], [coord3])', 'args': ['tensor', 'coord1', '[coord2]', '[coord3]'], 'description': 'samples/remaps input tensor using coordinates', 'details': '', 'aliases': []}, + 'ezconvolution': {'min_args': 2, 'max_args': None, 'signature': 'ezconvolution(tensor, [kernel_sizes...], kernel)', 'args': ['tensor', '[kernel_sizes...]', 'kernel'], 'description': 'applies convolution with kernel. Attempts to correctly convolve over size dimensions.', 'details': '', 'aliases': ['ezconv']}, + 'ezconv': {'min_args': 2, 'max_args': None, 'signature': 'ezconv(tensor, [kernel_sizes...], kernel)', 'args': ['tensor', '[kernel_sizes...]', 'kernel'], 'description': 'applies convolution with kernel. Attempts to correctly convolve over size dimensions.', 'details': '', 'aliases': ['ezconvolution']}, + 'convolution': {'min_args': 2, 'max_args': None, 'signature': 'convolution(tensor, [kernel_sizes...], kernel)', 'args': ['tensor', '[kernel_sizes...]', 'kernel'], 'description': 'applies convolution with kernel. Expects [batch,channel, ...]', 'details': '', 'aliases': ['conv']}, + 'conv': {'min_args': 2, 'max_args': None, 'signature': 'conv(tensor, [kernel_sizes...], kernel)', 'args': ['tensor', '[kernel_sizes...]', 'kernel'], 'description': 'applies convolution with kernel. Expects [batch,channel, ...]', 'details': '', 'aliases': ['convolution']}, + 'swap': {'min_args': 4, 'max_args': 4, 'signature': 'swap(x, dim, idx1, idx2)', 'args': ['x', 'dim', 'idx1', 'idx2'], 'description': 'swaps elements along dim between idx1 and idx2', 'details': '', 'aliases': []}, + 'transpose': {'min_args': 3, 'max_args': 3, 'signature': 'transpose(x, dim0, dim1) / transpose(x, dim0, dim1)', 'args': ['x', 'dim0', 'dim1'], 'description': 'swaps two tensor dimensions', 'details': '', 'aliases': ['swapaxes']}, + 'swapaxes': {'min_args': 3, 'max_args': 3, 'signature': 'swapaxes(x, dim0, dim1) / swapaxes(x, dim0, dim1)', 'args': ['x', 'dim0', 'dim1'], 'description': 'swaps two tensor dimensions', 'details': '', 'aliases': ['transpose']}, + 'permute': {'min_args': 2, 'max_args': 2, 'signature': 'permute(x, dims)', 'args': ['x', 'dims'], 'description': 'permutes the dimensions of tensor x according to dims', 'details': '', 'aliases': ['perm']}, + 'perm': {'min_args': 2, 'max_args': 2, 'signature': 'perm(x, dims)', 'args': ['x', 'dims'], 'description': 'permutes the dimensions of tensor x according to dims', 'details': '', 'aliases': ['permute']}, + 'reshape': {'min_args': 2, 'max_args': 2, 'signature': 'reshape(x, shape)', 'args': ['x', 'shape'], 'description': 'reshapes tensor x to the specified shape', 'details': '', 'aliases': ['rshp']}, + 'rshp': {'min_args': 2, 'max_args': 2, 'signature': 'rshp(x, shape)', 'args': ['x', 'shape'], 'description': 'reshapes tensor x to the specified shape', 'details': '', 'aliases': ['reshape']}, + 'range': {'min_args': 3, 'max_args': 3, 'signature': 'range(start, stop, step)', 'args': ['start', 'stop', 'step'], 'description': 'creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.', 'details': '', 'aliases': []}, + 'linspace': {'min_args': 3, 'max_args': 3, 'signature': 'linspace(start, stop, num)', 'args': ['start', 'stop', 'num'], 'description': 'creates num linearly spaced values from start to stop (inclusive). Use range if you want to control the step between values.', 'details': '', 'aliases': []}, + 'logspace': {'min_args': 4, 'max_args': 4, 'signature': 'logspace(start, stop, num, base)', 'args': ['start', 'stop', 'num', 'base'], 'description': 'creates logarithmically spaced values', 'details': '', 'aliases': []}, + 'topk': {'min_args': 2, 'max_args': 3, 'signature': 'topk(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.', 'details': '', 'aliases': []}, + 'botk': {'min_args': 2, 'max_args': 3, 'signature': 'botk(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.', 'details': '', 'aliases': []}, + 'pinv': {'min_args': 1, 'max_args': 1, 'signature': 'pinv(x)', 'args': ['x'], 'description': 'computes the permutative inverse of a list x (list must have uniqe elements) -- TODO: CHECK --', 'details': '', 'aliases': []}, + 'inv': {'min_args': 1, 'max_args': 2, 'signature': 'inv(x, [pseudo])', 'args': ['x', '[pseudo]'], 'description': 'computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead', 'details': '', 'aliases': []}, + 'sum': {'min_args': 1, 'max_args': 2, 'signature': 'sum(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes the sum of elements of x, optionally along one or more dimensions', 'details': '', 'aliases': []}, + 'mean': {'min_args': 1, 'max_args': 2, 'signature': 'mean(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes the arithmetic mean of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []}, + 'std': {'min_args': 1, 'max_args': 2, 'signature': 'std(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes the sample standard deviation of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []}, + 'var': {'min_args': 1, 'max_args': 2, 'signature': 'var(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes the sample variance of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []}, + 'prod': {'min_args': 1, 'max_args': 2, 'signature': 'prod(x, [dims])', 'args': ['x', '[dims]'], 'description': 'computes the product of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []}, + 'isclose': {'min_args': 2, 'max_args': 4, 'signature': 'isclose(a, b, [rtol], [atol])', 'args': ['a', 'b', '[rtol]', '[atol]'], 'description': 'elementwise approximate equality test', 'details': '', 'aliases': []}, + 'allclose': {'min_args': 2, 'max_args': 4, 'signature': 'allclose(a, b, [rtol], [atol])', 'args': ['a', 'b', '[rtol]', '[atol]'], 'description': 'returns 1.0 if all elements are approximately equal, else 0.0', 'details': '', 'aliases': []}, + 'quartile': {'min_args': 2, 'max_args': 3, 'signature': 'quartile(x, q, [dim])', 'args': ['x', 'q', '[dim]'], 'description': 'computes the q-th quartile globally or along dim', 'details': '', 'aliases': ['quartil']}, + 'quartil': {'min_args': 2, 'max_args': 3, 'signature': 'quartil(x, q, [dim])', 'args': ['x', 'q', '[dim]'], 'description': 'computes the q-th quartile globally or along dim', 'details': '', 'aliases': ['quartile']}, + 'percentile': {'min_args': 2, 'max_args': 3, 'signature': 'percentile(x, p, [dim])', 'args': ['x', 'p', '[dim]'], 'description': 'computes the p-th percentile globally or along dim', 'details': '', 'aliases': ['prcnt']}, + 'prcnt': {'min_args': 2, 'max_args': 3, 'signature': 'prcnt(x, p, [dim])', 'args': ['x', 'p', '[dim]'], 'description': 'computes the p-th percentile globally or along dim', 'details': '', 'aliases': ['percentile']}, + 'quantile': {'min_args': 2, 'max_args': 3, 'signature': 'quantile(x, q, [dim])', 'args': ['x', 'q', '[dim]'], 'description': 'computes the q-th quantile globally or along dim', 'details': '', 'aliases': []}, + 'dot': {'min_args': 2, 'max_args': 2, 'signature': 'dot(x, y)', 'args': ['x', 'y'], 'description': 'computes the dot product of x and y after flattening both to 1D. Use cross(x, y) if you need a per-vector product with the last dimension kept.', 'details': '', 'aliases': []}, + 'moment': {'min_args': 3, 'max_args': 3, 'signature': 'moment(x, a, k)', 'args': ['x', 'a', 'k'], 'description': 'computes the k-th moment of x around a', 'details': '', 'aliases': []}, + 'erf': {'min_args': 1, 'max_args': 1, 'signature': 'erf(x)', 'args': ['x'], 'description': 'computes the error function (torch.erf)', 'details': '', 'aliases': []}, + 'erfc': {'min_args': 1, 'max_args': 1, 'signature': 'erfc(x)', 'args': ['x'], 'description': 'computes the complementary error function (torch.special.erfc)', 'details': '', 'aliases': []}, + 'erfinv': {'min_args': 1, 'max_args': 1, 'signature': 'erfinv(x)', 'args': ['x'], 'description': 'computes the inverse error function (torch.erfinv)', 'details': '', 'aliases': []}, + 'any': {'min_args': 1, 'max_args': 1, 'signature': 'any(x)', 'args': ['x'], 'description': 'returns 1 if any element of x is non-zero otherwise 0', 'details': '', 'aliases': []}, + 'all': {'min_args': 1, 'max_args': 1, 'signature': 'all(x)', 'args': ['x'], 'description': 'returns 1 if all elements of x are non-zero otherwise 0', 'details': '', 'aliases': []}, + 'edge': {'min_args': 1, 'max_args': 2, 'signature': 'edge(x, [matrix_size])', 'args': ['x', '[matrix_size]'], 'description': 'detects edges in x. Matrix size denotes the size of edge detection matrix.', 'details': '', 'aliases': []}, + 'blur': {'min_args': 2, 'max_args': 3, 'signature': 'blur(x, sigma, [reshape])', 'args': ['x', 'sigma', '[reshape]'], 'description': 'applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.', 'details': '', 'aliases': ['gaussian']}, + 'gaussian': {'min_args': 2, 'max_args': 3, 'signature': 'gaussian(x, sigma, [reshape])', 'args': ['x', 'sigma', '[reshape]'], 'description': 'applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.', 'details': '', 'aliases': ['blur']}, + 'median': {'min_args': 1, 'max_args': 2, 'signature': 'median(x, [dim])', 'args': ['x', '[dim]'], 'description': 'computes the median globally or along one dimension', 'details': '', 'aliases': []}, + 'mode': {'min_args': 1, 'max_args': 2, 'signature': 'mode(x, [dim])', 'args': ['x', '[dim]'], 'description': 'computes the mode globally or along one dimension', 'details': '', 'aliases': []}, + 'cumsum': {'min_args': 1, 'max_args': 2, 'signature': 'cumsum(x, [dim])', 'args': ['x', '[dim]'], 'description': 'computes the cumulative sum, defaulting to the first dimension.', 'details': '', 'aliases': []}, + 'cumprod': {'min_args': 1, 'max_args': 1, 'signature': 'cumprod(x)', 'args': ['x'], 'description': 'computes the cumulative product over first dimension.', 'details': '', 'aliases': []}, + 'topk_ind': {'min_args': 2, 'max_args': 3, 'signature': 'topk_ind(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the indices of the k largest elements along dim; dim defaults to the last', 'details': '', 'aliases': ['topk_indices']}, + 'topk_indices': {'min_args': 2, 'max_args': 3, 'signature': 'topk_indices(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the indices of the k largest elements along dim; dim defaults to the last', 'details': '', 'aliases': ['topk_ind']}, + 'botk_ind': {'min_args': 2, 'max_args': 3, 'signature': 'botk_ind(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the indices of the k smallest elements along dim; dim defaults to the last', 'details': '', 'aliases': ['botk_indices']}, + 'botk_indices': {'min_args': 2, 'max_args': 3, 'signature': 'botk_indices(x, k, [dim])', 'args': ['x', 'k', '[dim]'], 'description': 'returns the indices of the k smallest elements along dim; dim defaults to the last', 'details': '', 'aliases': ['botk_ind']}, + 'cubic_ease': {'min_args': 3, 'max_args': 3, 'signature': 'cubic_ease(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'cubic ease between a and b', 'details': '', 'aliases': ['cubic']}, + 'cubic': {'min_args': 3, 'max_args': 3, 'signature': 'cubic(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'cubic ease between a and b', 'details': '', 'aliases': ['cubic_ease']}, + 'elastic_ease': {'min_args': 3, 'max_args': 3, 'signature': 'elastic_ease(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'elastic ease between a and b', 'details': '', 'aliases': ['elastic']}, + 'elastic': {'min_args': 3, 'max_args': 3, 'signature': 'elastic(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'elastic ease between a and b', 'details': '', 'aliases': ['elastic_ease']}, + 'sine_ease': {'min_args': 3, 'max_args': 3, 'signature': 'sine_ease(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'sine easing between a and b', 'details': '', 'aliases': ['sine']}, + 'sine': {'min_args': 3, 'max_args': 3, 'signature': 'sine(a, b, t)', 'args': ['a', 'b', 't'], 'description': 'sine easing between a and b', 'details': '', 'aliases': ['sine_ease']}, + 'smootherstep': {'min_args': 3, 'max_args': 3, 'signature': 'smootherstep(x, edge0, edge1)', 'args': ['x', 'edge0', 'edge1'], 'description': 'smoother interpolation between edge0 and edge1', 'details': '', 'aliases': []}, + 'dist': {'min_args': 4, 'max_args': 4, 'signature': 'dist(x1, y1, x2, y2)', 'args': ['x1', 'y1', 'x2', 'y2'], 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)', 'details': '', 'aliases': ['distance']}, + 'distance': {'min_args': 4, 'max_args': 4, 'signature': 'distance(x1, y1, x2, y2)', 'args': ['x1', 'y1', 'x2', 'y2'], 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)', 'details': '', 'aliases': ['dist']}, + 'remap': {'min_args': 5, 'max_args': 5, 'signature': 'remap(v, i_min, i_max, o_min, o_max)', 'args': ['v', 'i_min', 'i_max', 'o_min', 'o_max'], 'description': 'remaps values from input range to output range', 'details': '', 'aliases': []}, + 'cossim': {'min_args': 2, 'max_args': 2, 'signature': 'cossim(x, y)', 'args': ['x', 'y'], 'description': 'computes the cosine similarity between x and y.', 'details': '', 'aliases': ['cosine_similarity']}, + 'cosine_similarity': {'min_args': 2, 'max_args': 2, 'signature': 'cosine_similarity(x, y)', 'args': ['x', 'y'], 'description': 'computes the cosine similarity between x and y.', 'details': '', 'aliases': ['cossim']}, + 'count': {'min_args': 1, 'max_args': 1, 'signature': 'count(x)', 'args': ['x'], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['cnt', 'length']}, + 'cnt': {'min_args': 1, 'max_args': 1, 'signature': 'cnt(x)', 'args': ['x'], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['count', 'length']}, + 'length': {'min_args': 1, 'max_args': 1, 'signature': 'length(x)', 'args': ['x'], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['count', 'cnt']}, + 'keys': {'min_args': 1, 'max_args': 1, 'signature': 'keys(x)', 'args': ['x'], 'description': 'returns a list of dictionary keys in insertion order', 'details': '', 'aliases': []}, + 'enable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'enable_tracking(d)', 'args': ['d'], 'description': 'enables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_on']}, + 'track_on': {'min_args': 1, 'max_args': 1, 'signature': 'track_on(d)', 'args': ['d'], 'description': 'enables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['enable_tracking']}, + 'disable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'disable_tracking(d)', 'args': ['d'], 'description': 'disables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_off']}, + 'track_off': {'min_args': 1, 'max_args': 1, 'signature': 'track_off(d)', 'args': ['d'], 'description': 'disables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['disable_tracking']}, + 'reset_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'reset_tracking(d)', 'args': ['d'], 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_reset']}, + 'track_reset': {'min_args': 1, 'max_args': 1, 'signature': 'track_reset(d)', 'args': ['d'], 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['reset_tracking']}, + 'get_changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_changed_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d', 'details': '', 'aliases': ['changed_keys']}, + 'changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'changed_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d', 'details': '', 'aliases': ['get_changed_keys']}, + 'get_added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_added_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d', 'details': '', 'aliases': ['added_keys']}, + 'added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'added_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d', 'details': '', 'aliases': ['get_added_keys']}, + 'get_removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_removed_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were removed from ChangeTrackingDict d', 'details': '', 'aliases': ['removed_keys']}, + 'removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'removed_keys(d)', 'args': ['d'], 'description': 'returns list of keys that were removed from ChangeTrackingDict d', 'details': '', 'aliases': ['get_removed_keys']}, + 'get_unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_unchanged_keys(d)', 'args': ['d'], 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d', 'details': '', 'aliases': ['unchanged_keys']}, + 'unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'unchanged_keys(d)', 'args': ['d'], 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d', 'details': '', 'aliases': ['get_unchanged_keys']}, + 'repeat': {'min_args': 2, 'max_args': 3, 'signature': 'repeat(x, count, [dims])', 'args': ['x', 'count', '[dims]'], 'description': 'repeats tensor elements; count may be scalar or per-dim list', 'details': '', 'aliases': []}, + 'flatten': {'min_args': 1, 'max_args': 1, 'signature': 'flatten(x)', 'args': ['x'], 'description': 'flattens tensor into a 1D tensor', 'details': '', 'aliases': []}, + 'append': {'min_args': 2, 'max_args': 2, 'signature': 'append(x, y)', 'args': ['x', 'y'], 'description': 'appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)', 'details': '', 'aliases': []}, + 'get_value': {'min_args': 2, 'max_args': 2, 'signature': 'get_value(tensor, position)', 'args': ['tensor', 'position'], 'description': 'reads the value at an N-D position of tensor. Superseded by tensor[position] indexing', 'details': '', 'aliases': []}, + 'flow_apply': {'min_args': 2, 'max_args': 2, 'signature': 'flow_apply(image, flow)', 'args': ['image', 'flow'], 'description': 'applies optical flow to an image', 'details': '', 'aliases': []}, + 'batch_shuffle': {'min_args': 2, 'max_args': 2, 'signature': 'batch_shuffle(x, indices)', 'args': ['x', 'indices'], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['shuffle', 'select']}, + 'shuffle': {'min_args': 2, 'max_args': 2, 'signature': 'shuffle(x, indices)', 'args': ['x', 'indices'], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['batch_shuffle', 'select']}, + 'select': {'min_args': 2, 'max_args': 2, 'signature': 'select(x, indices)', 'args': ['x', 'indices'], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['batch_shuffle', 'shuffle']}, + 'motion_mask': {'min_args': 1, 'max_args': 1, 'signature': 'motion_mask(x)', 'args': ['x'], 'description': 'generates a motion mask from optical flow', 'details': '', 'aliases': []}, + 'flow_to_image': {'min_args': 1, 'max_args': 1, 'signature': 'flow_to_image(x)', 'args': ['x'], 'description': 'converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta.', 'details': '', 'aliases': []}, + 'flow_mag': {'min_args': 1, 'max_args': 1, 'signature': 'flow_mag(x)', 'args': ['x'], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'aliases': ['flow_magnitude']}, + 'flow_magnitude': {'min_args': 1, 'max_args': 1, 'signature': 'flow_magnitude(x)', 'args': ['x'], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'aliases': ['flow_mag']}, + 'flow_ang': {'min_args': 1, 'max_args': 1, 'signature': 'flow_ang(x)', 'args': ['x'], 'description': 'computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)', 'details': '', 'aliases': ['flow_angle']}, + 'flow_angle': {'min_args': 1, 'max_args': 1, 'signature': 'flow_angle(x)', 'args': ['x'], 'description': 'computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)', 'details': '', 'aliases': ['flow_ang']}, + 'where': {'min_args': 3, 'max_args': 3, 'signature': 'where(condition, x, y)', 'args': ['condition', 'x', 'y'], 'description': 'returns x if condition is true, else y. Runs per element.', 'details': '', 'aliases': []}, + 'histogram': {'min_args': 4, 'max_args': 4, 'signature': 'histogram(x, bins, min, max)', 'args': ['x', 'bins', 'min', 'max'], 'description': 'computes histogram', 'details': '', 'aliases': ['hist']}, + 'hist': {'min_args': 4, 'max_args': 4, 'signature': 'hist(x, bins, min, max)', 'args': ['x', 'bins', 'min', 'max'], 'description': 'computes histogram', 'details': '', 'aliases': ['histogram']}, + 'overlay': {'min_args': 3, 'max_args': 4, 'signature': 'overlay(base, overlay, offset, [opacity])', 'args': ['base', 'overlay', 'offset', '[opacity]'], 'description': 'overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.', 'details': '', 'aliases': []}, + 'pad': {'min_args': 2, 'max_args': 2, 'signature': 'pad(x, padding)', 'args': ['x', 'padding'], 'description': 'pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)', 'details': '', 'aliases': []}, + 'cross': {'min_args': 2, 'max_args': 2, 'signature': 'cross(x, y)', 'args': ['x', 'y'], 'description': 'computes the cross product of x and y. Last dimension must be 3', 'details': '', 'aliases': []}, + 'matmul': {'min_args': 2, 'max_args': 2, 'signature': 'matmul(x, y)', 'args': ['x', 'y'], 'description': 'computes the matrix multiplication of x and y', 'details': '', 'aliases': []}, + 'solve': {'min_args': 2, 'max_args': 2, 'signature': 'solve(A, b)', 'args': ['A', 'b'], 'description': 'solves the square linear system A*x=b without explicitly forming A inverse', 'details': '', 'aliases': []}, + 'matrix_rank': {'min_args': 1, 'max_args': 2, 'signature': 'matrix_rank(x, [tol])', 'args': ['x', '[tol]'], 'description': 'computes the numerical rank of each matrix using optional absolute tolerance tol', 'details': '', 'aliases': []}, + 'rife': {'min_args': 2, 'max_args': 5, 'signature': 'rife(image1, image2, [tiling_size], [iterations], [multi_scale])', 'args': ['image1', 'image2', '[tiling_size]', '[iterations]', '[multi_scale]'], 'description': 'computes the optical flow field ([H, W, 2]) between image1 and image2 using a RAFT-based model', 'details': '- tiling_size: chuncks image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution\n- iterations: how many times to run the flow model. Default 12\n- multi_scale: also use low resolution of base image for giant movements. Default false', 'aliases': []}, + 'bnot': {'min_args': 1, 'max_args': 1, 'signature': 'bnot(x)', 'args': ['x'], 'description': 'computes the bitwise NOT', 'details': '', 'aliases': ['bitwise_not']}, + 'bitwise_not': {'min_args': 1, 'max_args': 1, 'signature': 'bitwise_not(x)', 'args': ['x'], 'description': 'computes the bitwise NOT', 'details': '', 'aliases': ['bnot']}, + 'bitcount': {'min_args': 1, 'max_args': 1, 'signature': 'bitcount(x)', 'args': ['x'], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['popcount', 'popcnt']}, + 'popcount': {'min_args': 1, 'max_args': 1, 'signature': 'popcount(x)', 'args': ['x'], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['bitcount', 'popcnt']}, + 'popcnt': {'min_args': 1, 'max_args': 1, 'signature': 'popcnt(x)', 'args': ['x'], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['bitcount', 'popcount']}, + 'shape': {'min_args': 1, 'max_args': 1, 'signature': 'shape(x)', 'args': ['x'], 'description': 'returns the shape of tensor as a list', 'details': '', 'aliases': []}, + 'band': {'min_args': 2, 'max_args': 2, 'signature': 'band(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise AND of x and y', 'details': '', 'aliases': ['bitwise_and']}, + 'bitwise_and': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_and(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise AND of x and y', 'details': '', 'aliases': ['band']}, + 'bxor': {'min_args': 2, 'max_args': 2, 'signature': 'bxor(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise XOR of x and y', 'details': '', 'aliases': ['bitwise_xor']}, + 'bitwise_xor': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_xor(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise XOR of x and y', 'details': '', 'aliases': ['bxor']}, + 'bor': {'min_args': 2, 'max_args': 2, 'signature': 'bor(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise OR of x and y', 'details': '', 'aliases': ['bitwise_or']}, + 'bitwise_or': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_or(x, y)', 'args': ['x', 'y'], 'description': 'computes the element-wise bitwise OR of x and y', 'details': '', 'aliases': ['bor']}, + 'tensor': {'min_args': 1, 'max_args': 3, 'signature': 'tensor(shape, [value], [dtype_template])', 'args': ['shape', '[value]', '[dtype_template]'], 'description': 'creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32', 'details': '', 'aliases': []}, + 'zeros': {'min_args': 1, 'max_args': 2, 'signature': 'zeros(shape, [dtype_template])', 'args': ['shape', '[dtype_template]'], 'description': 'creates a zero-filled tensor on the current device', 'details': '', 'aliases': []}, + 'ones': {'min_args': 1, 'max_args': 2, 'signature': 'ones(shape, [dtype_template])', 'args': ['shape', '[dtype_template]'], 'description': 'creates a one-filled tensor on the current device', 'details': '', 'aliases': []}, + 'eye': {'min_args': 1, 'max_args': 2, 'signature': 'eye(n, [dtype_template])', 'args': ['n', '[dtype_template]'], 'description': 'creates an n-by-n identity matrix', 'details': '', 'aliases': []}, + 'one_hot': {'min_args': 2, 'max_args': 2, 'signature': 'one_hot(indices, classes)', 'args': ['indices', 'classes'], 'description': 'converts integer class indices to float32 one-hot vectors', 'details': '', 'aliases': []}, + 'mse': {'min_args': 2, 'max_args': 3, 'signature': 'mse(a, b, [reduction])', 'args': ['a', 'b', '[reduction]'], 'description': 'mean squared error; reduction is mean (default), sum, or none', 'details': '', 'aliases': []}, + 'mae': {'min_args': 2, 'max_args': 3, 'signature': 'mae(a, b, [reduction])', 'args': ['a', 'b', '[reduction]'], 'description': 'mean absolute error; reduction is mean (default), sum, or none', 'details': '', 'aliases': []}, + 'psnr': {'min_args': 2, 'max_args': 3, 'signature': 'psnr(a, b, [data_range])', 'args': ['a', 'b', '[data_range]'], 'description': 'peak signal-to-noise ratio in dB; data_range defaults to 1', 'details': '', 'aliases': []}, + 'weighted_mean': {'min_args': 2, 'max_args': 3, 'signature': 'weighted_mean(x, weights, [dims])', 'args': ['x', 'weights', '[dims]'], 'description': 'computes the weighted mean globally or along one or more dimensions', 'details': '', 'aliases': []}, + 'huber_loss': {'min_args': 2, 'max_args': 4, 'signature': 'huber_loss(prediction, target, [delta], [reduction])', 'args': ['prediction', 'target', '[delta]', '[reduction]'], 'description': 'computes Huber loss; delta defaults to 1 and reduction to mean', 'details': '', 'aliases': []}, + 'cross_entropy': {'min_args': 2, 'max_args': 4, 'signature': 'cross_entropy(logits, target, [dim], [reduction])', 'args': ['logits', 'target', '[dim]', '[reduction]'], 'description': 'computes cross-entropy from class logits and class indices or target probabilities', 'details': '', 'aliases': []}, + 'add_key': {'min_args': 3, 'max_args': 3, 'signature': 'add_key(dict, key, value)', 'args': ['dict', 'key', 'value'], 'description': 'adds or replaces a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': []}, + 'remove_key': {'min_args': 2, 'max_args': 2, 'signature': 'remove_key(dict, key)', 'args': ['dict', 'key'], 'description': 'removes a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': ['rm_key']}, + 'rm_key': {'min_args': 2, 'max_args': 2, 'signature': 'rm_key(dict, key)', 'args': ['dict', 'key'], 'description': 'removes a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': ['remove_key']}, + 'stack_push': {'min_args': 2, 'max_args': 2, 'signature': 'stack_push(slot, val)', 'args': ['slot', 'val'], 'description': 'pushes val onto the end of slot stack', 'details': '', 'aliases': []}, + 'stack_pop': {'min_args': 1, 'max_args': 1, 'signature': 'stack_pop(slot)', 'args': ['slot'], 'description': 'removes and returns the last element of slot stack', 'details': '', 'aliases': []}, + 'stack_clear': {'min_args': 1, 'max_args': 1, 'signature': 'stack_clear(slot)', 'args': ['slot'], 'description': 'clears the contents of slot stack', 'details': '', 'aliases': []}, + 'stack_has': {'min_args': 1, 'max_args': 1, 'signature': 'stack_has(slot)', 'args': ['slot'], 'description': 'returns 1.0 if slot exists in stack and is not empty else returns 0.0', 'details': '', 'aliases': []}, + 'stack_get': {'min_args': 1, 'max_args': 1, 'signature': 'stack_get(slot)', 'args': ['slot'], 'description': 'returns the last pushed value in slot without popping it', 'details': '', 'aliases': []}, + 'cat': {'min_args': 2, 'max_args': None, 'signature': 'cat(x, ..., dim)', 'args': ['x', '...', 'dim'], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['concat', 'concatenate']}, + 'concat': {'min_args': 2, 'max_args': None, 'signature': 'concat(x, ..., dim)', 'args': ['x', '...', 'dim'], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['cat', 'concatenate']}, + 'concatenate': {'min_args': 2, 'max_args': None, 'signature': 'concatenate(x, ..., dim)', 'args': ['x', '...', 'dim'], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['cat', 'concat']}, + 'stack': {'min_args': 1, 'max_args': 2, 'signature': 'stack(tensors, [dim])', 'args': ['tensors', '[dim]'], 'description': 'stacks a list of tensors along a new dimension', 'details': '', 'aliases': []}, + 'nonzero': {'min_args': 1, 'max_args': 1, 'signature': 'nonzero(x)', 'args': ['x'], 'description': 'returns an N-by-rank tensor of coordinates for nonzero elements', 'details': '', 'aliases': []}, + 'int': {'min_args': 1, 'max_args': 1, 'signature': 'int(x)', 'args': ['x'], 'description': 'casts x to integer', 'details': '', 'aliases': []}, + 'float': {'min_args': 1, 'max_args': 1, 'signature': 'float(x)', 'args': ['x'], 'description': 'casts x to float', 'details': '', 'aliases': []}, + 'upper': {'min_args': 1, 'max_args': 1, 'signature': 'upper(x)', 'args': ['x'], 'description': 'converts string to uppercase', 'details': '', 'aliases': []}, + 'lower': {'min_args': 1, 'max_args': 1, 'signature': 'lower(x)', 'args': ['x'], 'description': 'converts string to lowercase', 'details': '', 'aliases': []}, + 'trim': {'min_args': 1, 'max_args': 1, 'signature': 'trim(x)', 'args': ['x'], 'description': 'removes leading and trailing whitespace from string', 'details': '', 'aliases': []}, + 'split': {'min_args': 1, 'max_args': 2, 'signature': 'split(x, [delimiter])', 'args': ['x', '[delimiter]'], 'description': 'splits string to list of strings based on delimiter. Default is space.', 'details': '', 'aliases': []}, + 'join': {'min_args': 1, 'max_args': 2, 'signature': 'join(x, [separator])', 'args': ['x', '[separator]'], 'description': 'joins strings in list using separator. Defalut separator is "". If you want to join tensors use concatinate(...)', 'details': '', 'aliases': []}, + 'substring': {'min_args': 2, 'max_args': 3, 'signature': 'substring(s, start, [length])', 'args': ['s', 'start', '[length]'], 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'aliases': ['substr']}, + 'substr': {'min_args': 2, 'max_args': 3, 'signature': 'substr(s, start, [length])', 'args': ['s', 'start', '[length]'], 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'aliases': ['substring']}, + 'find': {'min_args': 2, 'max_args': 2, 'signature': 'find(s, sub)', 'args': ['s', 'sub'], 'description': 'returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings.', 'details': '', 'aliases': []}, + 'replace': {'min_args': 3, 'max_args': 3, 'signature': 'replace(s, old, new)', 'args': ['s', 'old', 'new'], 'description': 'replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.', 'details': '', 'aliases': []}, + 'dilate': {'min_args': 1, 'max_args': 2, 'signature': 'dilate(x, [kernel])', 'args': ['x', '[kernel]'], 'description': 'applies dilation to x. kernel is optional.', 'details': '', 'aliases': []}, + 'erode': {'min_args': 1, 'max_args': 2, 'signature': 'erode(x, [kernel])', 'args': ['x', '[kernel]'], 'description': 'applies erosion to x. kernel is size of used matrix.', 'details': '', 'aliases': []}, + 'morph_open': {'min_args': 1, 'max_args': 2, 'signature': 'morph_open(x, [kernel])', 'args': ['x', '[kernel]'], 'description': 'applies morphological opening to x. kernel is size of used matrix.', 'details': '', 'aliases': []}, + 'morph_close': {'min_args': 1, 'max_args': 2, 'signature': 'morph_close(x, [kernel])', 'args': ['x', '[kernel]'], 'description': 'applies morphological closing to x. kernel is size of used matrix.', 'details': '', 'aliases': []}, + 'rgb_to_oklab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_oklab(r, [g], [b])', 'args': ['r', '[g]', '[b]'], 'description': 'converts RGB to OKLab. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.', 'details': '', 'aliases': []}, + 'rgb_to_cielab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_cielab(r, [g], [b])', 'args': ['r', '[g]', '[b]'], 'description': 'converts RGB to CIELAB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.', 'details': '', 'aliases': []}, + 'oklab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)', 'args': ['oklab'], 'description': 'converts OKLab to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.', 'details': '', 'aliases': []}, + 'cielab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)', 'args': ['cielab'], 'description': 'converts CIELAB to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.', 'details': '', 'aliases': []}, + 'rgb_to_hsv': {'min_args': 1, 'max_args': 4, 'signature': 'rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees])', 'args': ['rgb', '[degrees]'], 'description': 'converts RGB to HSV. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting. If degrees is specified and nonzero it returns hue as 0-360 instead of 0-1', 'details': '', 'aliases': []}, + 'hsv_to_rgb': {'min_args': 1, 'max_args': 4, 'signature': 'hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees])', 'args': ['hsv', '[degrees]'], 'description': 'converts HSV to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.', 'details': '', 'aliases': []}, + 'int_to_rgb': {'min_args': 1, 'max_args': 1, 'signature': 'int_to_rgb(val)', 'args': ['val'], 'description': 'converts an integer to an RGB color. If input is tensor it stacks the resulting R, G and B tensors using last dimension. If It is list, List of lists is returned and if value, 3 long list is returned.', 'details': '', 'aliases': []}, + 'rgb_to_int': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_int(r, [g, b])', 'args': ['r', '[g', 'b]'], 'description': 'converts RGB components to an integer It uses last dimension of tensor (or list) as R,G,B if one value. Othervise uses whole thing as channel.', 'details': '', 'aliases': []}, + 'interpolate_linear': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_linear(x, y)', 'args': ['x', 'y'], 'description': 'performs linear interpolation on X. Assumes that dim 0 is batch and dim 1 = channel', 'details': '', 'aliases': []}, + 'interpolate_area': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_area(x, y)', 'args': ['x', 'y'], 'description': 'performs area interpolation X. Assumes that dim 0 is batch and dim 1 = channel', 'details': '', 'aliases': []}, + 'interpolate_nearest': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_nearest(x, y)', 'args': ['x', 'y'], 'description': 'performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel', 'details': '', 'aliases': ['interpolate_nearest_exact']}, + 'interpolate_nearest_exact': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_nearest_exact(x, y)', 'args': ['x', 'y'], 'description': 'performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel', 'details': '', 'aliases': ['interpolate_nearest']}, + 'text_image': {'min_args': 3, 'max_args': 9, 'signature': 'text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline])', 'args': ['text', 'font', 'size', '[max_width]', '[weight]', '[rotation_angle]', '[line_spacing]', '[italic]', '[underline]'], 'description': 'renders text to an 2D tensor', 'details': '', 'aliases': []}, + 'as_nested_tensor': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested_tensor(x)', 'args': ['x'], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'aliases': ['as_nested']}, + 'as_nested': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested(x)', 'args': ['x'], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'aliases': ['as_nested_tensor']}, + 'svd': {'min_args': 1, 'max_args': 2, 'signature': 'svd(x, [full_matrices])', 'args': ['x', '[full_matrices]'], 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)', 'details': '', 'aliases': ['singular_value_decomposition']}, + 'singular_value_decomposition': {'min_args': 1, 'max_args': 2, 'signature': 'singular_value_decomposition(x, [full_matrices])', 'args': ['x', '[full_matrices]'], 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)', 'details': '', 'aliases': ['svd']}, + 'diagonal_matrix': {'min_args': 2, 'max_args': 5, 'signature': 'diagonal_matrix(x, shape, [offset], [dim1], [dim2])', 'args': ['x', 'shape', '[offset]', '[dim1]', '[dim2]'], 'description': 'creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.', 'details': '', 'aliases': ['diag']}, + 'diag': {'min_args': 2, 'max_args': 5, 'signature': 'diag(x, shape, [offset], [dim1], [dim2])', 'args': ['x', 'shape', '[offset]', '[dim1]', '[dim2]'], 'description': 'creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.', 'details': '', 'aliases': ['diagonal_matrix']}, + 'timestamp': {'min_args': 0, 'max_args': 0, 'signature': 'timestamp()', 'args': [], 'description': 'returns the current system timestamp', 'details': '', 'aliases': ['now']}, + 'now': {'min_args': 0, 'max_args': 0, 'signature': 'now()', 'args': [], 'description': 'returns the current system timestamp', 'details': '', 'aliases': ['timestamp']}, + 'sort': {'min_args': 1, 'max_args': 3, 'signature': 'sort(x, [desc], [dim])', 'args': ['x', '[desc]', '[dim]'], 'description': 'returns a sorted version of x (If input is tensor, it sorts the last dimension)', 'details': '', 'aliases': []}, + 'argsort': {'min_args': 1, 'max_args': 3, 'signature': 'argsort(x, [desc], [dim])', 'args': ['x', '[desc]', '[dim]'], 'description': 'returns the indices that would sort x. desc defaults to ascending and dim defaults to the last dimension.', 'details': '', 'aliases': []}, + 'argmin': {'min_args': 1, 'max_args': 3, 'signature': 'argmin(x, [as_position], [dim])', 'args': ['x', '[as_position]', '[dim]'], 'description': 'returns the minimum index globally or along dim; as_position returns global coordinates', 'details': '', 'aliases': []}, + 'argmax': {'min_args': 1, 'max_args': 3, 'signature': 'argmax(x, [as_position], [dim])', 'args': ['x', '[as_position]', '[dim]'], 'description': 'returns the maximum index globally or along dim; as_position returns global coordinates', 'details': '', 'aliases': []}, + 'softmax': {'min_args': 1, 'max_args': 2, 'signature': 'softmax(x, [axis])', 'args': ['x', '[axis]'], 'description': 'applies the softmax function to x (sum of slice == 1.0 and max value <= 1.0). axis defaults to last.', 'details': '', 'aliases': []}, + 'softmin': {'min_args': 1, 'max_args': 2, 'signature': 'softmin(x, [axis])', 'args': ['x', '[axis]'], 'description': 'applies the softmin function to x (same as softmax(-x,[axis])). axis defaults to last.', 'details': '', 'aliases': []}, + 'unique': {'min_args': 1, 'max_args': 1, 'signature': 'unique(x)', 'args': ['x'], 'description': 'returns the unique elements (sorted, flatened)', 'details': '', 'aliases': []}, + 'flip': {'min_args': 2, 'max_args': 2, 'signature': 'flip(x, dims)', 'args': ['x', 'dims'], 'description': 'reverses the order of elements along the specified dimensions. Works also for text and list with dims=0', 'details': '', 'aliases': []}, + 'startswith': {'min_args': 2, 'max_args': 2, 'signature': 'startswith(text, prefix)', 'args': ['text', 'prefix'], 'description': 'returns 1 if text starts with prefix, else 0', 'details': '', 'aliases': []}, + 'endswith': {'min_args': 2, 'max_args': 2, 'signature': 'endswith(text, suffix)', 'args': ['text', 'suffix'], 'description': 'returns 1 if text ends with suffix, else 0', 'details': '', 'aliases': []}, + 'squeeze': {'min_args': 1, 'max_args': 2, 'signature': 'squeeze(x, [dim])', 'args': ['x', '[dim]'], 'description': 'removes size-1 dimensions from tensor x, optionally at dim', 'details': '', 'aliases': []}, + 'unsqueeze': {'min_args': 2, 'max_args': 2, 'signature': 'unsqueeze(x, dim)', 'args': ['x', 'dim'], 'description': 'inserts a size-1 dimension into tensor x at dim', 'details': '', 'aliases': []}, + 'roll': {'min_args': 2, 'max_args': 3, 'signature': 'roll(x, shifts, [axis])', 'args': ['x', 'shifts', '[axis]'], 'description': 'rolls tensor x along axis', 'details': '', 'aliases': []}, + 'cov': {'min_args': 2, 'max_args': 2, 'signature': 'cov(x, y)', 'args': ['x', 'y'], 'description': 'computes the covariance matrix of x and y', 'details': '', 'aliases': []}, + 'corr': {'min_args': 2, 'max_args': 2, 'signature': 'corr(x, y)', 'args': ['x', 'y'], 'description': 'computes the correlation between x and y', 'details': '', 'aliases': ['correlation']}, + 'correlation': {'min_args': 2, 'max_args': 2, 'signature': 'correlation(x, y)', 'args': ['x', 'y'], 'description': 'computes the correlation between x and y', 'details': '', 'aliases': ['corr']}, + 'entropy': {'min_args': 1, 'max_args': 1, 'signature': 'entropy(x)', 'args': ['x'], 'description': 'computes shanon entropy', 'details': '', 'aliases': []}, + 'crop': {'min_args': 3, 'max_args': 3, 'signature': 'crop(x, start, size)', 'args': ['x', 'start', 'size'], 'description': 'crops tensor x. Take size and begin at start. start should be the low corner. The result is at most size (if size is bigger then rest of tensor).', 'details': '', 'aliases': []}, + 'coords': {'min_args': 2, 'max_args': 3, 'signature': 'coords(shape, dim, [dtype])', 'args': ['shape', 'dim', '[dtype]'], 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor.', 'details': '', 'aliases': ['coordinates']}, + 'coordinates': {'min_args': 2, 'max_args': 3, 'signature': 'coordinates(shape, dim, [dtype])', 'args': ['shape', 'dim', '[dtype]'], 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor.', 'details': '', 'aliases': ['coords']}, + 'gather': {'min_args': 3, 'max_args': 3, 'signature': 'gather(x, dim, idx)', 'args': ['x', 'dim', 'idx'], 'description': 'gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.', 'details': '', 'aliases': []}, + 'scatter': {'min_args': 4, 'max_args': 4, 'signature': 'scatter(x, dim, idx, src)', 'args': ['x', 'dim', 'idx', 'src'], 'description': 'scatters elements from src into x along dim using the indices specified in idx. The output tensor has the same shape as x.', 'details': '', 'aliases': []}, + 'scatter_add': {'min_args': 4, 'max_args': 4, 'signature': 'scatter_add(x, dim, idx, src)', 'args': ['x', 'dim', 'idx', 'src'], 'description': 'scatters elements from src into x along dim using the indices specified in idx, adding to existing values. The output tensor has the same shape as x.', 'details': '', 'aliases': []}, + 'noise': {'min_args': 1, 'max_args': 2, 'signature': 'noise(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['randn', 'random_normal']}, + 'randn': {'min_args': 1, 'max_args': 2, 'signature': 'randn(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['noise', 'random_normal']}, + 'random_normal': {'min_args': 1, 'max_args': 2, 'signature': 'random_normal(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['noise', 'randn']}, + 'pink_noise': {'min_args': 1, 'max_args': 2, 'signature': 'pink_noise(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates deterministic pink noise (approximately 1/f power spectrum), normalised per row', 'details': '', 'aliases': ['pink']}, + 'pink': {'min_args': 1, 'max_args': 2, 'signature': 'pink(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates deterministic pink noise (approximately 1/f power spectrum), normalised per row', 'details': '', 'aliases': ['pink_noise']}, + 'brown_noise': {'min_args': 1, 'max_args': 2, 'signature': 'brown_noise(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row', 'details': '', 'aliases': ['brown']}, + 'brown': {'min_args': 1, 'max_args': 2, 'signature': 'brown(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row', 'details': '', 'aliases': ['brown_noise']}, + 'rand': {'min_args': 1, 'max_args': 2, 'signature': 'rand(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['randu', 'random_uniform']}, + 'randu': {'min_args': 1, 'max_args': 2, 'signature': 'randu(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['rand', 'random_uniform']}, + 'random_uniform': {'min_args': 1, 'max_args': 2, 'signature': 'random_uniform(seed, [shape])', 'args': ['seed', '[shape]'], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['rand', 'randu']}, + 'randc': {'min_args': 3, 'max_args': 4, 'signature': 'randc(seed, median, sigma, [shape])', 'args': ['seed', 'median', 'sigma', '[shape]'], 'description': 'generates Cauchy distributed random values.', 'details': '', 'aliases': ['random_cauchy']}, + 'random_cauchy': {'min_args': 3, 'max_args': 4, 'signature': 'random_cauchy(seed, median, sigma, [shape])', 'args': ['seed', 'median', 'sigma', '[shape]'], 'description': 'generates Cauchy distributed random values.', 'details': '', 'aliases': ['randc']}, + 'rande': {'min_args': 2, 'max_args': 3, 'signature': 'rande(seed, lambda, [shape])', 'args': ['seed', 'lambda', '[shape]'], 'description': 'generates exponentially distributed random values', 'details': '', 'aliases': ['random_exponential']}, + 'random_exponential': {'min_args': 2, 'max_args': 3, 'signature': 'random_exponential(seed, lambda, [shape])', 'args': ['seed', 'lambda', '[shape]'], 'description': 'generates exponentially distributed random values', 'details': '', 'aliases': ['rande']}, + 'randln': {'min_args': 3, 'max_args': 4, 'signature': 'randln(seed, mean, std, [shape])', 'args': ['seed', 'mean', 'std', '[shape]'], 'description': 'generates log-normally distributed random values.', 'details': '', 'aliases': ['random_log_normal']}, + 'random_log_normal': {'min_args': 3, 'max_args': 4, 'signature': 'random_log_normal(seed, mean, std, [shape])', 'args': ['seed', 'mean', 'std', '[shape]'], 'description': 'generates log-normally distributed random values.', 'details': '', 'aliases': ['randln']}, + 'randb': {'min_args': 2, 'max_args': 3, 'signature': 'randb(seed, probability, [shape])', 'args': ['seed', 'probability', '[shape]'], 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor', 'details': '', 'aliases': ['random_bernoulli']}, + 'random_bernoulli': {'min_args': 2, 'max_args': 3, 'signature': 'random_bernoulli(seed, probability, [shape])', 'args': ['seed', 'probability', '[shape]'], 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor', 'details': '', 'aliases': ['randb']}, + 'randp': {'min_args': 2, 'max_args': 3, 'signature': 'randp(seed, lambda, [shape])', 'args': ['seed', 'lambda', '[shape]'], 'description': 'generates Poisson distributed random values.', 'details': '', 'aliases': ['random_poisson']}, + 'random_poisson': {'min_args': 2, 'max_args': 3, 'signature': 'random_poisson(seed, lambda, [shape])', 'args': ['seed', 'lambda', '[shape]'], 'description': 'generates Poisson distributed random values.', 'details': '', 'aliases': ['randp']}, + 'randg': {'min_args': 3, 'max_args': 4, 'signature': 'randg(seed, shape_param, scale, [shape])', 'args': ['seed', 'shape_param', 'scale', '[shape]'], 'description': 'generates Gamma distributed random values.', 'details': '', 'aliases': ['random_gamma']}, + 'random_gamma': {'min_args': 3, 'max_args': 4, 'signature': 'random_gamma(seed, shape_param, scale, [shape])', 'args': ['seed', 'shape_param', 'scale', '[shape]'], 'description': 'generates Gamma distributed random values.', 'details': '', 'aliases': ['randg']}, + 'randbeta': {'min_args': 3, 'max_args': 4, 'signature': 'randbeta(seed, alpha, beta, [shape])', 'args': ['seed', 'alpha', 'beta', '[shape]'], 'description': 'generates Beta distributed random values', 'details': '', 'aliases': ['random_beta']}, + 'random_beta': {'min_args': 3, 'max_args': 4, 'signature': 'random_beta(seed, alpha, beta, [shape])', 'args': ['seed', 'alpha', 'beta', '[shape]'], 'description': 'generates Beta distributed random values', 'details': '', 'aliases': ['randbeta']}, + 'randl': {'min_args': 3, 'max_args': 4, 'signature': 'randl(seed, loc, scale, [shape])', 'args': ['seed', 'loc', 'scale', '[shape]'], 'description': 'generates Laplace distributed random values', 'details': '', 'aliases': ['random_laplace']}, + 'random_laplace': {'min_args': 3, 'max_args': 4, 'signature': 'random_laplace(seed, loc, scale, [shape])', 'args': ['seed', 'loc', 'scale', '[shape]'], 'description': 'generates Laplace distributed random values', 'details': '', 'aliases': ['randl']}, + 'randgumbel': {'min_args': 3, 'max_args': 4, 'signature': 'randgumbel(seed, loc, scale, [shape])', 'args': ['seed', 'loc', 'scale', '[shape]'], 'description': 'generates Gumbel distributed random values', 'details': '', 'aliases': ['random_gumbel']}, + 'random_gumbel': {'min_args': 3, 'max_args': 4, 'signature': 'random_gumbel(seed, loc, scale, [shape])', 'args': ['seed', 'loc', 'scale', '[shape]'], 'description': 'generates Gumbel distributed random values', 'details': '', 'aliases': ['randgumbel']}, + 'randw': {'min_args': 3, 'max_args': 4, 'signature': 'randw(seed, scale, concentration, [shape])', 'args': ['seed', 'scale', 'concentration', '[shape]'], 'description': 'generates Weibull distributed random values', 'details': '', 'aliases': ['random_weibull']}, + 'random_weibull': {'min_args': 3, 'max_args': 4, 'signature': 'random_weibull(seed, scale, concentration, [shape])', 'args': ['seed', 'scale', 'concentration', '[shape]'], 'description': 'generates Weibull distributed random values', 'details': '', 'aliases': ['randw']}, + 'randchi2': {'min_args': 2, 'max_args': 3, 'signature': 'randchi2(seed, df, [shape])', 'args': ['seed', 'df', '[shape]'], 'description': 'generates Chi-squared distributed random values', 'details': '', 'aliases': ['random_chi2']}, + 'random_chi2': {'min_args': 2, 'max_args': 3, 'signature': 'random_chi2(seed, df, [shape])', 'args': ['seed', 'df', '[shape]'], 'description': 'generates Chi-squared distributed random values', 'details': '', 'aliases': ['randchi2']}, + 'randt': {'min_args': 2, 'max_args': 3, 'signature': 'randt(seed, df, [shape])', 'args': ['seed', 'df', '[shape]'], 'description': 'generates Student-t distributed random values', 'details': '', 'aliases': ['random_studentt']}, + 'random_studentt': {'min_args': 2, 'max_args': 3, 'signature': 'random_studentt(seed, df, [shape])', 'args': ['seed', 'df', '[shape]'], 'description': 'generates Student-t distributed random values', 'details': '', 'aliases': ['randt']}, + 'perlin': {'min_args': 2, 'max_args': 5, 'signature': 'perlin(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates Perlin noise', 'details': '', 'aliases': ['perlin_noise']}, + 'perlin_noise': {'min_args': 2, 'max_args': 5, 'signature': 'perlin_noise(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates Perlin noise', 'details': '', 'aliases': ['perlin']}, + 'cellular': {'min_args': 2, 'max_args': 5, 'signature': 'cellular(seed, scale, [jitter], [offset], [shape])', 'args': ['seed', 'scale', '[jitter]', '[offset]', '[shape]'], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['voronoi', 'worley', 'cellular_noise', 'voronoi_noise']}, + 'voronoi': {'min_args': 2, 'max_args': 5, 'signature': 'voronoi(seed, scale, [jitter], [offset], [shape])', 'args': ['seed', 'scale', '[jitter]', '[offset]', '[shape]'], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'worley', 'cellular_noise', 'voronoi_noise']}, + 'worley': {'min_args': 2, 'max_args': 5, 'signature': 'worley(seed, scale, [jitter], [offset], [shape])', 'args': ['seed', 'scale', '[jitter]', '[offset]', '[shape]'], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'voronoi', 'cellular_noise', 'voronoi_noise']}, + 'cellular_noise': {'min_args': 2, 'max_args': 5, 'signature': 'cellular_noise(seed, scale, [jitter], [offset], [shape])', 'args': ['seed', 'scale', '[jitter]', '[offset]', '[shape]'], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'voronoi', 'worley', 'voronoi_noise']}, + 'voronoi_noise': {'min_args': 2, 'max_args': 5, 'signature': 'voronoi_noise(seed, scale, [jitter], [offset], [shape])', 'args': ['seed', 'scale', '[jitter]', '[offset]', '[shape]'], 'description': 'generates Cellular/Voronoi noise', 'details': '', 'aliases': ['cellular', 'voronoi', 'worley', 'cellular_noise']}, + 'plasma': {'min_args': 2, 'max_args': 5, 'signature': 'plasma(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4', 'details': '', 'aliases': ['turbulence', 'plasma_noise']}, + 'turbulence': {'min_args': 2, 'max_args': 5, 'signature': 'turbulence(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4', 'details': '', 'aliases': ['plasma', 'plasma_noise']}, + 'plasma_noise': {'min_args': 2, 'max_args': 5, 'signature': 'plasma_noise(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates Plasma/Turbulence noise - same as perlin but default octaves 4', 'details': '', 'aliases': ['plasma', 'turbulence']}, + 'ridged': {'min_args': 2, 'max_args': 5, 'signature': 'ridged(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates ridged multi-fractal noise', 'details': '', 'aliases': ['ridged_noise']}, + 'ridged_noise': {'min_args': 2, 'max_args': 5, 'signature': 'ridged_noise(seed, scale, [octaves], [offset], [shape])', 'args': ['seed', 'scale', '[octaves]', '[offset]', '[shape]'], 'description': 'generates ridged multi-fractal noise', 'details': '', 'aliases': ['ridged']}, + 'domain_warp': {'min_args': 4, 'max_args': 8, 'signature': 'domain_warp(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])', 'args': ['seed', 'scale', 'warp_scale', 'warp_strength', '[octaves]', '[warp_octaves]', '[offset]', '[shape]'], 'description': 'generates domain warped noise', 'details': '', 'aliases': ['domain_warp_noise']}, + 'domain_warp_noise': {'min_args': 4, 'max_args': 8, 'signature': 'domain_warp_noise(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])', 'args': ['seed', 'scale', 'warp_scale', 'warp_strength', '[octaves]', '[warp_octaves]', '[offset]', '[shape]'], 'description': 'generates domain warped noise', 'details': '', 'aliases': ['domain_warp']}, } diff --git a/web/autocomplete.js b/web/autocomplete.js index 7b2ac49..a271717 100644 --- a/web/autocomplete.js +++ b/web/autocomplete.js @@ -101,6 +101,12 @@ function ensureAutocompleteStyles() { font-weight: 600; } + .mrmth-tt-details { + margin-top: 4px; + white-space: pre-wrap; + color: #9aa0a6; + } + .mrmth-sig-call .mrmth-sig-active { color: #ffd700; text-decoration: underline; @@ -558,9 +564,11 @@ export function attachAutocomplete(textarea) { argsText += meta.maxArgs === null ? "+ (variadic)" : `, max ${meta.maxArgs}`; tooltipEl.innerHTML = ` -
${escapeHtml(meta.snippet)}
+
${escapeHtml(meta.signature)}
${escapeHtml(meta.description)}
+ ${meta.details ? `
${escapeHtml(meta.details)}
` : ""}
${argsText}
+ ${meta.aliases.length ? `
Also: ${escapeHtml(meta.aliases.join(", "))}
` : ""} `; tooltipEl.style.display = "block"; @@ -758,11 +766,11 @@ export function attachAutocomplete(textarea) { return; } - const argNames = (meta.snippet.match(/\((.*)\)$/)?.[1] ?? "").split(",").map((s) => s.trim()).filter(Boolean); - const variadicAt = argNames.indexOf("..."); + // A variadic arg (`...`, `[sizes...]`) absorbs every argument from its position on. + const variadicAt = meta.args.findIndex((a) => a.includes("...")); let active = ctx.argIndex; if (variadicAt !== -1 && active >= variadicAt) active = variadicAt; - const args = argNames + const args = meta.args .map((a, i) => (i === active ? `${escapeHtml(a)}` : escapeHtml(a))) .join(", "); diff --git a/web/inbuilt_symbols.js b/web/inbuilt_symbols.js index 93c3984..6766634 100644 --- a/web/inbuilt_symbols.js +++ b/web/inbuilt_symbols.js @@ -13,326 +13,326 @@ export const FUNCTIONS = new Set([ ]); export const FUNCTION_META = { - "sin": { minArgs: 1, maxArgs: 1, snippet: "sin(x)", description: "applies sinus function to value or each element of value" }, - "cos": { minArgs: 1, maxArgs: 1, snippet: "cos(x)", description: "applies cosinus function to value or each element of value" }, - "tan": { minArgs: 1, maxArgs: 1, snippet: "tan(x)", description: "applies tangents function to value or each element of value" }, - "asin": { minArgs: 1, maxArgs: 1, snippet: "asin(x)", description: "applies arcus sinus function to value or each element of value" }, - "acos": { minArgs: 1, maxArgs: 1, snippet: "acos(x)", description: "applies arcus cosinus function to value or each element of value" }, - "atan": { minArgs: 1, maxArgs: 1, snippet: "atan(x)", description: "applies arcus tangents function to value or each element of value" }, - "atan2": { minArgs: 2, maxArgs: 2, snippet: "atan2(y, x)", description: "computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant" }, - "sinh": { minArgs: 1, maxArgs: 1, snippet: "sinh(x)", description: "applies hyperbolic sinus function to value or each element of value" }, - "cosh": { minArgs: 1, maxArgs: 1, snippet: "cosh(x)", description: "applies hyperbolic cosinus function to value or each element of value" }, - "tanh": { minArgs: 1, maxArgs: 1, snippet: "tanh(x)", description: "applies hyperbolic tangents function to value or each element of value" }, - "asinh": { minArgs: 1, maxArgs: 1, snippet: "asinh(x)", description: "applies hyperbolic arcus sinus function to value or each element of value" }, - "acosh": { minArgs: 1, maxArgs: 1, snippet: "acosh(x)", description: "applies hyperbolic arcus cosinus function to value or each element of value" }, - "atanh": { minArgs: 1, maxArgs: 1, snippet: "atanh(x)", description: "applies hyperbolic arcus tangents function to value or each element of value" }, - "abs": { minArgs: 1, maxArgs: 1, snippet: "abs(x)", description: "applies per element absolute value function. Same as |x| for numbers." }, - "sqrt": { minArgs: 1, maxArgs: 1, snippet: "sqrt(x)", description: "applies sqere root per element. Negative numbers return NaN (not a number)" }, - "ln": { minArgs: 1, maxArgs: 1, snippet: "ln(x)", description: "applies natural logarithm to value (per element). Negative numbers return NaN (not a number)" }, - "log": { minArgs: 1, maxArgs: 1, snippet: "log(x)", description: "applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)" }, - "log2": { minArgs: 1, maxArgs: 1, snippet: "log2(x)", description: "applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)" }, - "exp": { minArgs: 1, maxArgs: 1, snippet: "exp(x)", description: "applies e^x to value (per element)" }, - "log1p": { minArgs: 1, maxArgs: 1, snippet: "log1p(x)", description: "applies ln(1+x) accurately for values near zero" }, - "expm1": { minArgs: 1, maxArgs: 1, snippet: "expm1(x)", description: "applies exp(x)-1 accurately for values near zero" }, - "sinc": { minArgs: 1, maxArgs: 1, snippet: "sinc(x)", description: "computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1" }, - "cbrt": { minArgs: 1, maxArgs: 1, snippet: "cbrt(x)", description: "computes the real cube root of each value, including negative values" }, - "reciprocal": { minArgs: 1, maxArgs: 1, snippet: "reciprocal(x)", description: "computes 1/x element-wise" }, - "logaddexp": { minArgs: 2, maxArgs: 2, snippet: "logaddexp(x, y)", description: "computes log(exp(x) + exp(y)) element-wise using a numerically stable method" }, - "logsumexp": { minArgs: 1, maxArgs: 2, snippet: "logsumexp(x, dims)", description: "computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions" }, - "norm": { minArgs: 1, maxArgs: 3, snippet: "norm(x, p, dims)", description: "computes the p-norm globally or along one or more dimensions (default p=2)" }, - "normalize": { minArgs: 1, maxArgs: 4, snippet: "normalize(x, p, dim, eps)", description: "normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)" }, - "group_norm": { minArgs: 2, maxArgs: 5, snippet: "group_norm(x, groups, weight, bias, eps)", description: "applies channel-first GroupNorm to [N, C, ...] input" }, - "outer": { minArgs: 2, maxArgs: 2, snippet: "outer(x, y)", description: "computes the outer product of flattened x and y" }, - "trace": { minArgs: 1, maxArgs: 1, snippet: "trace(x)", description: "sums the main diagonal of each square matrix in x" }, - "det": { minArgs: 1, maxArgs: 1, snippet: "det(x)", description: "computes the determinant of each square matrix in x" }, - "rfft": { minArgs: 1, maxArgs: 2, snippet: "rfft(x, dim)", description: "computes the one-dimensional real-input FFT along dim (default: last dimension)" }, - "irfft": { minArgs: 1, maxArgs: 3, snippet: "irfft(x, n, dim)", description: "computes the inverse one-dimensional real FFT along dim (default: last dimension)" }, - "isnan": { minArgs: 1, maxArgs: 1, snippet: "isnan(x)", description: "returns 1.0 for NaN values and 0.0 otherwise" }, - "isinf": { minArgs: 1, maxArgs: 1, snippet: "isinf(x)", description: "returns 1.0 for infinite values and 0.0 otherwise" }, - "isfinite": { minArgs: 1, maxArgs: 1, snippet: "isfinite(x)", description: "returns 1.0 for finite values and 0.0 otherwise" }, - "smin": { minArgs: 1, maxArgs: null, snippet: "smin(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." }, - "smax": { minArgs: 1, maxArgs: null, snippet: "smax(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." }, - "tmin": { minArgs: 2, maxArgs: 2, snippet: "tmin(x, y)", description: "elementwise minimum of tensor or list. min(x,y) when inputs are floats" }, - "tmax": { minArgs: 2, maxArgs: 2, snippet: "tmax(x, y)", description: "elementwise maximum of tensor or list. max(x,y) when inputs are floats" }, - "tnorm": { minArgs: 1, maxArgs: 2, snippet: "tnorm(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." }, - "snorm": { minArgs: 1, maxArgs: 2, snippet: "snorm(x, dim)", description: "frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension." }, - "floor": { minArgs: 1, maxArgs: 1, snippet: "floor(x)", description: "returns the largest integer less than or equal to x" }, - "ceil": { minArgs: 1, maxArgs: 1, snippet: "ceil(x)", description: "returns the smallest integer greater than or equal to x" }, - "round": { minArgs: 1, maxArgs: 1, snippet: "round(x)", description: "rounds x to the nearest integer" }, - "gamma": { minArgs: 1, maxArgs: 1, snippet: "gamma(x)", description: "computes the gamma function (per element)" }, - "pow": { minArgs: 2, maxArgs: 2, snippet: "pow(x, y)", description: "computes x raised to the power of y" }, - "sigm": { minArgs: 1, maxArgs: 1, snippet: "sigm(x)", description: "applies the sigmoid function: 1 / (1 + exp(-x))" }, - "clamp": { minArgs: 3, maxArgs: 3, snippet: "clamp(x, min, max)", description: "clamps x between min and max per element" }, - "fft": { minArgs: 1, maxArgs: 1, snippet: "fft(x)", description: "computes fast Fourier transform of x" }, - "ifft": { minArgs: 1, maxArgs: 2, snippet: "ifft(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." }, - "angle": { minArgs: 1, maxArgs: 1, snippet: "angle(x)", description: "returns the angle of a complex number or vector" }, - "print": { minArgs: 1, maxArgs: 1, snippet: "print(x)", description: "prints the value of x to the console while passing output unchanged" }, - "print_shape": { minArgs: 1, maxArgs: 1, snippet: "print_shape(x)", description: "prints the shape of the tensor x" }, - "pshp": { minArgs: 1, maxArgs: 1, snippet: "pshp(x)", description: "prints the shape of the tensor x" }, - "nvl": { minArgs: 4, maxArgs: 4, snippet: "nvl(x, nan, pos_inf, neg_inf)", description: "null value replacement - inspired by NVL" }, - "nan_to_num": { minArgs: 4, maxArgs: 4, snippet: "nan_to_num(x, nan, pos_inf, neg_inf)", description: "null value replacement - inspired by NVL" }, - "lerp": { minArgs: 3, maxArgs: 3, snippet: "lerp(a, b, t)", description: "linear interpolation between a and b by t per element. t can be float or tensor." }, - "slerp": { minArgs: 3, maxArgs: 4, snippet: "slerp(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." }, - "step": { minArgs: 2, maxArgs: 2, snippet: "step(x, edge)", description: "returns 0 if x < edge, else 1" }, - "smoothstep": { minArgs: 3, maxArgs: 3, snippet: "smoothstep(x, edge0, edge1)", description: "smooth interpolation between edge0 and edge1" }, - "fract": { minArgs: 1, maxArgs: 1, snippet: "fract(x)", description: "returns the fractional part of x: x - floor(x)" }, - "relu": { minArgs: 1, maxArgs: 1, snippet: "relu(x)", description: "applies rectified linear unit function: max(0, x)" }, - "softsign": { minArgs: 1, maxArgs: 1, snippet: "softsign(x)", description: "applies x / (1 + abs(x)) element-wise" }, - "leaky_relu": { minArgs: 1, maxArgs: 2, snippet: "leaky_relu(x, negative_slope)", description: "applies leaky ReLU element-wise; negative_slope defaults to 0.01" }, - "softplus": { minArgs: 1, maxArgs: 1, snippet: "softplus(x)", description: "applies the softplus function: ln(1 + exp(x))" }, - "gelu": { minArgs: 1, maxArgs: 1, snippet: "gelu(x)", description: "applies the Gaussian Error Linear Unit (GELU) activation function" }, - "silu": { minArgs: 1, maxArgs: 1, snippet: "silu(x)", description: "applies the Sigmoid Linear Unit activation element-wise" }, - "sign": { minArgs: 1, maxArgs: 1, snippet: "sign(x)", description: "returns the sign of x: -1, 0, or 1" }, - "degrees": { minArgs: 1, maxArgs: 1, snippet: "degrees(x)", description: "converts radians to degrees (per element)" }, - "radians": { minArgs: 1, maxArgs: 1, snippet: "radians(x)", description: "converts degrees to radians (per element)" }, - "logical_not": { minArgs: 1, maxArgs: 1, snippet: "logical_not(x)", description: "returns 1.0 where x is zero and 0.0 otherwise" }, - "logical_and": { minArgs: 2, maxArgs: 2, snippet: "logical_and(x, y)", description: "returns 1.0 if both values are non-zero, else 0.0" }, - "logical_or": { minArgs: 2, maxArgs: 2, snippet: "logical_or(x, y)", description: "returns 1.0 if either value is non-zero, else 0.0" }, - "hypot": { minArgs: 2, maxArgs: 2, snippet: "hypot(x, y)", description: "computes the element-wise Euclidean distance from the origin" }, - "map": { minArgs: 2, maxArgs: 4, snippet: "map(tensor, coord1, coord2, coord3)", description: "samples/remaps input tensor using coordinates" }, - "ezconvolution": { minArgs: 2, maxArgs: 3, snippet: "ezconvolution(tensor, kernel_sizes..., kernel)", description: "applies convolution with kernel. Attempts to correctly convolve over size dimensions." }, - "ezconv": { minArgs: 2, maxArgs: 3, snippet: "ezconv(tensor, kernel_sizes..., kernel)", description: "applies convolution with kernel. Attempts to correctly convolve over size dimensions." }, - "convolution": { minArgs: 2, maxArgs: 3, snippet: "convolution(tensor, kernel_sizes..., kernel)", description: "applies convolution with kernel. Expects [batch,channel, ...]" }, - "conv": { minArgs: 2, maxArgs: 3, snippet: "conv(tensor, kernel_sizes..., kernel)", description: "applies convolution with kernel. Expects [batch,channel, ...]" }, - "swap": { minArgs: 4, maxArgs: 4, snippet: "swap(x, dim, idx1, idx2)", description: "swaps elements along dim between idx1 and idx2" }, - "transpose": { minArgs: 3, maxArgs: 3, snippet: "transpose(x, dim0, dim1)", description: "swaps two tensor dimensions" }, - "swapaxes": { minArgs: 3, maxArgs: 3, snippet: "swapaxes(x, dim0, dim1)", description: "swaps two tensor dimensions" }, - "permute": { minArgs: 2, maxArgs: 2, snippet: "permute(x, dims)", description: "permutes the dimensions of tensor x according to dims" }, - "perm": { minArgs: 2, maxArgs: 2, snippet: "perm(x, dims)", description: "permutes the dimensions of tensor x according to dims" }, - "reshape": { minArgs: 2, maxArgs: 2, snippet: "reshape(x, shape)", description: "reshapes tensor x to the specified shape" }, - "rshp": { minArgs: 2, maxArgs: 2, snippet: "rshp(x, shape)", description: "reshapes tensor x to the specified shape" }, - "range": { minArgs: 3, maxArgs: 3, snippet: "range(start, stop, step)", description: "creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count." }, - "linspace": { minArgs: 3, maxArgs: 3, snippet: "linspace(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." }, - "logspace": { minArgs: 4, maxArgs: 4, snippet: "logspace(start, stop, num, base)", description: "creates logarithmically spaced values" }, - "topk": { minArgs: 2, maxArgs: 3, snippet: "topk(x, k, dim)", description: "returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last." }, - "botk": { minArgs: 2, maxArgs: 3, snippet: "botk(x, k, dim)", description: "returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last." }, - "pinv": { minArgs: 1, maxArgs: 1, snippet: "pinv(x)", description: "computes the permutative inverse of a list x (list must have uniqe elements) -- TODO: CHECK --" }, - "inv": { minArgs: 1, maxArgs: 2, snippet: "inv(x, pseudo)", description: "computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead" }, - "sum": { minArgs: 1, maxArgs: 2, snippet: "sum(x, dims)", description: "computes the sum of elements of x, optionally along one or more dimensions" }, - "mean": { minArgs: 1, maxArgs: 2, snippet: "mean(x, dims)", description: "computes the arithmetic mean of elements of x globally or along one or more dimensions" }, - "std": { minArgs: 1, maxArgs: 2, snippet: "std(x, dims)", description: "computes the sample standard deviation of elements of x globally or along one or more dimensions" }, - "var": { minArgs: 1, maxArgs: 2, snippet: "var(x, dims)", description: "computes the sample variance of elements of x globally or along one or more dimensions" }, - "prod": { minArgs: 1, maxArgs: 2, snippet: "prod(x, dims)", description: "computes the product of elements of x globally or along one or more dimensions" }, - "isclose": { minArgs: 2, maxArgs: 4, snippet: "isclose(a, b, rtol, atol)", description: "elementwise approximate equality test" }, - "allclose": { minArgs: 2, maxArgs: 4, snippet: "allclose(a, b, rtol, atol)", description: "returns 1.0 if all elements are approximately equal, else 0.0" }, - "quartile": { minArgs: 2, maxArgs: 3, snippet: "quartile(x, q, dim)", description: "computes the q-th quartile globally or along dim" }, - "quartil": { minArgs: 2, maxArgs: 3, snippet: "quartil(x, q, dim)", description: "computes the q-th quartile globally or along dim" }, - "percentile": { minArgs: 2, maxArgs: 3, snippet: "percentile(x, p, dim)", description: "computes the p-th percentile globally or along dim" }, - "prcnt": { minArgs: 2, maxArgs: 3, snippet: "prcnt(x, p, dim)", description: "computes the p-th percentile globally or along dim" }, - "quantile": { minArgs: 2, maxArgs: 3, snippet: "quantile(x, q, dim)", description: "computes the q-th quantile globally or along dim" }, - "dot": { minArgs: 2, maxArgs: 2, snippet: "dot(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." }, - "moment": { minArgs: 3, maxArgs: 3, snippet: "moment(x, a, k)", description: "computes the k-th moment of x around a" }, - "erf": { minArgs: 1, maxArgs: 1, snippet: "erf(x)", description: "computes the error function (torch.erf)" }, - "erfc": { minArgs: 1, maxArgs: 1, snippet: "erfc(x)", description: "computes the complementary error function (torch.special.erfc)" }, - "erfinv": { minArgs: 1, maxArgs: 1, snippet: "erfinv(x)", description: "computes the inverse error function (torch.erfinv)" }, - "any": { minArgs: 1, maxArgs: 1, snippet: "any(x)", description: "returns 1 if any element of x is non-zero otherwise 0" }, - "all": { minArgs: 1, maxArgs: 1, snippet: "all(x)", description: "returns 1 if all elements of x are non-zero otherwise 0" }, - "edge": { minArgs: 1, maxArgs: 2, snippet: "edge(x, matrix_size)", description: "detects edges in x. Matrix size denotes the size of edge detection matrix." }, - "blur": { minArgs: 2, maxArgs: 3, snippet: "blur(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." }, - "gaussian": { minArgs: 2, maxArgs: 3, snippet: "gaussian(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." }, - "median": { minArgs: 1, maxArgs: 2, snippet: "median(x, dim)", description: "computes the median globally or along one dimension" }, - "mode": { minArgs: 1, maxArgs: 2, snippet: "mode(x, dim)", description: "computes the mode globally or along one dimension" }, - "cumsum": { minArgs: 1, maxArgs: 2, snippet: "cumsum(x, dim)", description: "computes the cumulative sum, defaulting to the first dimension." }, - "cumprod": { minArgs: 1, maxArgs: 1, snippet: "cumprod(x)", description: "computes the cumulative product over first dimension." }, - "topk_ind": { minArgs: 2, maxArgs: 3, snippet: "topk_ind(x, k, dim)", description: "returns the indices of the k largest elements along dim; dim defaults to the last" }, - "topk_indices": { minArgs: 2, maxArgs: 3, snippet: "topk_indices(x, k, dim)", description: "returns the indices of the k largest elements along dim; dim defaults to the last" }, - "botk_ind": { minArgs: 2, maxArgs: 3, snippet: "botk_ind(x, k, dim)", description: "returns the indices of the k smallest elements along dim; dim defaults to the last" }, - "botk_indices": { minArgs: 2, maxArgs: 3, snippet: "botk_indices(x, k, dim)", description: "returns the indices of the k smallest elements along dim; dim defaults to the last" }, - "cubic_ease": { minArgs: 3, maxArgs: 3, snippet: "cubic_ease(a, b, t)", description: "cubic ease between a and b" }, - "cubic": { minArgs: 3, maxArgs: 3, snippet: "cubic(a, b, t)", description: "cubic ease between a and b" }, - "elastic_ease": { minArgs: 3, maxArgs: 3, snippet: "elastic_ease(a, b, t)", description: "elastic ease between a and b" }, - "elastic": { minArgs: 3, maxArgs: 3, snippet: "elastic(a, b, t)", description: "elastic ease between a and b" }, - "sine_ease": { minArgs: 3, maxArgs: 3, snippet: "sine_ease(a, b, t)", description: "sine easing between a and b" }, - "sine": { minArgs: 3, maxArgs: 3, snippet: "sine(a, b, t)", description: "sine easing between a and b" }, - "smootherstep": { minArgs: 3, maxArgs: 3, snippet: "smootherstep(x, edge0, edge1)", description: "smoother interpolation between edge0 and edge1" }, - "dist": { minArgs: 4, maxArgs: 4, snippet: "dist(x1, y1, x2, y2)", description: "computes Euclidean distance between (x1, y1) and (x2, y2)" }, - "distance": { minArgs: 4, maxArgs: 4, snippet: "distance(x1, y1, x2, y2)", description: "computes Euclidean distance between (x1, y1) and (x2, y2)" }, - "remap": { minArgs: 5, maxArgs: 5, snippet: "remap(v, i_min, i_max, o_min, o_max)", description: "remaps values from input range to output range" }, - "cossim": { minArgs: 2, maxArgs: 2, snippet: "cossim(x, y)", description: "computes the cosine similarity between x and y." }, - "cosine_similarity": { minArgs: 2, maxArgs: 2, snippet: "cosine_similarity(x, y)", description: "computes the cosine similarity between x and y." }, - "count": { minArgs: 1, maxArgs: 1, snippet: "count(x)", description: "returns the number of elements in x" }, - "cnt": { minArgs: 1, maxArgs: 1, snippet: "cnt(x)", description: "returns the number of elements in x" }, - "length": { minArgs: 1, maxArgs: 1, snippet: "length(x)", description: "returns the number of elements in x" }, - "keys": { minArgs: 1, maxArgs: 1, snippet: "keys(x)", description: "returns a list of dictionary keys in insertion order" }, - "enable_tracking": { minArgs: 1, maxArgs: 1, snippet: "enable_tracking(d)", description: "enables change tracking for ChangeTrackingDict d (returns d)" }, - "track_on": { minArgs: 1, maxArgs: 1, snippet: "track_on(d)", description: "enables change tracking for ChangeTrackingDict d (returns d)" }, - "disable_tracking": { minArgs: 1, maxArgs: 1, snippet: "disable_tracking(d)", description: "disables change tracking for ChangeTrackingDict d (returns d)" }, - "track_off": { minArgs: 1, maxArgs: 1, snippet: "track_off(d)", description: "disables change tracking for ChangeTrackingDict d (returns d)" }, - "reset_tracking": { minArgs: 1, maxArgs: 1, snippet: "reset_tracking(d)", description: "resets change tracking state for ChangeTrackingDict d (returns d)" }, - "track_reset": { minArgs: 1, maxArgs: 1, snippet: "track_reset(d)", description: "resets change tracking state for ChangeTrackingDict d (returns d)" }, - "get_changed_keys": { minArgs: 1, maxArgs: 1, snippet: "get_changed_keys(d)", description: "returns list of keys that were modified or added in ChangeTrackingDict d" }, - "changed_keys": { minArgs: 1, maxArgs: 1, snippet: "changed_keys(d)", description: "returns list of keys that were modified or added in ChangeTrackingDict d" }, - "get_added_keys": { minArgs: 1, maxArgs: 1, snippet: "get_added_keys(d)", description: "returns list of keys that were added (newly created) in ChangeTrackingDict d" }, - "added_keys": { minArgs: 1, maxArgs: 1, snippet: "added_keys(d)", description: "returns list of keys that were added (newly created) in ChangeTrackingDict d" }, - "get_removed_keys": { minArgs: 1, maxArgs: 1, snippet: "get_removed_keys(d)", description: "returns list of keys that were removed from ChangeTrackingDict d" }, - "removed_keys": { minArgs: 1, maxArgs: 1, snippet: "removed_keys(d)", description: "returns list of keys that were removed from ChangeTrackingDict d" }, - "get_unchanged_keys": { minArgs: 1, maxArgs: 1, snippet: "get_unchanged_keys(d)", description: "returns list of keys that remain unchanged in ChangeTrackingDict d" }, - "unchanged_keys": { minArgs: 1, maxArgs: 1, snippet: "unchanged_keys(d)", description: "returns list of keys that remain unchanged in ChangeTrackingDict d" }, - "repeat": { minArgs: 2, maxArgs: 3, snippet: "repeat(x, count, dims)", description: "repeats tensor elements; count may be scalar or per-dim list" }, - "flatten": { minArgs: 1, maxArgs: 1, snippet: "flatten(x)", description: "flattens tensor into a 1D tensor" }, - "append": { minArgs: 2, maxArgs: 2, snippet: "append(x, y)", description: "appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)" }, - "get_value": { minArgs: 1, maxArgs: 1, snippet: "get_value(slot)", description: "returns the value at slot from stack" }, - "flow_apply": { minArgs: 2, maxArgs: 2, snippet: "flow_apply(image, flow)", description: "applies optical flow to an image" }, - "batch_shuffle": { minArgs: 2, maxArgs: 2, snippet: "batch_shuffle(x, indices)", description: "shuffles and duplicates or skips the batch dimension of x according to indices" }, - "shuffle": { minArgs: 2, maxArgs: 2, snippet: "shuffle(x, indices)", description: "shuffles and duplicates or skips the batch dimension of x according to indices" }, - "select": { minArgs: 2, maxArgs: 2, snippet: "select(x, indices)", description: "shuffles and duplicates or skips the batch dimension of x according to indices" }, - "motion_mask": { minArgs: 1, maxArgs: 1, snippet: "motion_mask(x)", description: "generates a motion mask from optical flow" }, - "flow_to_image": { minArgs: 1, maxArgs: 1, snippet: "flow_to_image(x)", description: "converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta." }, - "flow_mag": { minArgs: 1, maxArgs: 1, snippet: "flow_mag(x)", description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)" }, - "flow_magnitude": { minArgs: 1, maxArgs: 1, snippet: "flow_magnitude(x)", description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)" }, - "flow_ang": { minArgs: 1, maxArgs: 1, snippet: "flow_ang(x)", description: "computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)" }, - "flow_angle": { minArgs: 1, maxArgs: 1, snippet: "flow_angle(x)", description: "computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)" }, - "where": { minArgs: 3, maxArgs: 3, snippet: "where(condition, x, y)", description: "returns x if condition is true, else y. Runs per element." }, - "histogram": { minArgs: 4, maxArgs: 4, snippet: "histogram(x, bins, min, max)", description: "computes histogram" }, - "hist": { minArgs: 4, maxArgs: 4, snippet: "hist(x, bins, min, max)", description: "computes histogram" }, - "overlay": { minArgs: 3, maxArgs: 4, snippet: "overlay(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." }, - "pad": { minArgs: 2, maxArgs: 2, snippet: "pad(x, padding)", description: "pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)" }, - "cross": { minArgs: 2, maxArgs: 2, snippet: "cross(x, y)", description: "computes the cross product of x and y. Last dimension must be 3" }, - "matmul": { minArgs: 2, maxArgs: 2, snippet: "matmul(x, y)", description: "computes the matrix multiplication of x and y" }, - "solve": { minArgs: 2, maxArgs: 2, snippet: "solve(A, b)", description: "solves the square linear system A*x=b without explicitly forming A inverse" }, - "matrix_rank": { minArgs: 1, maxArgs: 2, snippet: "matrix_rank(x, tol)", description: "computes the numerical rank of each matrix using optional absolute tolerance tol" }, - "rife": { minArgs: 2, maxArgs: 5, snippet: "rife(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" }, - "bnot": { minArgs: 1, maxArgs: 1, snippet: "bnot(x)", description: "computes the bitwise NOT" }, - "bitwise_not": { minArgs: 1, maxArgs: 1, snippet: "bitwise_not(x)", description: "computes the bitwise NOT" }, - "bitcount": { minArgs: 1, maxArgs: 1, snippet: "bitcount(x)", description: "returns the number of set bits" }, - "popcount": { minArgs: 1, maxArgs: 1, snippet: "popcount(x)", description: "returns the number of set bits" }, - "popcnt": { minArgs: 1, maxArgs: 1, snippet: "popcnt(x)", description: "returns the number of set bits" }, - "shape": { minArgs: 1, maxArgs: 1, snippet: "shape(x)", description: "returns the shape of tensor as a list" }, - "band": { minArgs: 2, maxArgs: 2, snippet: "band(x, y)", description: "computes the element-wise bitwise AND of x and y" }, - "bitwise_and": { minArgs: 2, maxArgs: 2, snippet: "bitwise_and(x, y)", description: "computes the element-wise bitwise AND of x and y" }, - "bxor": { minArgs: 2, maxArgs: 2, snippet: "bxor(x, y)", description: "computes the element-wise bitwise XOR of x and y" }, - "bitwise_xor": { minArgs: 2, maxArgs: 2, snippet: "bitwise_xor(x, y)", description: "computes the element-wise bitwise XOR of x and y" }, - "bor": { minArgs: 2, maxArgs: 2, snippet: "bor(x, y)", description: "computes the element-wise bitwise OR of x and y" }, - "bitwise_or": { minArgs: 2, maxArgs: 2, snippet: "bitwise_or(x, y)", description: "computes the element-wise bitwise OR of x and y" }, - "tensor": { minArgs: 1, maxArgs: 3, snippet: "tensor(shape, value, dtype_template)", description: "creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32" }, - "zeros": { minArgs: 1, maxArgs: 2, snippet: "zeros(shape, dtype_template)", description: "creates a zero-filled tensor on the current device" }, - "ones": { minArgs: 1, maxArgs: 2, snippet: "ones(shape, dtype_template)", description: "creates a one-filled tensor on the current device" }, - "eye": { minArgs: 1, maxArgs: 2, snippet: "eye(n, dtype_template)", description: "creates an n-by-n identity matrix" }, - "one_hot": { minArgs: 2, maxArgs: 2, snippet: "one_hot(indices, classes)", description: "converts integer class indices to float32 one-hot vectors" }, - "mse": { minArgs: 2, maxArgs: 3, snippet: "mse(a, b, reduction)", description: "mean squared error; reduction is mean (default), sum, or none" }, - "mae": { minArgs: 2, maxArgs: 3, snippet: "mae(a, b, reduction)", description: "mean absolute error; reduction is mean (default), sum, or none" }, - "psnr": { minArgs: 2, maxArgs: 3, snippet: "psnr(a, b, data_range)", description: "peak signal-to-noise ratio in dB; data_range defaults to 1" }, - "weighted_mean": { minArgs: 2, maxArgs: 3, snippet: "weighted_mean(x, weights, dims)", description: "computes the weighted mean globally or along one or more dimensions" }, - "huber_loss": { minArgs: 2, maxArgs: 4, snippet: "huber_loss(prediction, target, delta, reduction)", description: "computes Huber loss; delta defaults to 1 and reduction to mean" }, - "cross_entropy": { minArgs: 2, maxArgs: 4, snippet: "cross_entropy(logits, target, dim, reduction)", description: "computes cross-entropy from class logits and class indices or target probabilities" }, - "add_key": { minArgs: 3, maxArgs: 3, snippet: "add_key(dict, key, value)", description: "adds or replaces a dictionary entry and returns the updated dictionary" }, - "remove_key": { minArgs: 2, maxArgs: 2, snippet: "remove_key(dict, key)", description: "removes a dictionary entry and returns the updated dictionary" }, - "rm_key": { minArgs: 2, maxArgs: 2, snippet: "rm_key(dict, key)", description: "removes a dictionary entry and returns the updated dictionary" }, - "stack_push": { minArgs: 2, maxArgs: 2, snippet: "stack_push(slot, val)", description: "pushes val onto the end of slot stack" }, - "stack_pop": { minArgs: 1, maxArgs: 1, snippet: "stack_pop(slot)", description: "removes and returns the last element of slot stack" }, - "stack_clear": { minArgs: 1, maxArgs: 1, snippet: "stack_clear(slot)", description: "clears the contents of slot stack" }, - "stack_has": { minArgs: 1, maxArgs: 1, snippet: "stack_has(slot)", description: "returns 1.0 if slot exists in stack and is not empty else returns 0.0" }, - "stack_get": { minArgs: 1, maxArgs: 1, snippet: "stack_get(slot)", description: "returns the last pushed value in slot without popping it" }, - "cat": { minArgs: 2, maxArgs: null, snippet: "cat(x, ..., dim)", description: "concatenates one or more tensors along the specified dimension" }, - "concat": { minArgs: 2, maxArgs: null, snippet: "concat(x, ..., dim)", description: "concatenates one or more tensors along the specified dimension" }, - "concatenate": { minArgs: 2, maxArgs: null, snippet: "concatenate(x, ..., dim)", description: "concatenates one or more tensors along the specified dimension" }, - "stack": { minArgs: 1, maxArgs: 2, snippet: "stack(tensors, dim)", description: "stacks a list of tensors along a new dimension" }, - "nonzero": { minArgs: 1, maxArgs: 1, snippet: "nonzero(x)", description: "returns an N-by-rank tensor of coordinates for nonzero elements" }, - "int": { minArgs: 1, maxArgs: 1, snippet: "int(x)", description: "casts x to integer" }, - "float": { minArgs: 1, maxArgs: 1, snippet: "float(x)", description: "casts x to float" }, - "upper": { minArgs: 1, maxArgs: 1, snippet: "upper(x)", description: "converts string to uppercase" }, - "lower": { minArgs: 1, maxArgs: 1, snippet: "lower(x)", description: "converts string to lowercase" }, - "trim": { minArgs: 1, maxArgs: 1, snippet: "trim(x)", description: "removes leading and trailing whitespace from string" }, - "split": { minArgs: 1, maxArgs: 2, snippet: "split(x, delimiter)", description: "splits string to list of strings based on delimiter. Default is space." }, - "join": { minArgs: 1, maxArgs: 2, snippet: "join(x, separator)", description: "joins strings in list using separator. Defalut separator is \"\". If you want to join tensors use concatinate(...)" }, - "substring": { minArgs: 2, maxArgs: 3, snippet: "substring(s, start, length)", description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string" }, - "substr": { minArgs: 2, maxArgs: 3, snippet: "substr(s, start, length)", description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string" }, - "find": { minArgs: 2, maxArgs: 2, snippet: "find(s, sub)", description: "returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings." }, - "replace": { minArgs: 3, maxArgs: 3, snippet: "replace(s, old, new)", description: "replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors." }, - "dilate": { minArgs: 1, maxArgs: 2, snippet: "dilate(x, kernel)", description: "applies dilation to x. kernel is optional." }, - "erode": { minArgs: 1, maxArgs: 2, snippet: "erode(x, kernel)", description: "applies erosion to x. kernel is size of used matrix." }, - "morph_open": { minArgs: 1, maxArgs: 2, snippet: "morph_open(x, kernel)", description: "applies morphological opening to x. kernel is size of used matrix." }, - "morph_close": { minArgs: 1, maxArgs: 2, snippet: "morph_close(x, kernel)", description: "applies morphological closing to x. kernel is size of used matrix." }, - "rgb_to_oklab": { minArgs: 1, maxArgs: 3, snippet: "rgb_to_oklab(r, g, b)", description: "converts RGB to OKLab. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting." }, - "rgb_to_cielab": { minArgs: 1, maxArgs: 3, snippet: "rgb_to_cielab(r, g, b)", description: "converts RGB to CIELAB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting." }, - "oklab_to_rgb": { minArgs: 1, maxArgs: 3, snippet: "oklab_to_rgb(oklab)", description: "converts OKLab to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting." }, - "cielab_to_rgb": { minArgs: 1, maxArgs: 3, snippet: "cielab_to_rgb(cielab)", description: "converts CIELAB to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting." }, - "rgb_to_hsv": { minArgs: 1, maxArgs: 4, snippet: "rgb_to_hsv(rgb, degrees)", description: "converts RGB to HSV. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting. If degrees is specified and nonzero it returns hue as 0-360 instead of 0-1" }, - "hsv_to_rgb": { minArgs: 1, maxArgs: 4, snippet: "hsv_to_rgb(hsv, degrees)", description: "converts HSV to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting." }, - "int_to_rgb": { minArgs: 1, maxArgs: 1, snippet: "int_to_rgb(val)", description: "converts an integer to an RGB color. If input is tensor it stacks the resulting R, G and B tensors using last dimension. If It is list, List of lists is returned and if value, 3 long list is returned." }, - "rgb_to_int": { minArgs: 3, maxArgs: 3, snippet: "rgb_to_int(r, g, b)", description: "converts RGB components to an integer It uses last dimension of tensor (or list) as R,G,B if one value. Othervise uses whole thing as channel." }, - "interpolate_linear": { minArgs: 2, maxArgs: 2, snippet: "interpolate_linear(x, y)", description: "performs linear interpolation on X. Assumes that dim 0 is batch and dim 1 = channel" }, - "interpolate_area": { minArgs: 2, maxArgs: 2, snippet: "interpolate_area(x, y)", description: "performs area interpolation X. Assumes that dim 0 is batch and dim 1 = channel" }, - "interpolate_nearest": { minArgs: 2, maxArgs: 2, snippet: "interpolate_nearest(x, y)", description: "performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel" }, - "interpolate_nearest_exact": { minArgs: 2, maxArgs: 2, snippet: "interpolate_nearest_exact(x, y)", description: "performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel" }, - "text_image": { minArgs: 3, maxArgs: 9, snippet: "text_image(text, font, size, max_width, weight, rotation_angle, line_spacing, italic, underline)", description: "renders text to an 2D tensor" }, - "as_nested_tensor": { minArgs: 1, maxArgs: 1, snippet: "as_nested_tensor(x)", description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)" }, - "as_nested": { minArgs: 1, maxArgs: 1, snippet: "as_nested(x)", description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)" }, - "svd": { minArgs: 1, maxArgs: 2, snippet: "svd(x, full_matrices)", description: "computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)" }, - "singular_value_decomposition": { minArgs: 1, maxArgs: 2, snippet: "singular_value_decomposition(x, full_matrices)", description: "computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)" }, - "diagonal_matrix": { minArgs: 2, maxArgs: 5, snippet: "diagonal_matrix(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." }, - "diag": { minArgs: 2, maxArgs: 5, snippet: "diag(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." }, - "timestamp": { minArgs: 0, maxArgs: 0, snippet: "timestamp()", description: "returns the current system timestamp" }, - "now": { minArgs: 0, maxArgs: 0, snippet: "now()", description: "returns the current system timestamp" }, - "sort": { minArgs: 1, maxArgs: 3, snippet: "sort(x, desc, dim)", description: "returns a sorted version of x (If input is tensor, it sorts the last dimension)" }, - "argsort": { minArgs: 1, maxArgs: 3, snippet: "argsort(x, desc, dim)", description: "returns the indices that would sort x. desc defaults to ascending and dim defaults to the last dimension." }, - "argmin": { minArgs: 1, maxArgs: 3, snippet: "argmin(x, as_position, dim)", description: "returns the minimum index globally or along dim; as_position returns global coordinates" }, - "argmax": { minArgs: 1, maxArgs: 3, snippet: "argmax(x, as_position, dim)", description: "returns the maximum index globally or along dim; as_position returns global coordinates" }, - "softmax": { minArgs: 1, maxArgs: 2, snippet: "softmax(x, axis)", description: "applies the softmax function to x (sum of slice == 1.0 and max value <= 1.0). axis defaults to last." }, - "softmin": { minArgs: 1, maxArgs: 2, snippet: "softmin(x, axis)", description: "applies the softmin function to x (same as softmax(-x,[axis])). axis defaults to last." }, - "unique": { minArgs: 1, maxArgs: 1, snippet: "unique(x)", description: "returns the unique elements (sorted, flatened)" }, - "flip": { minArgs: 2, maxArgs: 2, snippet: "flip(x, dims)", description: "reverses the order of elements along the specified dimensions. Works also for text and list with dims=0" }, - "startswith": { minArgs: 2, maxArgs: 2, snippet: "startswith(text, prefix)", description: "returns 1 if text starts with prefix, else 0" }, - "endswith": { minArgs: 2, maxArgs: 2, snippet: "endswith(text, suffix)", description: "returns 1 if text ends with suffix, else 0" }, - "squeeze": { minArgs: 1, maxArgs: 2, snippet: "squeeze(x, dim)", description: "removes size-1 dimensions from tensor x, optionally at dim" }, - "unsqueeze": { minArgs: 2, maxArgs: 2, snippet: "unsqueeze(x, dim)", description: "inserts a size-1 dimension into tensor x at dim" }, - "roll": { minArgs: 2, maxArgs: 3, snippet: "roll(x, shifts, axis)", description: "rolls tensor x along axis" }, - "cov": { minArgs: 2, maxArgs: 2, snippet: "cov(x, y)", description: "computes the covariance matrix of x and y" }, - "corr": { minArgs: 2, maxArgs: 2, snippet: "corr(x, y)", description: "computes the correlation between x and y" }, - "correlation": { minArgs: 2, maxArgs: 2, snippet: "correlation(x, y)", description: "computes the correlation between x and y" }, - "entropy": { minArgs: 1, maxArgs: 1, snippet: "entropy(x)", description: "computes shanon entropy" }, - "crop": { minArgs: 3, maxArgs: 3, snippet: "crop(x, start, size)", description: "crops tensor x. Take size and begin at start. start should be the low corner. The result is at most size (if size is bigger then rest of tensor)." }, - "coords": { minArgs: 2, maxArgs: 3, snippet: "coords(shape, dim, dtype)", description: "generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor." }, - "coordinates": { minArgs: 2, maxArgs: 3, snippet: "coordinates(shape, dim, dtype)", description: "generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor." }, - "gather": { minArgs: 3, maxArgs: 3, snippet: "gather(x, dim, idx)", description: "gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx." }, - "scatter": { minArgs: 4, maxArgs: 4, snippet: "scatter(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." }, - "scatter_add": { minArgs: 4, maxArgs: 4, snippet: "scatter_add(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." }, - "noise": { minArgs: 1, maxArgs: 2, snippet: "noise(seed, shape)", description: "generates normally distributed random noise" }, - "randn": { minArgs: 1, maxArgs: 2, snippet: "randn(seed, shape)", description: "generates normally distributed random noise" }, - "random_normal": { minArgs: 1, maxArgs: 2, snippet: "random_normal(seed, shape)", description: "generates normally distributed random noise" }, - "pink_noise": { minArgs: 1, maxArgs: 2, snippet: "pink_noise(seed, shape)", description: "generates deterministic pink noise (approximately 1/f power spectrum), normalised per row" }, - "pink": { minArgs: 1, maxArgs: 2, snippet: "pink(seed, shape)", description: "generates deterministic pink noise (approximately 1/f power spectrum), normalised per row" }, - "brown_noise": { minArgs: 1, maxArgs: 2, snippet: "brown_noise(seed, shape)", description: "generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row" }, - "brown": { minArgs: 1, maxArgs: 2, snippet: "brown(seed, shape)", description: "generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row" }, - "rand": { minArgs: 1, maxArgs: 2, snippet: "rand(seed, shape)", description: "generates uniformly distributed random noise" }, - "randu": { minArgs: 1, maxArgs: 2, snippet: "randu(seed, shape)", description: "generates uniformly distributed random noise" }, - "random_uniform": { minArgs: 1, maxArgs: 2, snippet: "random_uniform(seed, shape)", description: "generates uniformly distributed random noise" }, - "randc": { minArgs: 3, maxArgs: 4, snippet: "randc(seed, median, sigma, shape)", description: "generates Cauchy distributed random values." }, - "random_cauchy": { minArgs: 3, maxArgs: 4, snippet: "random_cauchy(seed, median, sigma, shape)", description: "generates Cauchy distributed random values." }, - "rande": { minArgs: 2, maxArgs: 3, snippet: "rande(seed, lambda, shape)", description: "generates exponentially distributed random values" }, - "random_exponential": { minArgs: 2, maxArgs: 3, snippet: "random_exponential(seed, lambda, shape)", description: "generates exponentially distributed random values" }, - "randln": { minArgs: 3, maxArgs: 4, snippet: "randln(seed, mean, std, shape)", description: "generates log-normally distributed random values." }, - "random_log_normal": { minArgs: 3, maxArgs: 4, snippet: "random_log_normal(seed, mean, std, shape)", description: "generates log-normally distributed random values." }, - "randb": { minArgs: 2, maxArgs: 3, snippet: "randb(seed, probability, shape)", description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor" }, - "random_bernoulli": { minArgs: 2, maxArgs: 3, snippet: "random_bernoulli(seed, probability, shape)", description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor" }, - "randp": { minArgs: 2, maxArgs: 3, snippet: "randp(seed, lambda, shape)", description: "generates Poisson distributed random values." }, - "random_poisson": { minArgs: 2, maxArgs: 3, snippet: "random_poisson(seed, lambda, shape)", description: "generates Poisson distributed random values." }, - "randg": { minArgs: 3, maxArgs: 4, snippet: "randg(seed, shape_param, scale, shape)", description: "generates Gamma distributed random values." }, - "random_gamma": { minArgs: 3, maxArgs: 4, snippet: "random_gamma(seed, shape_param, scale, shape)", description: "generates Gamma distributed random values." }, - "randbeta": { minArgs: 3, maxArgs: 4, snippet: "randbeta(seed, alpha, beta, shape)", description: "generates Beta distributed random values" }, - "random_beta": { minArgs: 3, maxArgs: 4, snippet: "random_beta(seed, alpha, beta, shape)", description: "generates Beta distributed random values" }, - "randl": { minArgs: 3, maxArgs: 4, snippet: "randl(seed, loc, scale, shape)", description: "generates Laplace distributed random values" }, - "random_laplace": { minArgs: 3, maxArgs: 4, snippet: "random_laplace(seed, loc, scale, shape)", description: "generates Laplace distributed random values" }, - "randgumbel": { minArgs: 3, maxArgs: 4, snippet: "randgumbel(seed, loc, scale, shape)", description: "generates Gumbel distributed random values" }, - "random_gumbel": { minArgs: 3, maxArgs: 4, snippet: "random_gumbel(seed, loc, scale, shape)", description: "generates Gumbel distributed random values" }, - "randw": { minArgs: 3, maxArgs: 4, snippet: "randw(seed, scale, concentration, shape)", description: "generates Weibull distributed random values" }, - "random_weibull": { minArgs: 3, maxArgs: 4, snippet: "random_weibull(seed, scale, concentration, shape)", description: "generates Weibull distributed random values" }, - "randchi2": { minArgs: 2, maxArgs: 3, snippet: "randchi2(seed, df, shape)", description: "generates Chi-squared distributed random values" }, - "random_chi2": { minArgs: 2, maxArgs: 3, snippet: "random_chi2(seed, df, shape)", description: "generates Chi-squared distributed random values" }, - "randt": { minArgs: 2, maxArgs: 3, snippet: "randt(seed, df, shape)", description: "generates Student-t distributed random values" }, - "random_studentt": { minArgs: 2, maxArgs: 3, snippet: "random_studentt(seed, df, shape)", description: "generates Student-t distributed random values" }, - "perlin": { minArgs: 2, maxArgs: 5, snippet: "perlin(seed, scale, octaves, offset, shape)", description: "generates Perlin noise" }, - "perlin_noise": { minArgs: 2, maxArgs: 5, snippet: "perlin_noise(seed, scale, octaves, offset, shape)", description: "generates Perlin noise" }, - "cellular": { minArgs: 2, maxArgs: 5, snippet: "cellular(seed, scale, jitter, offset, shape)", description: "generates Cellular/Voronoi noise" }, - "voronoi": { minArgs: 2, maxArgs: 5, snippet: "voronoi(seed, scale, jitter, offset, shape)", description: "generates Cellular/Voronoi noise" }, - "worley": { minArgs: 2, maxArgs: 5, snippet: "worley(seed, scale, jitter, offset, shape)", description: "generates Cellular/Voronoi noise" }, - "cellular_noise": { minArgs: 2, maxArgs: 5, snippet: "cellular_noise(seed, scale, jitter, offset, shape)", description: "generates Cellular/Voronoi noise" }, - "voronoi_noise": { minArgs: 2, maxArgs: 5, snippet: "voronoi_noise(seed, scale, jitter, offset, shape)", description: "generates Cellular/Voronoi noise" }, - "plasma": { minArgs: 2, maxArgs: 5, snippet: "plasma(seed, scale, octaves, offset, shape)", description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4" }, - "turbulence": { minArgs: 2, maxArgs: 5, snippet: "turbulence(seed, scale, octaves, offset, shape)", description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4" }, - "plasma_noise": { minArgs: 2, maxArgs: 5, snippet: "plasma_noise(seed, scale, octaves, offset, shape)", description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4" }, - "ridged": { minArgs: 2, maxArgs: 5, snippet: "ridged(seed, scale, octaves, offset, shape)", description: "generates ridged multi-fractal noise" }, - "ridged_noise": { minArgs: 2, maxArgs: 5, snippet: "ridged_noise(seed, scale, octaves, offset, shape)", description: "generates ridged multi-fractal noise" }, - "domain_warp": { minArgs: 4, maxArgs: 8, snippet: "domain_warp(seed, scale, warp_scale, warp_strength, octaves, warp_octaves, offset, shape)", description: "generates domain warped noise" }, - "domain_warp_noise": { minArgs: 4, maxArgs: 8, snippet: "domain_warp_noise(seed, scale, warp_scale, warp_strength, octaves, warp_octaves, offset, shape)", description: "generates domain warped noise" }, + "sin": { minArgs: 1, maxArgs: 1, signature: "sin(x)", args: ["x"], description: "applies sinus function to value or each element of value", details: "", aliases: [] }, + "cos": { minArgs: 1, maxArgs: 1, signature: "cos(x)", args: ["x"], description: "applies cosinus function to value or each element of value", details: "", aliases: [] }, + "tan": { minArgs: 1, maxArgs: 1, signature: "tan(x)", args: ["x"], description: "applies tangents function to value or each element of value", details: "", aliases: [] }, + "asin": { minArgs: 1, maxArgs: 1, signature: "asin(x)", args: ["x"], description: "applies arcus sinus function to value or each element of value", details: "", aliases: [] }, + "acos": { minArgs: 1, maxArgs: 1, signature: "acos(x)", args: ["x"], description: "applies arcus cosinus function to value or each element of value", details: "", aliases: [] }, + "atan": { minArgs: 1, maxArgs: 1, signature: "atan(x)", args: ["x"], description: "applies arcus tangents function to value or each element of value", details: "", aliases: [] }, + "atan2": { minArgs: 2, maxArgs: 2, signature: "atan2(y, x)", args: ["y", "x"], description: "computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant", details: "", aliases: [] }, + "sinh": { minArgs: 1, maxArgs: 1, signature: "sinh(x)", args: ["x"], description: "applies hyperbolic sinus function to value or each element of value", details: "", aliases: [] }, + "cosh": { minArgs: 1, maxArgs: 1, signature: "cosh(x)", args: ["x"], description: "applies hyperbolic cosinus function to value or each element of value", details: "", aliases: [] }, + "tanh": { minArgs: 1, maxArgs: 1, signature: "tanh(x)", args: ["x"], description: "applies hyperbolic tangents function to value or each element of value", details: "", aliases: [] }, + "asinh": { minArgs: 1, maxArgs: 1, signature: "asinh(x)", args: ["x"], description: "applies hyperbolic arcus sinus function to value or each element of value", details: "", aliases: [] }, + "acosh": { minArgs: 1, maxArgs: 1, signature: "acosh(x)", args: ["x"], description: "applies hyperbolic arcus cosinus function to value or each element of value", details: "", aliases: [] }, + "atanh": { minArgs: 1, maxArgs: 1, signature: "atanh(x)", args: ["x"], description: "applies hyperbolic arcus tangents function to value or each element of value", details: "", aliases: [] }, + "abs": { minArgs: 1, maxArgs: 1, signature: "abs(x)", args: ["x"], description: "applies per element absolute value function. Same as |x| for numbers.", details: "", aliases: [] }, + "sqrt": { minArgs: 1, maxArgs: 1, signature: "sqrt(x)", args: ["x"], description: "applies sqere root per element. Negative numbers return NaN (not a number)", details: "", aliases: [] }, + "ln": { minArgs: 1, maxArgs: 1, signature: "ln(x)", args: ["x"], description: "applies natural logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] }, + "log": { minArgs: 1, maxArgs: 1, signature: "log(x)", args: ["x"], description: "applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] }, + "log2": { minArgs: 1, maxArgs: 1, signature: "log2(x)", args: ["x"], description: "applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] }, + "exp": { minArgs: 1, maxArgs: 1, signature: "exp(x)", args: ["x"], description: "applies e^x to value (per element)", details: "", aliases: [] }, + "log1p": { minArgs: 1, maxArgs: 1, signature: "log1p(x)", args: ["x"], description: "applies ln(1+x) accurately for values near zero", details: "", aliases: [] }, + "expm1": { minArgs: 1, maxArgs: 1, signature: "expm1(x)", args: ["x"], description: "applies exp(x)-1 accurately for values near zero", details: "", aliases: [] }, + "sinc": { minArgs: 1, maxArgs: 1, signature: "sinc(x)", args: ["x"], description: "computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1", details: "", aliases: [] }, + "cbrt": { minArgs: 1, maxArgs: 1, signature: "cbrt(x)", args: ["x"], description: "computes the real cube root of each value, including negative values", details: "", aliases: [] }, + "reciprocal": { minArgs: 1, maxArgs: 1, signature: "reciprocal(x)", args: ["x"], description: "computes 1/x element-wise", details: "", aliases: [] }, + "logaddexp": { minArgs: 2, maxArgs: 2, signature: "logaddexp(x, y)", args: ["x", "y"], description: "computes log(exp(x) + exp(y)) element-wise using a numerically stable method", details: "", aliases: [] }, + "logsumexp": { minArgs: 1, maxArgs: 2, signature: "logsumexp(x, [dims])", args: ["x", "[dims]"], description: "computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions", details: "", aliases: [] }, + "norm": { minArgs: 1, maxArgs: 3, signature: "norm(x, [p], [dims])", args: ["x", "[p]", "[dims]"], description: "computes the p-norm globally or along one or more dimensions (default p=2)", details: "", aliases: [] }, + "normalize": { minArgs: 1, maxArgs: 4, signature: "normalize(x, [p], [dim], [eps])", args: ["x", "[p]", "[dim]", "[eps]"], description: "normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)", details: "", aliases: [] }, + "group_norm": { minArgs: 2, maxArgs: 5, signature: "group_norm(x, groups, [weight], [bias], [eps])", args: ["x", "groups", "[weight]", "[bias]", "[eps]"], description: "applies channel-first GroupNorm to [N, C, ...] input", details: "", aliases: [] }, + "outer": { minArgs: 2, maxArgs: 2, signature: "outer(x, y)", args: ["x", "y"], description: "computes the outer product of flattened x and y", details: "", aliases: [] }, + "trace": { minArgs: 1, maxArgs: 1, signature: "trace(x)", args: ["x"], description: "sums the main diagonal of each square matrix in x", details: "", aliases: [] }, + "det": { minArgs: 1, maxArgs: 1, signature: "det(x)", args: ["x"], description: "computes the determinant of each square matrix in x", details: "", aliases: [] }, + "rfft": { minArgs: 1, maxArgs: 2, signature: "rfft(x, [dim])", args: ["x", "[dim]"], description: "computes the one-dimensional real-input FFT along dim (default: last dimension)", details: "", aliases: [] }, + "irfft": { minArgs: 1, maxArgs: 3, signature: "irfft(x, [n], [dim])", args: ["x", "[n]", "[dim]"], description: "computes the inverse one-dimensional real FFT along dim (default: last dimension)", details: "", aliases: [] }, + "isnan": { minArgs: 1, maxArgs: 1, signature: "isnan(x)", args: ["x"], description: "returns 1.0 for NaN values and 0.0 otherwise", details: "", aliases: [] }, + "isinf": { minArgs: 1, maxArgs: 1, signature: "isinf(x)", args: ["x"], description: "returns 1.0 for infinite values and 0.0 otherwise", details: "", aliases: [] }, + "isfinite": { minArgs: 1, maxArgs: 1, signature: "isfinite(x)", args: ["x"], description: "returns 1.0 for finite values and 0.0 otherwise", details: "", aliases: [] }, + "smin": { minArgs: 1, maxArgs: null, signature: "smin(x, ...)", args: ["x", "..."], description: "computes the minimum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smin(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.", details: "", aliases: [] }, + "smax": { minArgs: 1, maxArgs: null, signature: "smax(x, ...)", args: ["x", "..."], description: "computes the maximum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smax(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.", details: "", aliases: [] }, + "tmin": { minArgs: 2, maxArgs: 2, signature: "tmin(x, y)", args: ["x", "y"], description: "elementwise minimum of tensor or list. min(x,y) when inputs are floats", details: "", aliases: [] }, + "tmax": { minArgs: 2, maxArgs: 2, signature: "tmax(x,y)", args: ["x", "y"], description: "elementwise maximum of tensor or list. max(x,y) when inputs are floats", details: "", aliases: [] }, + "tnorm": { minArgs: 1, maxArgs: 2, signature: "tnorm(x, [dim])", args: ["x", "[dim]"], description: "normalises tensor or list by multiplication such that sum(x^2)==1.0 for each slice. Defaults to the last dimension; dim selects a different slicing dimension.", details: "", aliases: [] }, + "snorm": { minArgs: 1, maxArgs: 2, signature: "snorm(x,[dim])", args: ["x", "[dim]"], description: "frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.", details: "", aliases: [] }, + "floor": { minArgs: 1, maxArgs: 1, signature: "floor(x)", args: ["x"], description: "returns the largest integer less than or equal to x", details: "", aliases: [] }, + "ceil": { minArgs: 1, maxArgs: 1, signature: "ceil(x)", args: ["x"], description: "returns the smallest integer greater than or equal to x", details: "", aliases: [] }, + "round": { minArgs: 1, maxArgs: 1, signature: "round(x)", args: ["x"], description: "rounds x to the nearest integer", details: "", aliases: [] }, + "gamma": { minArgs: 1, maxArgs: 1, signature: "gamma(x)", args: ["x"], description: "computes the gamma function (per element)", details: "", aliases: [] }, + "pow": { minArgs: 2, maxArgs: 2, signature: "pow(x, y)", args: ["x", "y"], description: "computes x raised to the power of y", details: "", aliases: [] }, + "sigm": { minArgs: 1, maxArgs: 1, signature: "sigm(x)", args: ["x"], description: "applies the sigmoid function: 1 / (1 + exp(-x))", details: "", aliases: [] }, + "clamp": { minArgs: 3, maxArgs: 3, signature: "clamp(x, min, max)", args: ["x", "min", "max"], description: "clamps x between min and max per element", details: "", aliases: [] }, + "fft": { minArgs: 1, maxArgs: 1, signature: "fft(x)", args: ["x"], description: "computes fast Fourier transform of x", details: "", aliases: [] }, + "ifft": { minArgs: 1, maxArgs: 2, signature: "ifft(x, [shape])", args: ["x", "[shape]"], description: "inverse fast Fourier transform of x. shape (defaults to the node's tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.", details: "", aliases: [] }, + "angle": { minArgs: 1, maxArgs: 1, signature: "angle(x)", args: ["x"], description: "returns the angle of a complex number or vector", details: "", aliases: [] }, + "print": { minArgs: 1, maxArgs: 1, signature: "print(x)", args: ["x"], description: "prints the value of x to the console while passing output unchanged", details: "", aliases: [] }, + "print_shape": { minArgs: 1, maxArgs: 1, signature: "print_shape(x)", args: ["x"], description: "prints the shape of the tensor x", details: "", aliases: ["pshp"] }, + "pshp": { minArgs: 1, maxArgs: 1, signature: "pshp(x)", args: ["x"], description: "prints the shape of the tensor x", details: "", aliases: ["print_shape"] }, + "nvl": { minArgs: 4, maxArgs: 4, signature: "nvl(x, nan, pos_inf, neg_inf)", args: ["x", "nan", "pos_inf", "neg_inf"], description: "null value replacement - inspired by NVL", details: "", aliases: ["nan_to_num"] }, + "nan_to_num": { minArgs: 4, maxArgs: 4, signature: "nan_to_num(x, nan, pos_inf, neg_inf)", args: ["x", "nan", "pos_inf", "neg_inf"], description: "null value replacement - inspired by NVL", details: "", aliases: ["nvl"] }, + "lerp": { minArgs: 3, maxArgs: 3, signature: "lerp(a, b, t)", args: ["a", "b", "t"], description: "linear interpolation between a and b by t per element. t can be float or tensor.", details: "", aliases: [] }, + "slerp": { minArgs: 3, maxArgs: 4, signature: "slerp(a, b, t, [dim])", args: ["a", "b", "t", "[dim]"], description: "interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.", details: "", aliases: [] }, + "step": { minArgs: 2, maxArgs: 2, signature: "step(x, edge)", args: ["x", "edge"], description: "returns 0 if x < edge, else 1", details: "", aliases: [] }, + "smoothstep": { minArgs: 3, maxArgs: 3, signature: "smoothstep(x, edge0, edge1)", args: ["x", "edge0", "edge1"], description: "smooth interpolation between edge0 and edge1", details: "", aliases: [] }, + "fract": { minArgs: 1, maxArgs: 1, signature: "fract(x)", args: ["x"], description: "returns the fractional part of x: x - floor(x)", details: "", aliases: [] }, + "relu": { minArgs: 1, maxArgs: 1, signature: "relu(x)", args: ["x"], description: "applies rectified linear unit function: max(0, x)", details: "", aliases: [] }, + "softsign": { minArgs: 1, maxArgs: 1, signature: "softsign(x)", args: ["x"], description: "applies x / (1 + abs(x)) element-wise", details: "", aliases: [] }, + "leaky_relu": { minArgs: 1, maxArgs: 2, signature: "leaky_relu(x, [negative_slope])", args: ["x", "[negative_slope]"], description: "applies leaky ReLU element-wise; negative_slope defaults to 0.01", details: "", aliases: [] }, + "softplus": { minArgs: 1, maxArgs: 1, signature: "softplus(x)", args: ["x"], description: "applies the softplus function: ln(1 + exp(x))", details: "", aliases: [] }, + "gelu": { minArgs: 1, maxArgs: 1, signature: "gelu(x)", args: ["x"], description: "applies the Gaussian Error Linear Unit (GELU) activation function", details: "", aliases: [] }, + "silu": { minArgs: 1, maxArgs: 1, signature: "silu(x)", args: ["x"], description: "applies the Sigmoid Linear Unit activation element-wise", details: "", aliases: [] }, + "sign": { minArgs: 1, maxArgs: 1, signature: "sign(x)", args: ["x"], description: "returns the sign of x: -1, 0, or 1", details: "", aliases: [] }, + "degrees": { minArgs: 1, maxArgs: 1, signature: "degrees(x)", args: ["x"], description: "converts radians to degrees (per element)", details: "", aliases: [] }, + "radians": { minArgs: 1, maxArgs: 1, signature: "radians(x)", args: ["x"], description: "converts degrees to radians (per element)", details: "", aliases: [] }, + "logical_not": { minArgs: 1, maxArgs: 1, signature: "logical_not(x)", args: ["x"], description: "returns 1.0 where x is zero and 0.0 otherwise", details: "", aliases: [] }, + "logical_and": { minArgs: 2, maxArgs: 2, signature: "logical_and(x, y)", args: ["x", "y"], description: "returns 1.0 if both values are non-zero, else 0.0", details: "", aliases: [] }, + "logical_or": { minArgs: 2, maxArgs: 2, signature: "logical_or(x, y)", args: ["x", "y"], description: "returns 1.0 if either value is non-zero, else 0.0", details: "", aliases: [] }, + "hypot": { minArgs: 2, maxArgs: 2, signature: "hypot(x, y)", args: ["x", "y"], description: "computes the element-wise Euclidean distance from the origin", details: "", aliases: [] }, + "map": { minArgs: 2, maxArgs: 4, signature: "map(tensor, coord1, [coord2], [coord3])", args: ["tensor", "coord1", "[coord2]", "[coord3]"], description: "samples/remaps input tensor using coordinates", details: "", aliases: [] }, + "ezconvolution": { minArgs: 2, maxArgs: null, signature: "ezconvolution(tensor, [kernel_sizes...], kernel)", args: ["tensor", "[kernel_sizes...]", "kernel"], description: "applies convolution with kernel. Attempts to correctly convolve over size dimensions.", details: "", aliases: ["ezconv"] }, + "ezconv": { minArgs: 2, maxArgs: null, signature: "ezconv(tensor, [kernel_sizes...], kernel)", args: ["tensor", "[kernel_sizes...]", "kernel"], description: "applies convolution with kernel. Attempts to correctly convolve over size dimensions.", details: "", aliases: ["ezconvolution"] }, + "convolution": { minArgs: 2, maxArgs: null, signature: "convolution(tensor, [kernel_sizes...], kernel)", args: ["tensor", "[kernel_sizes...]", "kernel"], description: "applies convolution with kernel. Expects [batch,channel, ...]", details: "", aliases: ["conv"] }, + "conv": { minArgs: 2, maxArgs: null, signature: "conv(tensor, [kernel_sizes...], kernel)", args: ["tensor", "[kernel_sizes...]", "kernel"], description: "applies convolution with kernel. Expects [batch,channel, ...]", details: "", aliases: ["convolution"] }, + "swap": { minArgs: 4, maxArgs: 4, signature: "swap(x, dim, idx1, idx2)", args: ["x", "dim", "idx1", "idx2"], description: "swaps elements along dim between idx1 and idx2", details: "", aliases: [] }, + "transpose": { minArgs: 3, maxArgs: 3, signature: "transpose(x, dim0, dim1) / transpose(x, dim0, dim1)", args: ["x", "dim0", "dim1"], description: "swaps two tensor dimensions", details: "", aliases: ["swapaxes"] }, + "swapaxes": { minArgs: 3, maxArgs: 3, signature: "swapaxes(x, dim0, dim1) / swapaxes(x, dim0, dim1)", args: ["x", "dim0", "dim1"], description: "swaps two tensor dimensions", details: "", aliases: ["transpose"] }, + "permute": { minArgs: 2, maxArgs: 2, signature: "permute(x, dims)", args: ["x", "dims"], description: "permutes the dimensions of tensor x according to dims", details: "", aliases: ["perm"] }, + "perm": { minArgs: 2, maxArgs: 2, signature: "perm(x, dims)", args: ["x", "dims"], description: "permutes the dimensions of tensor x according to dims", details: "", aliases: ["permute"] }, + "reshape": { minArgs: 2, maxArgs: 2, signature: "reshape(x, shape)", args: ["x", "shape"], description: "reshapes tensor x to the specified shape", details: "", aliases: ["rshp"] }, + "rshp": { minArgs: 2, maxArgs: 2, signature: "rshp(x, shape)", args: ["x", "shape"], description: "reshapes tensor x to the specified shape", details: "", aliases: ["reshape"] }, + "range": { minArgs: 3, maxArgs: 3, signature: "range(start, stop, step)", args: ["start", "stop", "step"], description: "creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.", details: "", aliases: [] }, + "linspace": { minArgs: 3, maxArgs: 3, signature: "linspace(start, stop, num)", args: ["start", "stop", "num"], description: "creates num linearly spaced values from start to stop (inclusive). Use range if you want to control the step between values.", details: "", aliases: [] }, + "logspace": { minArgs: 4, maxArgs: 4, signature: "logspace(start, stop, num, base)", args: ["start", "stop", "num", "base"], description: "creates logarithmically spaced values", details: "", aliases: [] }, + "topk": { minArgs: 2, maxArgs: 3, signature: "topk(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.", details: "", aliases: [] }, + "botk": { minArgs: 2, maxArgs: 3, signature: "botk(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.", details: "", aliases: [] }, + "pinv": { minArgs: 1, maxArgs: 1, signature: "pinv(x)", args: ["x"], description: "computes the permutative inverse of a list x (list must have uniqe elements) -- TODO: CHECK --", details: "", aliases: [] }, + "inv": { minArgs: 1, maxArgs: 2, signature: "inv(x, [pseudo])", args: ["x", "[pseudo]"], description: "computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead", details: "", aliases: [] }, + "sum": { minArgs: 1, maxArgs: 2, signature: "sum(x, [dims])", args: ["x", "[dims]"], description: "computes the sum of elements of x, optionally along one or more dimensions", details: "", aliases: [] }, + "mean": { minArgs: 1, maxArgs: 2, signature: "mean(x, [dims])", args: ["x", "[dims]"], description: "computes the arithmetic mean of elements of x globally or along one or more dimensions", details: "", aliases: [] }, + "std": { minArgs: 1, maxArgs: 2, signature: "std(x, [dims])", args: ["x", "[dims]"], description: "computes the sample standard deviation of elements of x globally or along one or more dimensions", details: "", aliases: [] }, + "var": { minArgs: 1, maxArgs: 2, signature: "var(x, [dims])", args: ["x", "[dims]"], description: "computes the sample variance of elements of x globally or along one or more dimensions", details: "", aliases: [] }, + "prod": { minArgs: 1, maxArgs: 2, signature: "prod(x, [dims])", args: ["x", "[dims]"], description: "computes the product of elements of x globally or along one or more dimensions", details: "", aliases: [] }, + "isclose": { minArgs: 2, maxArgs: 4, signature: "isclose(a, b, [rtol], [atol])", args: ["a", "b", "[rtol]", "[atol]"], description: "elementwise approximate equality test", details: "", aliases: [] }, + "allclose": { minArgs: 2, maxArgs: 4, signature: "allclose(a, b, [rtol], [atol])", args: ["a", "b", "[rtol]", "[atol]"], description: "returns 1.0 if all elements are approximately equal, else 0.0", details: "", aliases: [] }, + "quartile": { minArgs: 2, maxArgs: 3, signature: "quartile(x, q, [dim])", args: ["x", "q", "[dim]"], description: "computes the q-th quartile globally or along dim", details: "", aliases: ["quartil"] }, + "quartil": { minArgs: 2, maxArgs: 3, signature: "quartil(x, q, [dim])", args: ["x", "q", "[dim]"], description: "computes the q-th quartile globally or along dim", details: "", aliases: ["quartile"] }, + "percentile": { minArgs: 2, maxArgs: 3, signature: "percentile(x, p, [dim])", args: ["x", "p", "[dim]"], description: "computes the p-th percentile globally or along dim", details: "", aliases: ["prcnt"] }, + "prcnt": { minArgs: 2, maxArgs: 3, signature: "prcnt(x, p, [dim])", args: ["x", "p", "[dim]"], description: "computes the p-th percentile globally or along dim", details: "", aliases: ["percentile"] }, + "quantile": { minArgs: 2, maxArgs: 3, signature: "quantile(x, q, [dim])", args: ["x", "q", "[dim]"], description: "computes the q-th quantile globally or along dim", details: "", aliases: [] }, + "dot": { minArgs: 2, maxArgs: 2, signature: "dot(x, y)", args: ["x", "y"], description: "computes the dot product of x and y after flattening both to 1D. Use cross(x, y) if you need a per-vector product with the last dimension kept.", details: "", aliases: [] }, + "moment": { minArgs: 3, maxArgs: 3, signature: "moment(x, a, k)", args: ["x", "a", "k"], description: "computes the k-th moment of x around a", details: "", aliases: [] }, + "erf": { minArgs: 1, maxArgs: 1, signature: "erf(x)", args: ["x"], description: "computes the error function (torch.erf)", details: "", aliases: [] }, + "erfc": { minArgs: 1, maxArgs: 1, signature: "erfc(x)", args: ["x"], description: "computes the complementary error function (torch.special.erfc)", details: "", aliases: [] }, + "erfinv": { minArgs: 1, maxArgs: 1, signature: "erfinv(x)", args: ["x"], description: "computes the inverse error function (torch.erfinv)", details: "", aliases: [] }, + "any": { minArgs: 1, maxArgs: 1, signature: "any(x)", args: ["x"], description: "returns 1 if any element of x is non-zero otherwise 0", details: "", aliases: [] }, + "all": { minArgs: 1, maxArgs: 1, signature: "all(x)", args: ["x"], description: "returns 1 if all elements of x are non-zero otherwise 0", details: "", aliases: [] }, + "edge": { minArgs: 1, maxArgs: 2, signature: "edge(x, [matrix_size])", args: ["x", "[matrix_size]"], description: "detects edges in x. Matrix size denotes the size of edge detection matrix.", details: "", aliases: [] }, + "blur": { minArgs: 2, maxArgs: 3, signature: "blur(x, sigma, [reshape])", args: ["x", "sigma", "[reshape]"], description: "applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.", details: "", aliases: ["gaussian"] }, + "gaussian": { minArgs: 2, maxArgs: 3, signature: "gaussian(x, sigma, [reshape])", args: ["x", "sigma", "[reshape]"], description: "applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.", details: "", aliases: ["blur"] }, + "median": { minArgs: 1, maxArgs: 2, signature: "median(x, [dim])", args: ["x", "[dim]"], description: "computes the median globally or along one dimension", details: "", aliases: [] }, + "mode": { minArgs: 1, maxArgs: 2, signature: "mode(x, [dim])", args: ["x", "[dim]"], description: "computes the mode globally or along one dimension", details: "", aliases: [] }, + "cumsum": { minArgs: 1, maxArgs: 2, signature: "cumsum(x, [dim])", args: ["x", "[dim]"], description: "computes the cumulative sum, defaulting to the first dimension.", details: "", aliases: [] }, + "cumprod": { minArgs: 1, maxArgs: 1, signature: "cumprod(x)", args: ["x"], description: "computes the cumulative product over first dimension.", details: "", aliases: [] }, + "topk_ind": { minArgs: 2, maxArgs: 3, signature: "topk_ind(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the indices of the k largest elements along dim; dim defaults to the last", details: "", aliases: ["topk_indices"] }, + "topk_indices": { minArgs: 2, maxArgs: 3, signature: "topk_indices(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the indices of the k largest elements along dim; dim defaults to the last", details: "", aliases: ["topk_ind"] }, + "botk_ind": { minArgs: 2, maxArgs: 3, signature: "botk_ind(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the indices of the k smallest elements along dim; dim defaults to the last", details: "", aliases: ["botk_indices"] }, + "botk_indices": { minArgs: 2, maxArgs: 3, signature: "botk_indices(x, k, [dim])", args: ["x", "k", "[dim]"], description: "returns the indices of the k smallest elements along dim; dim defaults to the last", details: "", aliases: ["botk_ind"] }, + "cubic_ease": { minArgs: 3, maxArgs: 3, signature: "cubic_ease(a, b, t)", args: ["a", "b", "t"], description: "cubic ease between a and b", details: "", aliases: ["cubic"] }, + "cubic": { minArgs: 3, maxArgs: 3, signature: "cubic(a, b, t)", args: ["a", "b", "t"], description: "cubic ease between a and b", details: "", aliases: ["cubic_ease"] }, + "elastic_ease": { minArgs: 3, maxArgs: 3, signature: "elastic_ease(a, b, t)", args: ["a", "b", "t"], description: "elastic ease between a and b", details: "", aliases: ["elastic"] }, + "elastic": { minArgs: 3, maxArgs: 3, signature: "elastic(a, b, t)", args: ["a", "b", "t"], description: "elastic ease between a and b", details: "", aliases: ["elastic_ease"] }, + "sine_ease": { minArgs: 3, maxArgs: 3, signature: "sine_ease(a, b, t)", args: ["a", "b", "t"], description: "sine easing between a and b", details: "", aliases: ["sine"] }, + "sine": { minArgs: 3, maxArgs: 3, signature: "sine(a, b, t)", args: ["a", "b", "t"], description: "sine easing between a and b", details: "", aliases: ["sine_ease"] }, + "smootherstep": { minArgs: 3, maxArgs: 3, signature: "smootherstep(x, edge0, edge1)", args: ["x", "edge0", "edge1"], description: "smoother interpolation between edge0 and edge1", details: "", aliases: [] }, + "dist": { minArgs: 4, maxArgs: 4, signature: "dist(x1, y1, x2, y2)", args: ["x1", "y1", "x2", "y2"], description: "computes Euclidean distance between (x1, y1) and (x2, y2)", details: "", aliases: ["distance"] }, + "distance": { minArgs: 4, maxArgs: 4, signature: "distance(x1, y1, x2, y2)", args: ["x1", "y1", "x2", "y2"], description: "computes Euclidean distance between (x1, y1) and (x2, y2)", details: "", aliases: ["dist"] }, + "remap": { minArgs: 5, maxArgs: 5, signature: "remap(v, i_min, i_max, o_min, o_max)", args: ["v", "i_min", "i_max", "o_min", "o_max"], description: "remaps values from input range to output range", details: "", aliases: [] }, + "cossim": { minArgs: 2, maxArgs: 2, signature: "cossim(x, y)", args: ["x", "y"], description: "computes the cosine similarity between x and y.", details: "", aliases: ["cosine_similarity"] }, + "cosine_similarity": { minArgs: 2, maxArgs: 2, signature: "cosine_similarity(x, y)", args: ["x", "y"], description: "computes the cosine similarity between x and y.", details: "", aliases: ["cossim"] }, + "count": { minArgs: 1, maxArgs: 1, signature: "count(x)", args: ["x"], description: "returns the number of elements in x", details: "", aliases: ["cnt", "length"] }, + "cnt": { minArgs: 1, maxArgs: 1, signature: "cnt(x)", args: ["x"], description: "returns the number of elements in x", details: "", aliases: ["count", "length"] }, + "length": { minArgs: 1, maxArgs: 1, signature: "length(x)", args: ["x"], description: "returns the number of elements in x", details: "", aliases: ["count", "cnt"] }, + "keys": { minArgs: 1, maxArgs: 1, signature: "keys(x)", args: ["x"], description: "returns a list of dictionary keys in insertion order", details: "", aliases: [] }, + "enable_tracking": { minArgs: 1, maxArgs: 1, signature: "enable_tracking(d)", args: ["d"], description: "enables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_on"] }, + "track_on": { minArgs: 1, maxArgs: 1, signature: "track_on(d)", args: ["d"], description: "enables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["enable_tracking"] }, + "disable_tracking": { minArgs: 1, maxArgs: 1, signature: "disable_tracking(d)", args: ["d"], description: "disables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_off"] }, + "track_off": { minArgs: 1, maxArgs: 1, signature: "track_off(d)", args: ["d"], description: "disables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["disable_tracking"] }, + "reset_tracking": { minArgs: 1, maxArgs: 1, signature: "reset_tracking(d)", args: ["d"], description: "resets change tracking state for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_reset"] }, + "track_reset": { minArgs: 1, maxArgs: 1, signature: "track_reset(d)", args: ["d"], description: "resets change tracking state for ChangeTrackingDict d (returns d)", details: "", aliases: ["reset_tracking"] }, + "get_changed_keys": { minArgs: 1, maxArgs: 1, signature: "get_changed_keys(d)", args: ["d"], description: "returns list of keys that were modified or added in ChangeTrackingDict d", details: "", aliases: ["changed_keys"] }, + "changed_keys": { minArgs: 1, maxArgs: 1, signature: "changed_keys(d)", args: ["d"], description: "returns list of keys that were modified or added in ChangeTrackingDict d", details: "", aliases: ["get_changed_keys"] }, + "get_added_keys": { minArgs: 1, maxArgs: 1, signature: "get_added_keys(d)", args: ["d"], description: "returns list of keys that were added (newly created) in ChangeTrackingDict d", details: "", aliases: ["added_keys"] }, + "added_keys": { minArgs: 1, maxArgs: 1, signature: "added_keys(d)", args: ["d"], description: "returns list of keys that were added (newly created) in ChangeTrackingDict d", details: "", aliases: ["get_added_keys"] }, + "get_removed_keys": { minArgs: 1, maxArgs: 1, signature: "get_removed_keys(d)", args: ["d"], description: "returns list of keys that were removed from ChangeTrackingDict d", details: "", aliases: ["removed_keys"] }, + "removed_keys": { minArgs: 1, maxArgs: 1, signature: "removed_keys(d)", args: ["d"], description: "returns list of keys that were removed from ChangeTrackingDict d", details: "", aliases: ["get_removed_keys"] }, + "get_unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "get_unchanged_keys(d)", args: ["d"], description: "returns list of keys that remain unchanged in ChangeTrackingDict d", details: "", aliases: ["unchanged_keys"] }, + "unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "unchanged_keys(d)", args: ["d"], description: "returns list of keys that remain unchanged in ChangeTrackingDict d", details: "", aliases: ["get_unchanged_keys"] }, + "repeat": { minArgs: 2, maxArgs: 3, signature: "repeat(x, count, [dims])", args: ["x", "count", "[dims]"], description: "repeats tensor elements; count may be scalar or per-dim list", details: "", aliases: [] }, + "flatten": { minArgs: 1, maxArgs: 1, signature: "flatten(x)", args: ["x"], description: "flattens tensor into a 1D tensor", details: "", aliases: [] }, + "append": { minArgs: 2, maxArgs: 2, signature: "append(x, y)", args: ["x", "y"], description: "appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)", details: "", aliases: [] }, + "get_value": { minArgs: 2, maxArgs: 2, signature: "get_value(tensor, position)", args: ["tensor", "position"], description: "reads the value at an N-D position of tensor. Superseded by tensor[position] indexing", details: "", aliases: [] }, + "flow_apply": { minArgs: 2, maxArgs: 2, signature: "flow_apply(image, flow)", args: ["image", "flow"], description: "applies optical flow to an image", details: "", aliases: [] }, + "batch_shuffle": { minArgs: 2, maxArgs: 2, signature: "batch_shuffle(x, indices)", args: ["x", "indices"], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["shuffle", "select"] }, + "shuffle": { minArgs: 2, maxArgs: 2, signature: "shuffle(x, indices)", args: ["x", "indices"], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["batch_shuffle", "select"] }, + "select": { minArgs: 2, maxArgs: 2, signature: "select(x, indices)", args: ["x", "indices"], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["batch_shuffle", "shuffle"] }, + "motion_mask": { minArgs: 1, maxArgs: 1, signature: "motion_mask(x)", args: ["x"], description: "generates a motion mask from optical flow", details: "", aliases: [] }, + "flow_to_image": { minArgs: 1, maxArgs: 1, signature: "flow_to_image(x)", args: ["x"], description: "converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta.", details: "", aliases: [] }, + "flow_mag": { minArgs: 1, maxArgs: 1, signature: "flow_mag(x)", args: ["x"], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", aliases: ["flow_magnitude"] }, + "flow_magnitude": { minArgs: 1, maxArgs: 1, signature: "flow_magnitude(x)", args: ["x"], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", aliases: ["flow_mag"] }, + "flow_ang": { minArgs: 1, maxArgs: 1, signature: "flow_ang(x)", args: ["x"], description: "computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)", details: "", aliases: ["flow_angle"] }, + "flow_angle": { minArgs: 1, maxArgs: 1, signature: "flow_angle(x)", args: ["x"], description: "computes the angle of optical flow (basically angle() but real and imaginery is separate in 2 dimensions)", details: "", aliases: ["flow_ang"] }, + "where": { minArgs: 3, maxArgs: 3, signature: "where(condition, x, y)", args: ["condition", "x", "y"], description: "returns x if condition is true, else y. Runs per element.", details: "", aliases: [] }, + "histogram": { minArgs: 4, maxArgs: 4, signature: "histogram(x, bins, min, max)", args: ["x", "bins", "min", "max"], description: "computes histogram", details: "", aliases: ["hist"] }, + "hist": { minArgs: 4, maxArgs: 4, signature: "hist(x, bins, min, max)", args: ["x", "bins", "min", "max"], description: "computes histogram", details: "", aliases: ["histogram"] }, + "overlay": { minArgs: 3, maxArgs: 4, signature: "overlay(base, overlay, offset, [opacity])", args: ["base", "overlay", "offset", "[opacity]"], description: "overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.", details: "", aliases: [] }, + "pad": { minArgs: 2, maxArgs: 2, signature: "pad(x, padding)", args: ["x", "padding"], description: "pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)", details: "", aliases: [] }, + "cross": { minArgs: 2, maxArgs: 2, signature: "cross(x, y)", args: ["x", "y"], description: "computes the cross product of x and y. Last dimension must be 3", details: "", aliases: [] }, + "matmul": { minArgs: 2, maxArgs: 2, signature: "matmul(x, y)", args: ["x", "y"], description: "computes the matrix multiplication of x and y", details: "", aliases: [] }, + "solve": { minArgs: 2, maxArgs: 2, signature: "solve(A, b)", args: ["A", "b"], description: "solves the square linear system A*x=b without explicitly forming A inverse", details: "", aliases: [] }, + "matrix_rank": { minArgs: 1, maxArgs: 2, signature: "matrix_rank(x, [tol])", args: ["x", "[tol]"], description: "computes the numerical rank of each matrix using optional absolute tolerance tol", details: "", aliases: [] }, + "rife": { minArgs: 2, maxArgs: 5, signature: "rife(image1, image2, [tiling_size], [iterations], [multi_scale])", args: ["image1", "image2", "[tiling_size]", "[iterations]", "[multi_scale]"], description: "computes the optical flow field ([H, W, 2]) between image1 and image2 using a RAFT-based model", details: "- tiling_size: chuncks image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution\n- iterations: how many times to run the flow model. Default 12\n- multi_scale: also use low resolution of base image for giant movements. Default false", aliases: [] }, + "bnot": { minArgs: 1, maxArgs: 1, signature: "bnot(x)", args: ["x"], description: "computes the bitwise NOT", details: "", aliases: ["bitwise_not"] }, + "bitwise_not": { minArgs: 1, maxArgs: 1, signature: "bitwise_not(x)", args: ["x"], description: "computes the bitwise NOT", details: "", aliases: ["bnot"] }, + "bitcount": { minArgs: 1, maxArgs: 1, signature: "bitcount(x)", args: ["x"], description: "returns the number of set bits", details: "", aliases: ["popcount", "popcnt"] }, + "popcount": { minArgs: 1, maxArgs: 1, signature: "popcount(x)", args: ["x"], description: "returns the number of set bits", details: "", aliases: ["bitcount", "popcnt"] }, + "popcnt": { minArgs: 1, maxArgs: 1, signature: "popcnt(x)", args: ["x"], description: "returns the number of set bits", details: "", aliases: ["bitcount", "popcount"] }, + "shape": { minArgs: 1, maxArgs: 1, signature: "shape(x)", args: ["x"], description: "returns the shape of tensor as a list", details: "", aliases: [] }, + "band": { minArgs: 2, maxArgs: 2, signature: "band(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise AND of x and y", details: "", aliases: ["bitwise_and"] }, + "bitwise_and": { minArgs: 2, maxArgs: 2, signature: "bitwise_and(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise AND of x and y", details: "", aliases: ["band"] }, + "bxor": { minArgs: 2, maxArgs: 2, signature: "bxor(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise XOR of x and y", details: "", aliases: ["bitwise_xor"] }, + "bitwise_xor": { minArgs: 2, maxArgs: 2, signature: "bitwise_xor(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise XOR of x and y", details: "", aliases: ["bxor"] }, + "bor": { minArgs: 2, maxArgs: 2, signature: "bor(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise OR of x and y", details: "", aliases: ["bitwise_or"] }, + "bitwise_or": { minArgs: 2, maxArgs: 2, signature: "bitwise_or(x, y)", args: ["x", "y"], description: "computes the element-wise bitwise OR of x and y", details: "", aliases: ["bor"] }, + "tensor": { minArgs: 1, maxArgs: 3, signature: "tensor(shape, [value], [dtype_template])", args: ["shape", "[value]", "[dtype_template]"], description: "creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32", details: "", aliases: [] }, + "zeros": { minArgs: 1, maxArgs: 2, signature: "zeros(shape, [dtype_template])", args: ["shape", "[dtype_template]"], description: "creates a zero-filled tensor on the current device", details: "", aliases: [] }, + "ones": { minArgs: 1, maxArgs: 2, signature: "ones(shape, [dtype_template])", args: ["shape", "[dtype_template]"], description: "creates a one-filled tensor on the current device", details: "", aliases: [] }, + "eye": { minArgs: 1, maxArgs: 2, signature: "eye(n, [dtype_template])", args: ["n", "[dtype_template]"], description: "creates an n-by-n identity matrix", details: "", aliases: [] }, + "one_hot": { minArgs: 2, maxArgs: 2, signature: "one_hot(indices, classes)", args: ["indices", "classes"], description: "converts integer class indices to float32 one-hot vectors", details: "", aliases: [] }, + "mse": { minArgs: 2, maxArgs: 3, signature: "mse(a, b, [reduction])", args: ["a", "b", "[reduction]"], description: "mean squared error; reduction is mean (default), sum, or none", details: "", aliases: [] }, + "mae": { minArgs: 2, maxArgs: 3, signature: "mae(a, b, [reduction])", args: ["a", "b", "[reduction]"], description: "mean absolute error; reduction is mean (default), sum, or none", details: "", aliases: [] }, + "psnr": { minArgs: 2, maxArgs: 3, signature: "psnr(a, b, [data_range])", args: ["a", "b", "[data_range]"], description: "peak signal-to-noise ratio in dB; data_range defaults to 1", details: "", aliases: [] }, + "weighted_mean": { minArgs: 2, maxArgs: 3, signature: "weighted_mean(x, weights, [dims])", args: ["x", "weights", "[dims]"], description: "computes the weighted mean globally or along one or more dimensions", details: "", aliases: [] }, + "huber_loss": { minArgs: 2, maxArgs: 4, signature: "huber_loss(prediction, target, [delta], [reduction])", args: ["prediction", "target", "[delta]", "[reduction]"], description: "computes Huber loss; delta defaults to 1 and reduction to mean", details: "", aliases: [] }, + "cross_entropy": { minArgs: 2, maxArgs: 4, signature: "cross_entropy(logits, target, [dim], [reduction])", args: ["logits", "target", "[dim]", "[reduction]"], description: "computes cross-entropy from class logits and class indices or target probabilities", details: "", aliases: [] }, + "add_key": { minArgs: 3, maxArgs: 3, signature: "add_key(dict, key, value)", args: ["dict", "key", "value"], description: "adds or replaces a dictionary entry and returns the updated dictionary", details: "", aliases: [] }, + "remove_key": { minArgs: 2, maxArgs: 2, signature: "remove_key(dict, key)", args: ["dict", "key"], description: "removes a dictionary entry and returns the updated dictionary", details: "", aliases: ["rm_key"] }, + "rm_key": { minArgs: 2, maxArgs: 2, signature: "rm_key(dict, key)", args: ["dict", "key"], description: "removes a dictionary entry and returns the updated dictionary", details: "", aliases: ["remove_key"] }, + "stack_push": { minArgs: 2, maxArgs: 2, signature: "stack_push(slot, val)", args: ["slot", "val"], description: "pushes val onto the end of slot stack", details: "", aliases: [] }, + "stack_pop": { minArgs: 1, maxArgs: 1, signature: "stack_pop(slot)", args: ["slot"], description: "removes and returns the last element of slot stack", details: "", aliases: [] }, + "stack_clear": { minArgs: 1, maxArgs: 1, signature: "stack_clear(slot)", args: ["slot"], description: "clears the contents of slot stack", details: "", aliases: [] }, + "stack_has": { minArgs: 1, maxArgs: 1, signature: "stack_has(slot)", args: ["slot"], description: "returns 1.0 if slot exists in stack and is not empty else returns 0.0", details: "", aliases: [] }, + "stack_get": { minArgs: 1, maxArgs: 1, signature: "stack_get(slot)", args: ["slot"], description: "returns the last pushed value in slot without popping it", details: "", aliases: [] }, + "cat": { minArgs: 2, maxArgs: null, signature: "cat(x, ..., dim)", args: ["x", "...", "dim"], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["concat", "concatenate"] }, + "concat": { minArgs: 2, maxArgs: null, signature: "concat(x, ..., dim)", args: ["x", "...", "dim"], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["cat", "concatenate"] }, + "concatenate": { minArgs: 2, maxArgs: null, signature: "concatenate(x, ..., dim)", args: ["x", "...", "dim"], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["cat", "concat"] }, + "stack": { minArgs: 1, maxArgs: 2, signature: "stack(tensors, [dim])", args: ["tensors", "[dim]"], description: "stacks a list of tensors along a new dimension", details: "", aliases: [] }, + "nonzero": { minArgs: 1, maxArgs: 1, signature: "nonzero(x)", args: ["x"], description: "returns an N-by-rank tensor of coordinates for nonzero elements", details: "", aliases: [] }, + "int": { minArgs: 1, maxArgs: 1, signature: "int(x)", args: ["x"], description: "casts x to integer", details: "", aliases: [] }, + "float": { minArgs: 1, maxArgs: 1, signature: "float(x)", args: ["x"], description: "casts x to float", details: "", aliases: [] }, + "upper": { minArgs: 1, maxArgs: 1, signature: "upper(x)", args: ["x"], description: "converts string to uppercase", details: "", aliases: [] }, + "lower": { minArgs: 1, maxArgs: 1, signature: "lower(x)", args: ["x"], description: "converts string to lowercase", details: "", aliases: [] }, + "trim": { minArgs: 1, maxArgs: 1, signature: "trim(x)", args: ["x"], description: "removes leading and trailing whitespace from string", details: "", aliases: [] }, + "split": { minArgs: 1, maxArgs: 2, signature: "split(x, [delimiter])", args: ["x", "[delimiter]"], description: "splits string to list of strings based on delimiter. Default is space.", details: "", aliases: [] }, + "join": { minArgs: 1, maxArgs: 2, signature: "join(x, [separator])", args: ["x", "[separator]"], description: "joins strings in list using separator. Defalut separator is \"\". If you want to join tensors use concatinate(...)", details: "", aliases: [] }, + "substring": { minArgs: 2, maxArgs: 3, signature: "substring(s, start, [length])", args: ["s", "start", "[length]"], description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string", details: "", aliases: ["substr"] }, + "substr": { minArgs: 2, maxArgs: 3, signature: "substr(s, start, [length])", args: ["s", "start", "[length]"], description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string", details: "", aliases: ["substring"] }, + "find": { minArgs: 2, maxArgs: 2, signature: "find(s, sub)", args: ["s", "sub"], description: "returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings.", details: "", aliases: [] }, + "replace": { minArgs: 3, maxArgs: 3, signature: "replace(s, old, new)", args: ["s", "old", "new"], description: "replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.", details: "", aliases: [] }, + "dilate": { minArgs: 1, maxArgs: 2, signature: "dilate(x, [kernel])", args: ["x", "[kernel]"], description: "applies dilation to x. kernel is optional.", details: "", aliases: [] }, + "erode": { minArgs: 1, maxArgs: 2, signature: "erode(x, [kernel])", args: ["x", "[kernel]"], description: "applies erosion to x. kernel is size of used matrix.", details: "", aliases: [] }, + "morph_open": { minArgs: 1, maxArgs: 2, signature: "morph_open(x, [kernel])", args: ["x", "[kernel]"], description: "applies morphological opening to x. kernel is size of used matrix.", details: "", aliases: [] }, + "morph_close": { minArgs: 1, maxArgs: 2, signature: "morph_close(x, [kernel])", args: ["x", "[kernel]"], description: "applies morphological closing to x. kernel is size of used matrix.", details: "", aliases: [] }, + "rgb_to_oklab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_oklab(r, [g], [b])", args: ["r", "[g]", "[b]"], description: "converts RGB to OKLab. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.", details: "", aliases: [] }, + "rgb_to_cielab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_cielab(r, [g], [b])", args: ["r", "[g]", "[b]"], description: "converts RGB to CIELAB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.", details: "", aliases: [] }, + "oklab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)", args: ["oklab"], description: "converts OKLab to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.", details: "", aliases: [] }, + "cielab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)", args: ["cielab"], description: "converts CIELAB to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.", details: "", aliases: [] }, + "rgb_to_hsv": { minArgs: 1, maxArgs: 4, signature: "rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees])", args: ["rgb", "[degrees]"], description: "converts RGB to HSV. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting. If degrees is specified and nonzero it returns hue as 0-360 instead of 0-1", details: "", aliases: [] }, + "hsv_to_rgb": { minArgs: 1, maxArgs: 4, signature: "hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees])", args: ["hsv", "[degrees]"], description: "converts HSV to RGB. It has 2 modes. Aither 1 or 3 parameters. With 1 parameter it expects last dimension of 3 and with 3 it concatinates them after converting.", details: "", aliases: [] }, + "int_to_rgb": { minArgs: 1, maxArgs: 1, signature: "int_to_rgb(val)", args: ["val"], description: "converts an integer to an RGB color. If input is tensor it stacks the resulting R, G and B tensors using last dimension. If It is list, List of lists is returned and if value, 3 long list is returned.", details: "", aliases: [] }, + "rgb_to_int": { minArgs: 1, maxArgs: 3, signature: "rgb_to_int(r, [g, b])", args: ["r", "[g", "b]"], description: "converts RGB components to an integer It uses last dimension of tensor (or list) as R,G,B if one value. Othervise uses whole thing as channel.", details: "", aliases: [] }, + "interpolate_linear": { minArgs: 2, maxArgs: 2, signature: "interpolate_linear(x, y)", args: ["x", "y"], description: "performs linear interpolation on X. Assumes that dim 0 is batch and dim 1 = channel", details: "", aliases: [] }, + "interpolate_area": { minArgs: 2, maxArgs: 2, signature: "interpolate_area(x, y)", args: ["x", "y"], description: "performs area interpolation X. Assumes that dim 0 is batch and dim 1 = channel", details: "", aliases: [] }, + "interpolate_nearest": { minArgs: 2, maxArgs: 2, signature: "interpolate_nearest(x, y)", args: ["x", "y"], description: "performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel", details: "", aliases: ["interpolate_nearest_exact"] }, + "interpolate_nearest_exact": { minArgs: 2, maxArgs: 2, signature: "interpolate_nearest_exact(x, y)", args: ["x", "y"], description: "performs nearest neighbor interpolation X. Assumes that dim 0 is batch and dim 1 = channel", details: "", aliases: ["interpolate_nearest"] }, + "text_image": { minArgs: 3, maxArgs: 9, signature: "text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline])", args: ["text", "font", "size", "[max_width]", "[weight]", "[rotation_angle]", "[line_spacing]", "[italic]", "[underline]"], description: "renders text to an 2D tensor", details: "", aliases: [] }, + "as_nested_tensor": { minArgs: 1, maxArgs: 1, signature: "as_nested_tensor(x)", args: ["x"], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", aliases: ["as_nested"] }, + "as_nested": { minArgs: 1, maxArgs: 1, signature: "as_nested(x)", args: ["x"], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", aliases: ["as_nested_tensor"] }, + "svd": { minArgs: 1, maxArgs: 2, signature: "svd(x, [full_matrices])", args: ["x", "[full_matrices]"], description: "computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)", details: "", aliases: ["singular_value_decomposition"] }, + "singular_value_decomposition": { minArgs: 1, maxArgs: 2, signature: "singular_value_decomposition(x, [full_matrices])", args: ["x", "[full_matrices]"], description: "computes the singular value decomposition of x. Returns a list of 3 tensors: U, S, V such that x = matmul(matmul(U, diagonal_matrix(S,shape(U))), V)", details: "", aliases: ["svd"] }, + "diagonal_matrix": { minArgs: 2, maxArgs: 5, signature: "diagonal_matrix(x, shape, [offset], [dim1], [dim2])", args: ["x", "shape", "[offset]", "[dim1]", "[dim2]"], description: "creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.", details: "", aliases: ["diag"] }, + "diag": { minArgs: 2, maxArgs: 5, signature: "diag(x, shape, [offset], [dim1], [dim2])", args: ["x", "shape", "[offset]", "[dim1]", "[dim2]"], description: "creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.", details: "", aliases: ["diagonal_matrix"] }, + "timestamp": { minArgs: 0, maxArgs: 0, signature: "timestamp()", args: [], description: "returns the current system timestamp", details: "", aliases: ["now"] }, + "now": { minArgs: 0, maxArgs: 0, signature: "now()", args: [], description: "returns the current system timestamp", details: "", aliases: ["timestamp"] }, + "sort": { minArgs: 1, maxArgs: 3, signature: "sort(x, [desc], [dim])", args: ["x", "[desc]", "[dim]"], description: "returns a sorted version of x (If input is tensor, it sorts the last dimension)", details: "", aliases: [] }, + "argsort": { minArgs: 1, maxArgs: 3, signature: "argsort(x, [desc], [dim])", args: ["x", "[desc]", "[dim]"], description: "returns the indices that would sort x. desc defaults to ascending and dim defaults to the last dimension.", details: "", aliases: [] }, + "argmin": { minArgs: 1, maxArgs: 3, signature: "argmin(x, [as_position], [dim])", args: ["x", "[as_position]", "[dim]"], description: "returns the minimum index globally or along dim; as_position returns global coordinates", details: "", aliases: [] }, + "argmax": { minArgs: 1, maxArgs: 3, signature: "argmax(x, [as_position], [dim])", args: ["x", "[as_position]", "[dim]"], description: "returns the maximum index globally or along dim; as_position returns global coordinates", details: "", aliases: [] }, + "softmax": { minArgs: 1, maxArgs: 2, signature: "softmax(x, [axis])", args: ["x", "[axis]"], description: "applies the softmax function to x (sum of slice == 1.0 and max value <= 1.0). axis defaults to last.", details: "", aliases: [] }, + "softmin": { minArgs: 1, maxArgs: 2, signature: "softmin(x, [axis])", args: ["x", "[axis]"], description: "applies the softmin function to x (same as softmax(-x,[axis])). axis defaults to last.", details: "", aliases: [] }, + "unique": { minArgs: 1, maxArgs: 1, signature: "unique(x)", args: ["x"], description: "returns the unique elements (sorted, flatened)", details: "", aliases: [] }, + "flip": { minArgs: 2, maxArgs: 2, signature: "flip(x, dims)", args: ["x", "dims"], description: "reverses the order of elements along the specified dimensions. Works also for text and list with dims=0", details: "", aliases: [] }, + "startswith": { minArgs: 2, maxArgs: 2, signature: "startswith(text, prefix)", args: ["text", "prefix"], description: "returns 1 if text starts with prefix, else 0", details: "", aliases: [] }, + "endswith": { minArgs: 2, maxArgs: 2, signature: "endswith(text, suffix)", args: ["text", "suffix"], description: "returns 1 if text ends with suffix, else 0", details: "", aliases: [] }, + "squeeze": { minArgs: 1, maxArgs: 2, signature: "squeeze(x, [dim])", args: ["x", "[dim]"], description: "removes size-1 dimensions from tensor x, optionally at dim", details: "", aliases: [] }, + "unsqueeze": { minArgs: 2, maxArgs: 2, signature: "unsqueeze(x, dim)", args: ["x", "dim"], description: "inserts a size-1 dimension into tensor x at dim", details: "", aliases: [] }, + "roll": { minArgs: 2, maxArgs: 3, signature: "roll(x, shifts, [axis])", args: ["x", "shifts", "[axis]"], description: "rolls tensor x along axis", details: "", aliases: [] }, + "cov": { minArgs: 2, maxArgs: 2, signature: "cov(x, y)", args: ["x", "y"], description: "computes the covariance matrix of x and y", details: "", aliases: [] }, + "corr": { minArgs: 2, maxArgs: 2, signature: "corr(x, y)", args: ["x", "y"], description: "computes the correlation between x and y", details: "", aliases: ["correlation"] }, + "correlation": { minArgs: 2, maxArgs: 2, signature: "correlation(x, y)", args: ["x", "y"], description: "computes the correlation between x and y", details: "", aliases: ["corr"] }, + "entropy": { minArgs: 1, maxArgs: 1, signature: "entropy(x)", args: ["x"], description: "computes shanon entropy", details: "", aliases: [] }, + "crop": { minArgs: 3, maxArgs: 3, signature: "crop(x, start, size)", args: ["x", "start", "size"], description: "crops tensor x. Take size and begin at start. start should be the low corner. The result is at most size (if size is bigger then rest of tensor).", details: "", aliases: [] }, + "coords": { minArgs: 2, maxArgs: 3, signature: "coords(shape, dim, [dtype])", args: ["shape", "dim", "[dtype]"], description: "generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor.", details: "", aliases: ["coordinates"] }, + "coordinates": { minArgs: 2, maxArgs: 3, signature: "coordinates(shape, dim, [dtype])", args: ["shape", "dim", "[dtype]"], description: "generates a tensor with the specified shape whose values are the coordinates of each element along the specified dimension. The dtype can be specified to control the data type of the output tensor.", details: "", aliases: ["coords"] }, + "gather": { minArgs: 3, maxArgs: 3, signature: "gather(x, dim, idx)", args: ["x", "dim", "idx"], description: "gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.", details: "", aliases: [] }, + "scatter": { minArgs: 4, maxArgs: 4, signature: "scatter(x, dim, idx, src)", args: ["x", "dim", "idx", "src"], description: "scatters elements from src into x along dim using the indices specified in idx. The output tensor has the same shape as x.", details: "", aliases: [] }, + "scatter_add": { minArgs: 4, maxArgs: 4, signature: "scatter_add(x, dim, idx, src)", args: ["x", "dim", "idx", "src"], description: "scatters elements from src into x along dim using the indices specified in idx, adding to existing values. The output tensor has the same shape as x.", details: "", aliases: [] }, + "noise": { minArgs: 1, maxArgs: 2, signature: "noise(seed, [shape])", args: ["seed", "[shape]"], description: "generates normally distributed random noise", details: "", aliases: ["randn", "random_normal"] }, + "randn": { minArgs: 1, maxArgs: 2, signature: "randn(seed, [shape])", args: ["seed", "[shape]"], description: "generates normally distributed random noise", details: "", aliases: ["noise", "random_normal"] }, + "random_normal": { minArgs: 1, maxArgs: 2, signature: "random_normal(seed, [shape])", args: ["seed", "[shape]"], description: "generates normally distributed random noise", details: "", aliases: ["noise", "randn"] }, + "pink_noise": { minArgs: 1, maxArgs: 2, signature: "pink_noise(seed, [shape])", args: ["seed", "[shape]"], description: "generates deterministic pink noise (approximately 1/f power spectrum), normalised per row", details: "", aliases: ["pink"] }, + "pink": { minArgs: 1, maxArgs: 2, signature: "pink(seed, [shape])", args: ["seed", "[shape]"], description: "generates deterministic pink noise (approximately 1/f power spectrum), normalised per row", details: "", aliases: ["pink_noise"] }, + "brown_noise": { minArgs: 1, maxArgs: 2, signature: "brown_noise(seed, [shape])", args: ["seed", "[shape]"], description: "generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row", details: "", aliases: ["brown"] }, + "brown": { minArgs: 1, maxArgs: 2, signature: "brown(seed, [shape])", args: ["seed", "[shape]"], description: "generates deterministic brown noise (approximately 1/f^2 power spectrum), normalised per row", details: "", aliases: ["brown_noise"] }, + "rand": { minArgs: 1, maxArgs: 2, signature: "rand(seed, [shape])", args: ["seed", "[shape]"], description: "generates uniformly distributed random noise", details: "", aliases: ["randu", "random_uniform"] }, + "randu": { minArgs: 1, maxArgs: 2, signature: "randu(seed, [shape])", args: ["seed", "[shape]"], description: "generates uniformly distributed random noise", details: "", aliases: ["rand", "random_uniform"] }, + "random_uniform": { minArgs: 1, maxArgs: 2, signature: "random_uniform(seed, [shape])", args: ["seed", "[shape]"], description: "generates uniformly distributed random noise", details: "", aliases: ["rand", "randu"] }, + "randc": { minArgs: 3, maxArgs: 4, signature: "randc(seed, median, sigma, [shape])", args: ["seed", "median", "sigma", "[shape]"], description: "generates Cauchy distributed random values.", details: "", aliases: ["random_cauchy"] }, + "random_cauchy": { minArgs: 3, maxArgs: 4, signature: "random_cauchy(seed, median, sigma, [shape])", args: ["seed", "median", "sigma", "[shape]"], description: "generates Cauchy distributed random values.", details: "", aliases: ["randc"] }, + "rande": { minArgs: 2, maxArgs: 3, signature: "rande(seed, lambda, [shape])", args: ["seed", "lambda", "[shape]"], description: "generates exponentially distributed random values", details: "", aliases: ["random_exponential"] }, + "random_exponential": { minArgs: 2, maxArgs: 3, signature: "random_exponential(seed, lambda, [shape])", args: ["seed", "lambda", "[shape]"], description: "generates exponentially distributed random values", details: "", aliases: ["rande"] }, + "randln": { minArgs: 3, maxArgs: 4, signature: "randln(seed, mean, std, [shape])", args: ["seed", "mean", "std", "[shape]"], description: "generates log-normally distributed random values.", details: "", aliases: ["random_log_normal"] }, + "random_log_normal": { minArgs: 3, maxArgs: 4, signature: "random_log_normal(seed, mean, std, [shape])", args: ["seed", "mean", "std", "[shape]"], description: "generates log-normally distributed random values.", details: "", aliases: ["randln"] }, + "randb": { minArgs: 2, maxArgs: 3, signature: "randb(seed, probability, [shape])", args: ["seed", "probability", "[shape]"], description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor", details: "", aliases: ["random_bernoulli"] }, + "random_bernoulli": { minArgs: 2, maxArgs: 3, signature: "random_bernoulli(seed, probability, [shape])", args: ["seed", "probability", "[shape]"], description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor", details: "", aliases: ["randb"] }, + "randp": { minArgs: 2, maxArgs: 3, signature: "randp(seed, lambda, [shape])", args: ["seed", "lambda", "[shape]"], description: "generates Poisson distributed random values.", details: "", aliases: ["random_poisson"] }, + "random_poisson": { minArgs: 2, maxArgs: 3, signature: "random_poisson(seed, lambda, [shape])", args: ["seed", "lambda", "[shape]"], description: "generates Poisson distributed random values.", details: "", aliases: ["randp"] }, + "randg": { minArgs: 3, maxArgs: 4, signature: "randg(seed, shape_param, scale, [shape])", args: ["seed", "shape_param", "scale", "[shape]"], description: "generates Gamma distributed random values.", details: "", aliases: ["random_gamma"] }, + "random_gamma": { minArgs: 3, maxArgs: 4, signature: "random_gamma(seed, shape_param, scale, [shape])", args: ["seed", "shape_param", "scale", "[shape]"], description: "generates Gamma distributed random values.", details: "", aliases: ["randg"] }, + "randbeta": { minArgs: 3, maxArgs: 4, signature: "randbeta(seed, alpha, beta, [shape])", args: ["seed", "alpha", "beta", "[shape]"], description: "generates Beta distributed random values", details: "", aliases: ["random_beta"] }, + "random_beta": { minArgs: 3, maxArgs: 4, signature: "random_beta(seed, alpha, beta, [shape])", args: ["seed", "alpha", "beta", "[shape]"], description: "generates Beta distributed random values", details: "", aliases: ["randbeta"] }, + "randl": { minArgs: 3, maxArgs: 4, signature: "randl(seed, loc, scale, [shape])", args: ["seed", "loc", "scale", "[shape]"], description: "generates Laplace distributed random values", details: "", aliases: ["random_laplace"] }, + "random_laplace": { minArgs: 3, maxArgs: 4, signature: "random_laplace(seed, loc, scale, [shape])", args: ["seed", "loc", "scale", "[shape]"], description: "generates Laplace distributed random values", details: "", aliases: ["randl"] }, + "randgumbel": { minArgs: 3, maxArgs: 4, signature: "randgumbel(seed, loc, scale, [shape])", args: ["seed", "loc", "scale", "[shape]"], description: "generates Gumbel distributed random values", details: "", aliases: ["random_gumbel"] }, + "random_gumbel": { minArgs: 3, maxArgs: 4, signature: "random_gumbel(seed, loc, scale, [shape])", args: ["seed", "loc", "scale", "[shape]"], description: "generates Gumbel distributed random values", details: "", aliases: ["randgumbel"] }, + "randw": { minArgs: 3, maxArgs: 4, signature: "randw(seed, scale, concentration, [shape])", args: ["seed", "scale", "concentration", "[shape]"], description: "generates Weibull distributed random values", details: "", aliases: ["random_weibull"] }, + "random_weibull": { minArgs: 3, maxArgs: 4, signature: "random_weibull(seed, scale, concentration, [shape])", args: ["seed", "scale", "concentration", "[shape]"], description: "generates Weibull distributed random values", details: "", aliases: ["randw"] }, + "randchi2": { minArgs: 2, maxArgs: 3, signature: "randchi2(seed, df, [shape])", args: ["seed", "df", "[shape]"], description: "generates Chi-squared distributed random values", details: "", aliases: ["random_chi2"] }, + "random_chi2": { minArgs: 2, maxArgs: 3, signature: "random_chi2(seed, df, [shape])", args: ["seed", "df", "[shape]"], description: "generates Chi-squared distributed random values", details: "", aliases: ["randchi2"] }, + "randt": { minArgs: 2, maxArgs: 3, signature: "randt(seed, df, [shape])", args: ["seed", "df", "[shape]"], description: "generates Student-t distributed random values", details: "", aliases: ["random_studentt"] }, + "random_studentt": { minArgs: 2, maxArgs: 3, signature: "random_studentt(seed, df, [shape])", args: ["seed", "df", "[shape]"], description: "generates Student-t distributed random values", details: "", aliases: ["randt"] }, + "perlin": { minArgs: 2, maxArgs: 5, signature: "perlin(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates Perlin noise", details: "", aliases: ["perlin_noise"] }, + "perlin_noise": { minArgs: 2, maxArgs: 5, signature: "perlin_noise(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates Perlin noise", details: "", aliases: ["perlin"] }, + "cellular": { minArgs: 2, maxArgs: 5, signature: "cellular(seed, scale, [jitter], [offset], [shape])", args: ["seed", "scale", "[jitter]", "[offset]", "[shape]"], description: "generates Cellular/Voronoi noise", details: "", aliases: ["voronoi", "worley", "cellular_noise", "voronoi_noise"] }, + "voronoi": { minArgs: 2, maxArgs: 5, signature: "voronoi(seed, scale, [jitter], [offset], [shape])", args: ["seed", "scale", "[jitter]", "[offset]", "[shape]"], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "worley", "cellular_noise", "voronoi_noise"] }, + "worley": { minArgs: 2, maxArgs: 5, signature: "worley(seed, scale, [jitter], [offset], [shape])", args: ["seed", "scale", "[jitter]", "[offset]", "[shape]"], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "voronoi", "cellular_noise", "voronoi_noise"] }, + "cellular_noise": { minArgs: 2, maxArgs: 5, signature: "cellular_noise(seed, scale, [jitter], [offset], [shape])", args: ["seed", "scale", "[jitter]", "[offset]", "[shape]"], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "voronoi", "worley", "voronoi_noise"] }, + "voronoi_noise": { minArgs: 2, maxArgs: 5, signature: "voronoi_noise(seed, scale, [jitter], [offset], [shape])", args: ["seed", "scale", "[jitter]", "[offset]", "[shape]"], description: "generates Cellular/Voronoi noise", details: "", aliases: ["cellular", "voronoi", "worley", "cellular_noise"] }, + "plasma": { minArgs: 2, maxArgs: 5, signature: "plasma(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4", details: "", aliases: ["turbulence", "plasma_noise"] }, + "turbulence": { minArgs: 2, maxArgs: 5, signature: "turbulence(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4", details: "", aliases: ["plasma", "plasma_noise"] }, + "plasma_noise": { minArgs: 2, maxArgs: 5, signature: "plasma_noise(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates Plasma/Turbulence noise - same as perlin but default octaves 4", details: "", aliases: ["plasma", "turbulence"] }, + "ridged": { minArgs: 2, maxArgs: 5, signature: "ridged(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates ridged multi-fractal noise", details: "", aliases: ["ridged_noise"] }, + "ridged_noise": { minArgs: 2, maxArgs: 5, signature: "ridged_noise(seed, scale, [octaves], [offset], [shape])", args: ["seed", "scale", "[octaves]", "[offset]", "[shape]"], description: "generates ridged multi-fractal noise", details: "", aliases: ["ridged"] }, + "domain_warp": { minArgs: 4, maxArgs: 8, signature: "domain_warp(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])", args: ["seed", "scale", "warp_scale", "warp_strength", "[octaves]", "[warp_octaves]", "[offset]", "[shape]"], description: "generates domain warped noise", details: "", aliases: ["domain_warp_noise"] }, + "domain_warp_noise": { minArgs: 4, maxArgs: 8, signature: "domain_warp_noise(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])", args: ["seed", "scale", "warp_scale", "warp_strength", "[octaves]", "[warp_octaves]", "[offset]", "[shape]"], description: "generates domain warped noise", details: "", aliases: ["domain_warp"] }, };