AI: editor improvements
This commit is contained in:
@@ -243,6 +243,7 @@ func1:
|
||||
| ISFINITE LPAREN expr RPAREN # IsfiniteFunc
|
||||
/**
|
||||
tnorm(x, [dim]) - 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.
|
||||
- dim: dimension whose slices are normalised (default: last)
|
||||
*/
|
||||
| TNORM LPAREN expr (COMMA expr)? RPAREN # TNormFunc
|
||||
/**
|
||||
@@ -323,34 +324,43 @@ func1:
|
||||
| PINV LPAREN expr RPAREN # PinvFunc
|
||||
/**
|
||||
inv(x, [pseudo]) - computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead
|
||||
- pseudo: truthy to compute the Moore-Penrose pseudoinverse, which also works for singular and non-square matrices (default: false)
|
||||
*/
|
||||
| INV LPAREN expr (COMMA expr)? RPAREN # InvFunc
|
||||
/**
|
||||
matrix_rank(x, [tol]) - computes the numerical rank of each matrix using optional absolute tolerance tol
|
||||
- tol: absolute tolerance below which singular values count as zero
|
||||
*/
|
||||
| MATRIX_RANK LPAREN expr (COMMA expr)? RPAREN # MatrixRankFunc
|
||||
/**
|
||||
sum(x, [dims]) - computes the sum of elements of x, optionally along one or more dimensions
|
||||
- dims: dimension or list of dimensions to reduce (default: all elements)
|
||||
*/
|
||||
| SUM LPAREN expr (COMMA expr)? RPAREN # SumFunc
|
||||
/**
|
||||
mean(x, [dims]) - computes the arithmetic mean of elements of x globally or along one or more dimensions
|
||||
- dims: dimension or list of dimensions to reduce (default: all elements)
|
||||
*/
|
||||
| MEAN LPAREN expr (COMMA expr)? RPAREN # MeanFunc
|
||||
/**
|
||||
std(x, [dims]) - computes the sample standard deviation of elements of x globally or along one or more dimensions
|
||||
- dims: dimension or list of dimensions to reduce (default: all elements)
|
||||
*/
|
||||
| STD LPAREN expr (COMMA expr)? RPAREN # StdFunc
|
||||
/**
|
||||
var(x, [dims]) - computes the sample variance of elements of x globally or along one or more dimensions
|
||||
- dims: dimension or list of dimensions to reduce (default: all elements)
|
||||
*/
|
||||
| VAR LPAREN expr (COMMA expr)? RPAREN # VarFunc
|
||||
/**
|
||||
prod(x, [dims]) - computes the product of elements of x globally or along one or more dimensions
|
||||
- dims: dimension or list of dimensions to reduce (default: all elements)
|
||||
*/
|
||||
| PROD LPAREN expr (COMMA expr)? RPAREN # ProdFunc
|
||||
/**
|
||||
sort(x, [descending], [dim]) - returns x sorted ascending, or descending when descending is truthy. Tensors are sorted along dim (default: last dimension); lists use Python sorting
|
||||
- descending: truthy to sort from largest to smallest (default: false)
|
||||
- dim: dimension to sort along (default: last)
|
||||
*/
|
||||
| SORT LPAREN expr (COMMA expr (COMMA expr)?)? RPAREN # SortFunc
|
||||
/**
|
||||
@@ -363,18 +373,22 @@ func1:
|
||||
| ALL LPAREN expr RPAREN # AllFunc
|
||||
/**
|
||||
edge(x, [kernel_size]) - detects edges in x with a Sobel filter. kernel_size must be odd and at least 3 (default 3).
|
||||
- kernel_size: odd Sobel kernel size, at least 3 (default: 3)
|
||||
*/
|
||||
| EDGE LPAREN expr (COMMA expr)? RPAREN # EdgeFunc
|
||||
/**
|
||||
median(x, [dim]) - computes the median globally or along one dimension
|
||||
- dim: dimension to reduce (default: all elements)
|
||||
*/
|
||||
| MEDIAN LPAREN expr (COMMA expr)? RPAREN # MedianFunc
|
||||
/**
|
||||
mode(x, [dim]) - computes the mode globally or along one dimension
|
||||
- dim: dimension to reduce (default: all elements)
|
||||
*/
|
||||
| MODE LPAREN expr (COMMA expr)? RPAREN # ModeFunc
|
||||
/**
|
||||
cumsum(x, [dim]) - computes the cumulative sum, defaulting to the first dimension.
|
||||
- dim: dimension to accumulate along (default: 0)
|
||||
*/
|
||||
| CUMSUM LPAREN expr (COMMA expr)? RPAREN # CumsumFunc
|
||||
/**
|
||||
@@ -399,6 +413,8 @@ func1:
|
||||
| RESET_TRACKING LPAREN expr RPAREN # ResetTrackingFunc
|
||||
/**
|
||||
repeat(x, count, [dims]) - repeats tensor elements; count may be scalar or per-dim list
|
||||
- count: number of repeats, or a list with one count per dimension
|
||||
- dims: dimension or list of dimensions to repeat along; without it a number repeats each element of the flattened input and a list tiles the whole tensor
|
||||
*/
|
||||
| REPEAT LPAREN expr COMMA expr (COMMA expr)? RPAREN # RepeatFunc
|
||||
/**
|
||||
@@ -423,22 +439,30 @@ func1:
|
||||
| GET LPAREN expr RPAREN # GetFunc
|
||||
/**
|
||||
argsort(x, [descending], [dim]) - returns the indices that would sort x. descending defaults to false and dim defaults to the last dimension.
|
||||
- descending: truthy to sort from largest to smallest (default: false)
|
||||
- dim: dimension to sort along (default: last)
|
||||
*/
|
||||
| ARGSORT LPAREN expr (COMMA expr (COMMA expr)?)? RPAREN # ArgsortFunc
|
||||
/**
|
||||
argmin(x, [as_position], [dim]) - returns the minimum index globally or along dim; as_position returns global coordinates
|
||||
- as_position: truthy to return the coordinates of the minimum instead of a flat index
|
||||
- dim: dimension to search along; cannot be combined with as_position
|
||||
*/
|
||||
| ARGMIN LPAREN expr (COMMA expr (COMMA expr)?)? RPAREN # ArgminFunc
|
||||
/**
|
||||
argmax(x, [as_position], [dim]) - returns the maximum index globally or along dim; as_position returns global coordinates
|
||||
- as_position: truthy to return the coordinates of the maximum instead of a flat index
|
||||
- dim: dimension to search along; cannot be combined with as_position
|
||||
*/
|
||||
| ARGMAX LPAREN expr (COMMA expr (COMMA expr)?)? RPAREN # ArgmaxFunc
|
||||
/**
|
||||
softmax(x, [dim]) - applies the softmax function to x (each slice sums to 1.0). dim defaults to the last dimension.
|
||||
- dim: dimension whose slices sum to 1 (default: last)
|
||||
*/
|
||||
| SOFTMAX LPAREN expr (COMMA expr)? RPAREN # SoftmaxFunc
|
||||
/**
|
||||
softmin(x, [dim]) - applies the softmin function to x (same as softmax(-x, [dim])). dim defaults to the last dimension.
|
||||
- dim: dimension whose slices sum to 1 (default: last)
|
||||
*/
|
||||
| SOFTMIN LPAREN expr (COMMA expr)? RPAREN # SoftminFunc
|
||||
/**
|
||||
@@ -503,18 +527,22 @@ func1:
|
||||
| SFFT LPAREN expr RPAREN # SfftFunc
|
||||
/**
|
||||
dilate(x, [kernel_size]) - applies morphological dilation to x with a square kernel (default size 3).
|
||||
- kernel_size: size of the square kernel (default: 3)
|
||||
*/
|
||||
| DILATE LPAREN expr (COMMA expr)? RPAREN # DilateFunc
|
||||
/**
|
||||
erode(x, [kernel_size]) - applies morphological erosion to x with a square kernel (default size 3).
|
||||
- kernel_size: size of the square kernel (default: 3)
|
||||
*/
|
||||
| ERODE LPAREN expr (COMMA expr)? RPAREN # ErodeFunc
|
||||
/**
|
||||
morph_open(x, [kernel_size]) - applies morphological opening (erosion then dilation) to x with a square kernel (default size 3).
|
||||
- kernel_size: size of the square kernel (default: 3)
|
||||
*/
|
||||
| MORPH_OPEN LPAREN expr (COMMA expr)? RPAREN # MorphOpenFunc
|
||||
/**
|
||||
morph_close(x, [kernel_size]) - applies morphological closing (dilation then erosion) to x with a square kernel (default size 3).
|
||||
- kernel_size: size of the square kernel (default: 3)
|
||||
*/
|
||||
| MORPH_CLOSE LPAREN expr (COMMA expr)? RPAREN # MorphCloseFunc
|
||||
/**
|
||||
@@ -539,16 +567,21 @@ func1:
|
||||
| AS_NESTED LPAREN expr RPAREN # AsNestedFunc
|
||||
/**
|
||||
svd(x, [full_matrices]) - computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)
|
||||
- full_matrices: truthy to return full-size U and Vh (default: false)
|
||||
*/
|
||||
| SVD LPAREN expr (COMMA expr)? RPAREN # SvdFunc;
|
||||
|
||||
func2:
|
||||
/**
|
||||
pow(x, y) - computes x raised to the power of y
|
||||
- x: base
|
||||
- y: exponent
|
||||
*/
|
||||
POWE LPAREN expr COMMA expr RPAREN # PowFunc
|
||||
/**
|
||||
atan2(y, x) - computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant
|
||||
- y: y coordinate (numerator)
|
||||
- x: x coordinate (denominator)
|
||||
*/
|
||||
| ATAN2 LPAREN expr COMMA expr RPAREN # Atan2Func
|
||||
/**
|
||||
@@ -569,10 +602,14 @@ func2:
|
||||
| LOGICAL_OR LPAREN expr COMMA expr RPAREN # LogicalOrFunc
|
||||
/**
|
||||
isclose(a, b, [rtol], [atol]) - elementwise approximate equality test
|
||||
- rtol: relative tolerance (default: 1e-5)
|
||||
- atol: absolute tolerance (default: 1e-8)
|
||||
*/
|
||||
| ISCLOSE LPAREN expr COMMA expr (COMMA expr (COMMA expr)?)? RPAREN # IscloseFunc
|
||||
/**
|
||||
allclose(a, b, [rtol], [atol]) - returns 1.0 if all elements are approximately equal, else 0.0
|
||||
- rtol: relative tolerance (default: 1e-5)
|
||||
- atol: absolute tolerance (default: 1e-8)
|
||||
*/
|
||||
| ALLCLOSE LPAREN expr COMMA expr (COMMA expr (COMMA expr)?)? RPAREN # AllcloseFunc
|
||||
/**
|
||||
@@ -585,30 +622,42 @@ func2:
|
||||
| TMAX LPAREN expr COMMA expr RPAREN # TMaxFunc
|
||||
/**
|
||||
snorm(x,[dim]) - frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.
|
||||
- dim: dimension or list of dimensions to reduce (default: all elements)
|
||||
*/
|
||||
| SNORM LPAREN expr (COMMA expr)? RPAREN # SNormFunc
|
||||
/**
|
||||
step(x, edge) - returns 0 if x < edge, else 1
|
||||
- edge: threshold; the result is 1 where x >= edge, otherwise 0
|
||||
*/
|
||||
| STEP LPAREN expr COMMA expr RPAREN # StepFunc
|
||||
/**
|
||||
topk(x, k, [dim]) - returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.
|
||||
- k: number of elements to keep
|
||||
- dim: dimension to select along (default: last)
|
||||
*/
|
||||
| TOPK LPAREN expr COMMA expr (COMMA expr)? RPAREN # TopkFunc
|
||||
/**
|
||||
botk(x, k, [dim]) - returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.
|
||||
- k: number of elements to keep
|
||||
- dim: dimension to select along (default: last)
|
||||
*/
|
||||
| BOTK LPAREN expr COMMA expr (COMMA expr)? RPAREN # BotkFunc
|
||||
/**
|
||||
quartile(x, q, [dim]) - computes the q-th quartile globally or along dim
|
||||
- q: quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)
|
||||
- dim: dimension to reduce (default: all elements)
|
||||
*/
|
||||
| QUARTILE LPAREN expr COMMA expr (COMMA expr)? RPAREN # QuartileFunc
|
||||
/**
|
||||
percentile(x, p, [dim]) - computes the p-th percentile globally or along dim
|
||||
- p: percentile 0-100
|
||||
- dim: dimension to reduce (default: all elements)
|
||||
*/
|
||||
| PERCENTILE LPAREN expr COMMA expr (COMMA expr)? RPAREN # PercentileFunc
|
||||
/**
|
||||
quantile(x, q, [dim]) - computes the q-th quantile globally or along dim
|
||||
- q: quantile 0-1
|
||||
- dim: dimension to reduce (default: all elements)
|
||||
*/
|
||||
| QUANTILE LPAREN expr COMMA expr (COMMA expr)? RPAREN # QuantileFunc
|
||||
/**
|
||||
@@ -633,10 +682,12 @@ func2:
|
||||
| ENDSWITH LPAREN expr COMMA expr RPAREN # EndswithFunc
|
||||
/**
|
||||
logsumexp(x, [dims]) - computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions
|
||||
- dims: dimension or list of dimensions to reduce (default: all elements)
|
||||
*/
|
||||
| LOGSUMEXP LPAREN expr (COMMA expr)? RPAREN # LogsumexpFunc
|
||||
/**
|
||||
rfft(x, [dim]) - computes the one-dimensional real-input FFT along dim (default: last dimension)
|
||||
- dim: dimension to transform (default: last)
|
||||
*/
|
||||
| RFFT LPAREN expr (COMMA expr)? RPAREN # RfftFunc
|
||||
/**
|
||||
@@ -649,6 +700,7 @@ func2:
|
||||
| DET LPAREN expr RPAREN # DetFunc
|
||||
/**
|
||||
flip(x, dims) - reverses the order of elements along the specified dimensions. Text is reversed as a whole
|
||||
- dims: dimension or list of dimensions to reverse
|
||||
*/
|
||||
| FLIP LPAREN expr COMMA expr RPAREN # FlipFunc
|
||||
/**
|
||||
@@ -661,6 +713,7 @@ func2:
|
||||
| CORR LPAREN expr COMMA expr RPAREN # CorrFunc
|
||||
/**
|
||||
append(x, y) - appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)
|
||||
- y: item, list or tensor added to the end of x
|
||||
*/
|
||||
| APPEND LPAREN expr COMMA expr RPAREN # AppendFunc
|
||||
/**
|
||||
@@ -669,82 +722,117 @@ func2:
|
||||
| ADD_KEY LPAREN expr COMMA expr COMMA expr RPAREN # AddKeyFunc
|
||||
/**
|
||||
permute(x, dims) - permutes the dimensions of tensor x according to dims
|
||||
- dims: new order of the dimensions, e.g. [0, 2, 1]
|
||||
*/
|
||||
| PERM LPAREN expr COMMA expr RPAREN # PermuteFunc
|
||||
/**
|
||||
gaussian(x, sigma, [reshape]) - 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.
|
||||
- sigma: blur strength as the standard deviation in elements; 0 or less returns x unchanged
|
||||
- reshape: truthy to find the channel dimension automatically; otherwise channels must be last (default: false)
|
||||
*/
|
||||
| GAUSSIAN LPAREN expr COMMA expr (COMMA expr)? RPAREN # GaussianFunc
|
||||
/**
|
||||
topk_indices(x, k, [dim]) - returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)
|
||||
- k: number of indices to return
|
||||
- dim: dimension to select along (default: indices into flatten(x))
|
||||
*/
|
||||
| TOPK_IND LPAREN expr COMMA expr (COMMA expr)? RPAREN # TopkIndFunc
|
||||
/**
|
||||
botk_indices(x, k, [dim]) - returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)
|
||||
- k: number of indices to return
|
||||
- dim: dimension to select along (default: indices into flatten(x))
|
||||
*/
|
||||
| BOTK_IND LPAREN expr COMMA expr (COMMA expr)? RPAREN # BotkIndFunc
|
||||
/**
|
||||
batch_shuffle(x, indices) - shuffles and duplicates or skips the batch dimension of x according to indices
|
||||
- indices: batch indices to take, in order; batches may repeat or be skipped
|
||||
*/
|
||||
| BATCH_SHUFFLE LPAREN expr COMMA expr RPAREN # BatchShuffleFunc
|
||||
/**
|
||||
stack_push(slot, val) - pushes val onto the end of slot stack
|
||||
- slot: stack number (any integer)
|
||||
- val: value to push; it is also returned
|
||||
*/
|
||||
| PUSH LPAREN expr COMMA expr RPAREN # PushFunc
|
||||
/**
|
||||
get_value(tensor, position) - reads the value at an N-D position of tensor. Superseded by tensor[position] indexing
|
||||
- position: list with one index per dimension
|
||||
*/
|
||||
| GET_VALUE LPAREN expr COMMA expr RPAREN # GetValueFunc
|
||||
/**
|
||||
tensor(shape, [value], [dtype_template]) - creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32
|
||||
- shape: list of dimension sizes
|
||||
- value: fill value (default: 0)
|
||||
- dtype_template: tensor whose dtype the result uses (default: float32)
|
||||
*/
|
||||
| TENSOR LPAREN indexExpr (COMMA expr (COMMA expr)? )? RPAREN # EmptyTensorFunc
|
||||
/**
|
||||
zeros(shape, [dtype_template]) - creates a zero-filled tensor on the current device
|
||||
- shape: list of dimension sizes
|
||||
- dtype_template: tensor whose dtype the result uses (default: float32)
|
||||
*/
|
||||
| ZEROS LPAREN expr (COMMA expr)? RPAREN # ZerosFunc
|
||||
/**
|
||||
ones(shape, [dtype_template]) - creates a one-filled tensor on the current device
|
||||
- shape: list of dimension sizes
|
||||
- dtype_template: tensor whose dtype the result uses (default: float32)
|
||||
*/
|
||||
| ONES LPAREN expr (COMMA expr)? RPAREN # OnesFunc
|
||||
/**
|
||||
eye(n, [dtype_template]) - creates an n-by-n identity matrix
|
||||
- n: number of rows and columns
|
||||
- dtype_template: tensor whose dtype the result uses (default: float32)
|
||||
*/
|
||||
| EYE LPAREN expr (COMMA expr)? RPAREN # EyeFunc
|
||||
/**
|
||||
one_hot(indices, classes) - converts integer class indices to float32 one-hot vectors
|
||||
- indices: integer class indices
|
||||
- classes: number of classes, i.e. the length of each one-hot vector
|
||||
*/
|
||||
| ONE_HOT LPAREN expr COMMA expr RPAREN # OneHotFunc
|
||||
/**
|
||||
mse(a, b, [reduction]) - mean squared error; reduction is mean (default), sum, or none
|
||||
- reduction: "mean" (default), "sum", or "none" for element-wise values
|
||||
*/
|
||||
| MSE LPAREN expr COMMA expr (COMMA expr)? RPAREN # MseFunc
|
||||
/**
|
||||
mae(a, b, [reduction]) - mean absolute error; reduction is mean (default), sum, or none
|
||||
- reduction: "mean" (default), "sum", or "none" for element-wise values
|
||||
*/
|
||||
| MAE LPAREN expr COMMA expr (COMMA expr)? RPAREN # MaeFunc
|
||||
/**
|
||||
psnr(a, b, [data_range]) - peak signal-to-noise ratio in dB; data_range defaults to 1
|
||||
- data_range: difference between the largest and smallest possible value (default: 1)
|
||||
*/
|
||||
| PSNR LPAREN expr COMMA expr (COMMA expr)? RPAREN # PsnrFunc
|
||||
/**
|
||||
weighted_mean(x, weights, [dims]) - computes the weighted mean globally or along one or more dimensions
|
||||
- weights: weight of each element, broadcast against x
|
||||
- dims: dimension or list of dimensions to reduce (default: all elements)
|
||||
*/
|
||||
| WEIGHTED_MEAN LPAREN expr COMMA expr (COMMA expr)? RPAREN # WeightedMeanFunc
|
||||
/**
|
||||
huber_loss(prediction, target, [delta], [reduction]) - computes Huber loss; delta defaults to 1 and reduction to mean
|
||||
- delta: error size where the loss changes from quadratic to linear (default: 1)
|
||||
- reduction: "mean" (default), "sum", or "none" for element-wise values
|
||||
*/
|
||||
| HUBER_LOSS LPAREN expr COMMA expr (COMMA expr (COMMA expr)?)? RPAREN # HuberLossFunc
|
||||
/**
|
||||
cross_entropy(logits, target, [dim], [reduction]) - computes cross-entropy from class logits and class indices or target probabilities
|
||||
- logits: unnormalised class scores
|
||||
- target: class indices, or class probabilities with the same shape as logits
|
||||
- dim: class dimension (default: 1, or 0 for a single vector)
|
||||
- reduction: "mean" (default), "sum", or "none" for element-wise values
|
||||
*/
|
||||
| CROSS_ENTROPY LPAREN expr COMMA expr (COMMA expr (COMMA expr)?)? RPAREN # CrossEntropyFunc
|
||||
/**
|
||||
leaky_relu(x, [negative_slope]) - applies leaky ReLU element-wise; negative_slope defaults to 0.01
|
||||
- negative_slope: slope used for negative inputs (default: 0.01)
|
||||
*/
|
||||
| LEAKY_RELU LPAREN expr (COMMA expr)? RPAREN # LeakyReluFunc
|
||||
/**
|
||||
pad(x, padding) - pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)
|
||||
- padding: amounts as [dim0_before, dim0_after, dim1_before, dim1_after, ...]
|
||||
*/
|
||||
| PAD LPAREN expr COMMA expr RPAREN # PadFunc
|
||||
/**
|
||||
@@ -757,6 +845,8 @@ func2:
|
||||
| MATMUL LPAREN expr COMMA expr RPAREN # MatmulFunc
|
||||
/**
|
||||
solve(A, b) - solves the square linear system A*x=b without explicitly forming A inverse
|
||||
- A: square coefficient matrix
|
||||
- b: right-hand side
|
||||
*/
|
||||
| SOLVE LPAREN expr COMMA expr RPAREN # SolveFunc
|
||||
/**
|
||||
@@ -784,14 +874,18 @@ func2:
|
||||
| BOR LPAREN expr COMMA expr RPAREN # BitOrFunc
|
||||
/**
|
||||
split(x, [delimiter]) - splits string to list of strings based on delimiter. Default is space.
|
||||
- delimiter: text to split on (default: a space)
|
||||
*/
|
||||
| SPLIT LPAREN expr (COMMA expr)? RPAREN # SplitFunc
|
||||
/**
|
||||
join(x, [separator]) - joins the items of list x as text using separator (default ""). Use concatenate(...) to join tensors
|
||||
- separator: text placed between the items (default: "")
|
||||
*/
|
||||
| JOIN LPAREN expr (COMMA expr)? RPAREN # JoinFunc
|
||||
/**
|
||||
substring(s, start, [length]) - returns length characters of s starting at start. If length is not supplied, it returns the rest of the string
|
||||
- start: index of the first character
|
||||
- length: number of characters (default: the rest of the text)
|
||||
*/
|
||||
| SUBSTRING LPAREN expr COMMA expr (COMMA expr)? RPAREN # SubstringFunc
|
||||
/**
|
||||
@@ -800,6 +894,8 @@ func2:
|
||||
| FIND LPAREN expr COMMA expr RPAREN # FindFunc
|
||||
/**
|
||||
replace(s, old, new) - replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.
|
||||
- old: text or value to look for
|
||||
- new: replacement
|
||||
*/
|
||||
| REPLACE LPAREN expr COMMA expr COMMA expr RPAREN # ReplaceFunc
|
||||
/**
|
||||
@@ -812,14 +908,17 @@ func2:
|
||||
| RGB_TO_INT LPAREN expr ( COMMA expr COMMA expr)? RPAREN # Rgb_to_intFunc
|
||||
/**
|
||||
interpolate_linear(x, scale) - resizes x [N, C, ...] with (bi/tri)linear interpolation. A number scales every spatial dimension; a list is the target spatial size
|
||||
- scale: a number scales every spatial dimension; a list gives the target spatial size
|
||||
*/
|
||||
| INTERPOLATE_LINEAR LPAREN expr COMMA expr RPAREN # InterpolateLinearFunc
|
||||
/**
|
||||
interpolate_area(x, scale) - resizes x [N, C, ...] with area interpolation. A number scales every spatial dimension; a list is the target spatial size
|
||||
- scale: a number scales every spatial dimension; a list gives the target spatial size
|
||||
*/
|
||||
| INTERPOLATE_AREA LPAREN expr COMMA expr RPAREN # InterpolateAreaFunc
|
||||
/**
|
||||
interpolate_nearest_exact(x, scale) - resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size
|
||||
- scale: a number scales every spatial dimension; a list gives the target spatial size
|
||||
*/
|
||||
| INTERPOLATE_NEAREST LPAREN expr COMMA expr RPAREN # InterpolateNearestExactFunc
|
||||
/**
|
||||
@@ -835,62 +934,87 @@ func3:
|
||||
CLAMP LPAREN expr COMMA expr COMMA expr RPAREN # ClampFunc
|
||||
/**
|
||||
lerp(a, b, t) - linear interpolation between a and b by t per element. t can be float or tensor.
|
||||
- t: progress from 0 (gives a) to 1 (gives b)
|
||||
*/
|
||||
| LERP LPAREN expr COMMA expr COMMA expr RPAREN # LerpFunc
|
||||
/**
|
||||
smoothstep(x, edge0, edge1) - smooth interpolation between edge0 and edge1
|
||||
- edge0: value mapped to 0
|
||||
- edge1: value mapped to 1
|
||||
*/
|
||||
| SMOOTHSTEP LPAREN expr COMMA expr COMMA expr RPAREN # SmoothstepFunc
|
||||
/**
|
||||
transpose(x, dim0, dim1) / swapaxes(x, dim0, dim1) - swaps two tensor dimensions
|
||||
- dim0: first dimension to swap
|
||||
- dim1: second dimension to swap
|
||||
*/
|
||||
| TRANSPOSE LPAREN expr COMMA expr COMMA expr RPAREN # TransposeFunc
|
||||
/**
|
||||
range(start, stop, step) - creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.
|
||||
- start: first value
|
||||
- stop: end of the range (not included)
|
||||
- step: distance between consecutive values
|
||||
*/
|
||||
| RANGE LPAREN expr COMMA expr COMMA expr RPAREN # RangeFunc
|
||||
/**
|
||||
moment(x, a, k) - computes the k-th moment of x around a
|
||||
- a: centre the moment is taken around
|
||||
- k: order of the moment
|
||||
*/
|
||||
| MOMENT LPAREN expr COMMA expr COMMA expr RPAREN # MomentFunc
|
||||
/**
|
||||
cubic_ease(a, b, t) - cubic ease between a and b
|
||||
- t: progress from 0 (gives a) to 1 (gives b)
|
||||
*/
|
||||
| CUBIC_EASE LPAREN expr COMMA expr COMMA expr RPAREN # CubicEaseFunc
|
||||
/**
|
||||
elastic_ease(a, b, t) - elastic ease between a and b
|
||||
- t: progress from 0 (gives a) to 1 (gives b)
|
||||
*/
|
||||
| ELASTIC_EASE LPAREN expr COMMA expr COMMA expr RPAREN # ElasticEaseFunc
|
||||
/**
|
||||
sine_ease(a, b, t) - sine easing between a and b
|
||||
- t: progress from 0 (gives a) to 1 (gives b)
|
||||
*/
|
||||
| SINE_EASE LPAREN expr COMMA expr COMMA expr RPAREN # SineEaseFunc
|
||||
/**
|
||||
smootherstep(x, edge0, edge1) - smoother interpolation between edge0 and edge1
|
||||
- edge0: value mapped to 0
|
||||
- edge1: value mapped to 1
|
||||
*/
|
||||
| SMOOTHERSTEP LPAREN expr COMMA expr COMMA expr RPAREN # SmootherstepFunc
|
||||
/**
|
||||
crop(x, start, size) - crops the region of x beginning at start (the low corner). The result always has shape size; parts outside x are zero-filled. On text, returns at most size characters
|
||||
- start: low corner of the region, one index per dimension
|
||||
- size: size of the result, one value per dimension
|
||||
*/
|
||||
| CROP LPAREN expr COMMA expr COMMA expr RPAREN # CropFunc
|
||||
/**
|
||||
ifft(x, [shape]) - 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.
|
||||
- shape: shape used for the K/Kx/Ky frequency variables (default: the node's input shape)
|
||||
*/
|
||||
| SIFFT LPAREN expr (COMMA expr)? RPAREN # SifftFunc
|
||||
/**
|
||||
irfft(x, [n], [dim]) - computes the inverse one-dimensional real FFT along dim (default: last dimension)
|
||||
- n: length of the output signal (default: 2 * (input length - 1))
|
||||
- dim: dimension to transform (default: last)
|
||||
*/
|
||||
| IRFFT LPAREN expr (COMMA expr (COMMA expr)?)? RPAREN # IrfftFunc
|
||||
/**
|
||||
overlay(base, overlay, offset, [opacity]) - 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.
|
||||
- offset: position of the overlay's low corner in base, one value per dimension
|
||||
- opacity: 0-1 blend amount; a number or a tensor shaped like overlay (default: 1)
|
||||
*/
|
||||
| OVERLAY LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # OverlayFunc
|
||||
/**
|
||||
linspace(start, stop, num) - creates num linearly spaced values from start to stop (inclusive). Use range if you want to control the step between values.
|
||||
- num: number of values
|
||||
*/
|
||||
| LINSPACE LPAREN expr COMMA expr COMMA expr RPAREN # LinspaceFunc
|
||||
/**
|
||||
roll(x, shifts, [dim]) - circularly shifts tensor x along dim (default 0)
|
||||
- shifts: number of places to shift; elements pushed off one end come back at the other
|
||||
- dim: dimension to shift along (default: 0)
|
||||
*/
|
||||
| ROLL LPAREN expr COMMA expr (COMMA expr)? RPAREN # RollFunc
|
||||
/**
|
||||
@@ -903,14 +1027,17 @@ func3:
|
||||
| RGB_TO_CIELAB LPAREN expr (COMMA expr COMMA expr)? RPAREN # RgbToCielabFunc
|
||||
/**
|
||||
rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees]) - converts RGB to HSV. With one color argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is 0-360 instead of 0-1
|
||||
- degrees: truthy to use hue in 0-360 instead of 0-1
|
||||
*/
|
||||
| RGB_TO_HSV LPAREN expr (COMMA expr COMMA expr)? (COMMA expr)? RPAREN # RgbToHsvFunc
|
||||
/**
|
||||
hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees]) - converts HSV to RGB. With one color argument its last dimension holds H, S, V; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is read as 0-360 instead of 0-1
|
||||
- degrees: truthy to use hue in 0-360 instead of 0-1
|
||||
*/
|
||||
| HSV_TO_RGB LPAREN expr (COMMA expr COMMA expr)? (COMMA expr)? RPAREN # HsvToRgbFunc
|
||||
/**
|
||||
where(condition, x, y) - returns x if condition is true, else y. Runs per element.
|
||||
- condition: non-zero selects x, zero selects y
|
||||
*/
|
||||
| WHERE LPAREN expr COMMA expr COMMA expr RPAREN # WhereFunc
|
||||
/**
|
||||
@@ -923,36 +1050,65 @@ func3:
|
||||
| CIELAB_TO_RGB LPAREN expr (COMMA expr COMMA expr)? RPAREN # CielabToRgbFunc
|
||||
/**
|
||||
text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline]) - renders text to a 2D tensor with values 0-1
|
||||
- font: font name to look up in the system fonts, or a path to a font file
|
||||
- size: font size in pixels
|
||||
- max_width: wrap lines wider than this many pixels (default: 0, no wrapping)
|
||||
- weight: font weight 100-900 as in CSS (default: 400)
|
||||
- rotation_angle: rotation in degrees, counter-clockwise (default: 0)
|
||||
- line_spacing: line distance as a multiple of the line height (default: 1)
|
||||
- italic: truthy for italic text (default: false)
|
||||
- underline: truthy to underline the text (default: false)
|
||||
*/
|
||||
| TEXT_IMAGE LPAREN expr COMMA expr COMMA expr (COMMA expr)? (COMMA expr)? (COMMA expr)? (COMMA expr)? (COMMA expr)? (COMMA expr)? RPAREN # TextImageFunc
|
||||
/**
|
||||
coords(shape, dim, [dtype_template]) - generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).
|
||||
- shape: list of dimension sizes
|
||||
- dim: dimension whose index becomes the value
|
||||
- dtype_template: tensor whose dtype the result uses (default: float32)
|
||||
*/
|
||||
| COORDS LPAREN expr COMMA expr (COMMA expr)? RPAREN # CoordsFunc
|
||||
/**
|
||||
gather(x, dim, idx) - gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.
|
||||
- dim: dimension to gather along
|
||||
- idx: indices along dim; the result has the shape of idx
|
||||
*/
|
||||
| GATHER LPAREN expr COMMA expr COMMA expr RPAREN # GatherFunc
|
||||
/**
|
||||
scatter(x, dim, idx, src) - scatters elements from src into x along dim using the indices specified in idx. The output tensor has the same shape as x.
|
||||
- dim: dimension to scatter along
|
||||
- idx: position along dim for each element of src
|
||||
- src: values to write
|
||||
*/
|
||||
| SCATTER LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # ScatterFunc
|
||||
/**
|
||||
scatter_add(x, dim, idx, src) - 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.
|
||||
- dim: dimension to scatter along
|
||||
- idx: position along dim for each element of src
|
||||
- src: values to add
|
||||
*/
|
||||
| SCATTER_ADD LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # ScatterAddFunc;
|
||||
|
||||
func4:
|
||||
/**
|
||||
swap(x, dim, idx1, idx2) - swaps elements along dim between idx1 and idx2
|
||||
- dim: dimension to swap along
|
||||
- idx1: first position
|
||||
- idx2: second position
|
||||
*/
|
||||
SWAP LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # SwapFunc
|
||||
/**
|
||||
nan_to_num(x, nan, pos_inf, neg_inf) - replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)
|
||||
- nan: replacement for NaN
|
||||
- pos_inf: replacement for +infinity
|
||||
- neg_inf: replacement for -infinity
|
||||
*/
|
||||
| NVL LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # NvlFunc
|
||||
/**
|
||||
logspace(start, stop, num, base) - creates logarithmically spaced values
|
||||
- start: exponent of the first value
|
||||
- stop: exponent of the last value
|
||||
- num: number of values
|
||||
- base: base of the exponent
|
||||
*/
|
||||
| LOGSPACE LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # LogspaceFunc
|
||||
/**
|
||||
@@ -961,16 +1117,27 @@ func4:
|
||||
| DIST LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # DistFunc
|
||||
/**
|
||||
histogram(x, bins, min, max) - counts the elements of flatten(x) in bins equal-width bins over [min, max]
|
||||
- bins: number of equal-width bins
|
||||
- min: lower edge of the first bin
|
||||
- max: upper edge of the last bin
|
||||
*/
|
||||
| HISTOGRAM LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # HistogramFunc;
|
||||
|
||||
func5:
|
||||
/**
|
||||
remap(v, i_min, i_max, o_min, o_max) - remaps values from input range to output range
|
||||
- i_min: start of the input range
|
||||
- i_max: end of the input range
|
||||
- o_min: value i_min maps to
|
||||
- o_max: value i_max maps to
|
||||
*/
|
||||
REMAP LPAREN expr COMMA expr COMMA expr COMMA expr COMMA expr RPAREN # RemapFunc
|
||||
/**
|
||||
diagonal_matrix(x, shape, [offset], [dim1], [dim2]) - 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.
|
||||
- shape: shape of the result
|
||||
- offset: diagonal offset: positive above, negative below the main diagonal (default: 0)
|
||||
- dim1: first dimension of the matrix (default: -2)
|
||||
- dim2: second dimension of the matrix (default: -1)
|
||||
*/
|
||||
| DIAG LPAREN expr COMMA expr (COMMA expr (COMMA expr (COMMA expr)?)?)? RPAREN # DiagonalMatrixFunc;
|
||||
|
||||
@@ -978,18 +1145,29 @@ func5:
|
||||
funcN:
|
||||
/**
|
||||
norm(x, [p], [dims]) - computes the p-norm globally or along one or more dimensions (default p=2)
|
||||
- p: norm order (default: 2)
|
||||
- dims: dimension or list of dimensions to reduce (default: all elements)
|
||||
*/
|
||||
NORM LPAREN expr (COMMA expr (COMMA expr)?)? RPAREN # NormFunc
|
||||
/**
|
||||
slerp(a, b, t, [dim]) - 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.
|
||||
- t: progress from 0 (gives a) to 1 (gives b)
|
||||
- dim: dimension holding the vector components (default: all elements form one vector)
|
||||
*/
|
||||
| SLERP LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # SlerpFunc
|
||||
/**
|
||||
normalize(x, [p], [dim], [eps]) - normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)
|
||||
- p: norm order (default: 2)
|
||||
- dim: dimension to work along (default: last)
|
||||
- eps: smallest allowed divisor (default: 1e-12)
|
||||
*/
|
||||
| NORMALIZE LPAREN expr (COMMA expr (COMMA expr (COMMA expr)?)?)? RPAREN # NormalizeFunc
|
||||
/**
|
||||
group_norm(x, groups, [weight], [bias], [eps]) - applies channel-first GroupNorm to [N, C, ...] input
|
||||
- groups: number of channel groups; must divide the channel count
|
||||
- weight: per-channel scale, length C (default: none)
|
||||
- bias: per-channel shift, length C (default: none)
|
||||
- eps: value added to the variance for stability (default: 1e-5)
|
||||
*/
|
||||
| GROUP_NORM LPAREN expr COMMA expr (COMMA expr (COMMA expr (COMMA expr)?)?)? RPAREN # GroupNormFunc
|
||||
/**
|
||||
@@ -1002,34 +1180,53 @@ funcN:
|
||||
| SMAX LPAREN expr (COMMA expr)* RPAREN # SMaxFunc
|
||||
/**
|
||||
map(tensor, coord1, [coord2], [coord3]) - samples/remaps input tensor using coordinates
|
||||
- coord1: sample positions (element indices) along the first mapped dimension; mapped dimensions are the last ones of tensor
|
||||
- coord2: sample positions along the second mapped dimension
|
||||
- coord3: sample positions along the third mapped dimension
|
||||
*/
|
||||
| MAP LPAREN expr COMMA expr (COMMA expr (COMMA expr)?)? RPAREN # MapFunc
|
||||
/**
|
||||
ezconvolution(tensor, size_x, kernel) / ezconvolution(tensor, size_x, size_y, kernel) / ezconvolution(tensor, size_x, size_y, size_z, kernel) - convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates
|
||||
- tensor: input, channels first or last
|
||||
- size_x: kernel size along the first spatial dimension
|
||||
- size_y: kernel size along the second spatial dimension
|
||||
- size_z: kernel size along the third spatial dimension
|
||||
- kernel: expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre
|
||||
*/
|
||||
| EZCONV LPAREN expr (COMMA expr)+ RPAREN # EzConvFunc
|
||||
/**
|
||||
convolution(tensor, size_x, kernel) / convolution(tensor, size_x, size_y, kernel) / convolution(tensor, size_x, size_y, size_z, kernel) - convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates
|
||||
- tensor: input shaped [batch, channel, spatial...]
|
||||
- size_x: kernel size along the first spatial dimension
|
||||
- size_y: kernel size along the second spatial dimension
|
||||
- size_z: kernel size along the third spatial dimension
|
||||
- kernel: expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre
|
||||
*/
|
||||
| CONV LPAREN expr (COMMA expr)+ RPAREN # ConvFunc
|
||||
/**
|
||||
reshape(x, shape) - reshapes tensor x to the specified shape
|
||||
- shape: new shape; the total number of elements must stay the same
|
||||
*/
|
||||
| RESHAPE LPAREN expr COMMA expr RPAREN # ReshapeFunc
|
||||
/**
|
||||
squeeze(x, [dim]) - removes size-1 dimensions from tensor x, optionally at dim
|
||||
- dim: only remove this dimension, if it has size 1
|
||||
*/
|
||||
| SQUEEZE LPAREN expr (COMMA expr)? RPAREN # SqueezeFunc
|
||||
/**
|
||||
unsqueeze(x, dim) - inserts a size-1 dimension into tensor x at dim
|
||||
- dim: position of the new size-1 dimension
|
||||
*/
|
||||
| UNSQUEEZE LPAREN expr COMMA expr RPAREN # UnsqueezeFunc
|
||||
/**
|
||||
concatenate(x, ..., dim) - concatenates one or more tensors along the specified dimension
|
||||
- dim: dimension to join along (the last argument)
|
||||
*/
|
||||
| CONCAT LPAREN expr (COMMA expr)+ RPAREN # ConcatFunc
|
||||
/**
|
||||
stack(tensors, [dim]) - stacks a list of tensors along a new dimension
|
||||
- tensors: list of tensors with equal shapes
|
||||
- dim: position of the new dimension (default: 0)
|
||||
*/
|
||||
| STACK LPAREN expr (COMMA expr)? RPAREN # StackFunc
|
||||
/**
|
||||
@@ -1056,86 +1253,165 @@ funcN:
|
||||
funcNoise:
|
||||
/**
|
||||
random_normal(seed, [shape]) - generates normally distributed random noise
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
NOISE LPAREN expr (COMMA expr)? RPAREN # NoiseFunc
|
||||
/**
|
||||
pink_noise(seed, [shape]) - generates deterministic pink noise (approximately 1/f power spectrum) with zero mean and unit variance per row
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| PINK_NOISE LPAREN expr (COMMA expr)? RPAREN # PinkNoiseFunc
|
||||
/**
|
||||
brown_noise(seed, [shape]) - generates deterministic brown noise (approximately 1/f^2 power spectrum) with zero mean and unit variance per row
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| BROWN_NOISE LPAREN expr (COMMA expr)? RPAREN # BrownNoiseFunc
|
||||
/**
|
||||
random_uniform(seed, [shape]) - generates uniformly distributed random noise
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| RAND LPAREN expr (COMMA expr)? RPAREN # RandFunc
|
||||
/**
|
||||
random_exponential(seed, lambda, [shape]) - generates exponentially distributed random values
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- lambda: rate; the mean is 1 / lambda
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| EXPONENTIAL LPAREN expr COMMA expr (COMMA expr)? RPAREN # ExponentialFunc
|
||||
/**
|
||||
random_bernoulli(seed, probability, [shape]) - generates Bernoulli distributed random values (0 or 1). Probability can be a tensor
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- probability: chance of a 1; a tensor gives one probability per element and sets the shape
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| BERNOULLI LPAREN expr COMMA expr (COMMA expr)? RPAREN # BernoulliFunc
|
||||
/**
|
||||
random_poisson(seed, lambda, [shape]) - generates Poisson distributed random values.
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- lambda: expected count; a tensor gives one rate per element and sets the shape
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| POISSON LPAREN expr COMMA expr (COMMA expr)? RPAREN # PoissonFunc
|
||||
/**
|
||||
random_cauchy(seed, median, sigma, [shape]) - generates Cauchy distributed random values.
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- median: centre of the distribution
|
||||
- sigma: half width at half maximum
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| CAUCHY LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # CauchyFunc
|
||||
/**
|
||||
random_log_normal(seed, mean, std, [shape]) - generates log-normally distributed random values.
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- mean: mean of the underlying normal distribution
|
||||
- std: standard deviation of the underlying normal distribution
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| LOGNORMAL LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # LogNormalFunc
|
||||
/**
|
||||
random_gamma(seed, shape_param, scale, [shape]) - generates Gamma distributed random values.
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- shape_param: shape (concentration) k
|
||||
- scale: scale theta; the mean is k * theta
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| GAMMADIST LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # GammaDistFunc
|
||||
/**
|
||||
random_beta(seed, alpha, beta, [shape]) - generates Beta distributed random values
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- alpha: first concentration
|
||||
- beta: second concentration
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| BETADIST LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # BetaDistFunc
|
||||
/**
|
||||
random_laplace(seed, loc, scale, [shape]) - generates Laplace distributed random values
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- loc: centre of the distribution
|
||||
- scale: spread (diversity)
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| LAPLACEDIST LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # LaplaceDistFunc
|
||||
/**
|
||||
random_gumbel(seed, loc, scale, [shape]) - generates Gumbel distributed random values
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- loc: mode of the distribution
|
||||
- scale: spread
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| GUMBELDIST LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # GumbelDistFunc
|
||||
/**
|
||||
random_weibull(seed, scale, concentration, [shape]) - generates Weibull distributed random values
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- scale: scale lambda
|
||||
- concentration: shape k
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| WEIBULLDIST LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # WeibullDistFunc
|
||||
/**
|
||||
random_chi2(seed, df, [shape]) - generates Chi-squared distributed random values
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- df: degrees of freedom
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| CHI2DIST LPAREN expr COMMA expr (COMMA expr)? RPAREN # Chi2DistFunc
|
||||
/**
|
||||
random_studentt(seed, df, [shape]) - generates Student-t distributed random values
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- df: degrees of freedom
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| STUDENTTDIST LPAREN expr COMMA expr (COMMA expr)? RPAREN # StudentTDistFunc
|
||||
/**
|
||||
perlin_noise(seed, scale, [octaves], [offset], [shape]) - generates Perlin gradient noise in 0-1 (default 1 octave)
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- scale: feature size in elements; larger values give smoother noise
|
||||
- octaves: number of detail layers, each half the size of the previous (default: 1)
|
||||
- offset: shift of the sampling grid, one value per dimension (default: 0)
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| PERLIN LPAREN expr COMMA expr (COMMA expr)? (COMMA expr)? (COMMA expr)? RPAREN # PerlinFunc
|
||||
/**
|
||||
cellular_noise(seed, scale, [jitter], [offset], [shape]) - generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- scale: cell size in elements
|
||||
- jitter: 0-1 randomness of the cell points (default: 0.5)
|
||||
- offset: shift of the sampling grid, one value per dimension (default: 0)
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| CELLULAR LPAREN expr COMMA expr (COMMA expr)? (COMMA expr)? (COMMA expr)? RPAREN # CellularFunc
|
||||
/**
|
||||
plasma_noise(seed, scale, [octaves], [offset], [shape]) - generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- scale: feature size in elements; larger values give smoother noise
|
||||
- octaves: number of detail layers, each half the size of the previous (default: 4)
|
||||
- offset: shift of the sampling grid, one value per dimension (default: 0)
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| PLASMA LPAREN expr COMMA expr (COMMA expr)? (COMMA expr)? (COMMA expr)? RPAREN # PlasmaFunc
|
||||
/**
|
||||
ridged_noise(seed, scale, [octaves], [offset], [shape]) - generates ridged multi-fractal noise in 0-1 (default 4 octaves)
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- scale: feature size in elements; larger values give smoother noise
|
||||
- octaves: number of detail layers, each half the size of the previous (default: 4)
|
||||
- offset: shift of the sampling grid, one value per dimension (default: 0)
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| RIDGED LPAREN expr COMMA expr (COMMA expr)? (COMMA expr)? (COMMA expr)? RPAREN # RidgedFunc
|
||||
/**
|
||||
domain_warp_noise(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape]) - generates domain warped Perlin noise in 0-1 (defaults: 4 octaves, 2 warp octaves)
|
||||
- seed: random seed; the same seed always gives the same values
|
||||
- scale: feature size in elements; larger values give smoother noise
|
||||
- warp_scale: feature size of the warp field in elements
|
||||
- warp_strength: how far the warp field displaces the coordinates
|
||||
- octaves: detail layers of the base noise (default: 4)
|
||||
- warp_octaves: detail layers of the warp field (default: 2)
|
||||
- offset: shift of the sampling grid, one value per dimension (default: 0)
|
||||
- shape: output shape as a list (default: the shape of the node's input)
|
||||
*/
|
||||
| DOMAIN_WARP LPAREN expr COMMA expr COMMA expr COMMA expr (COMMA expr)? (COMMA expr)? (COMMA expr)? (COMMA expr)? RPAREN # DomainWarpFunc;
|
||||
|
||||
|
||||
@@ -385,12 +385,30 @@ $FUNCTIONS = @($functionWords | Sort-Object -Unique -CaseSensitive)
|
||||
$docEntries = Get-FunctionDocEntries -FuncSection $sections.FuncSection
|
||||
$sigByToken = @{}
|
||||
$detailsByToken = @{}
|
||||
$paramsByToken = @{}
|
||||
foreach ($e in $docEntries) {
|
||||
$sig = ConvertTo-FunctionSignature -Line $e.FirstLine
|
||||
if ($sig) {
|
||||
$sigByToken[$e.Token] = $sig
|
||||
$detailsByToken[$e.Token] = $e.Details -join "`n"
|
||||
if (-not $sig) { continue }
|
||||
$sigByToken[$e.Token] = $sig
|
||||
|
||||
# "- name: description" lines document one parameter; other lines are general details.
|
||||
$argNames = @($sig.Forms | ForEach-Object { $_ } | ForEach-Object { $_.Trim('[', ']', ' ').Replace('...', '') })
|
||||
$params = [ordered]@{}
|
||||
$details = New-Object System.Collections.Generic.List[string]
|
||||
foreach ($line in $e.Details) {
|
||||
$pm = [regex]::Match($line, '^-\s*(?<name>[a-zA-Z_][a-zA-Z0-9_]*)\s*:\s*(?<desc>.+)$')
|
||||
if (-not $pm.Success) {
|
||||
[void]$details.Add($line)
|
||||
continue
|
||||
}
|
||||
$paramName = $pm.Groups['name'].Value
|
||||
if ($argNames -notcontains $paramName) {
|
||||
Write-Warning "Doc comment for $($e.Token) describes parameter '$paramName', which is not in '$($sig.Signature)'."
|
||||
}
|
||||
$params[$paramName] = $pm.Groups['desc'].Value.Trim()
|
||||
}
|
||||
$paramsByToken[$e.Token] = $params
|
||||
$detailsByToken[$e.Token] = $details -join "`n"
|
||||
}
|
||||
|
||||
$functionTokens = @($functionTokenToWords.psbase.Keys)
|
||||
@@ -436,6 +454,7 @@ foreach ($token in $functionTokens) {
|
||||
Forms = $forms
|
||||
Description = if ($sig) { $sig.Description } else { '' }
|
||||
Details = if ($sig) { $detailsByToken[$token] } else { '' }
|
||||
Params = if ($sig) { $paramsByToken[$token] } else { [ordered]@{} }
|
||||
Aliases = @($words | Where-Object { $_ -ne $alias })
|
||||
}
|
||||
}
|
||||
@@ -491,6 +510,18 @@ function ConvertTo-PyForms {
|
||||
return '[' + (@($parts) -join ', ') + ']'
|
||||
}
|
||||
|
||||
function ConvertTo-JsObject {
|
||||
param([System.Collections.IDictionary]$Map)
|
||||
$parts = foreach ($key in @($Map.Keys)) { "$(ConvertTo-JsString $key): $(ConvertTo-JsString $Map[$key])" }
|
||||
return '{' + (@($parts) -join ', ') + '}'
|
||||
}
|
||||
|
||||
function ConvertTo-PyDict {
|
||||
param([System.Collections.IDictionary]$Map)
|
||||
$parts = foreach ($key in @($Map.Keys)) { "$(ConvertTo-PyString $key): $(ConvertTo-PyString $Map[$key])" }
|
||||
return '{' + (@($parts) -join ', ') + '}'
|
||||
}
|
||||
|
||||
function Write-JsSymbols {
|
||||
param(
|
||||
[string]$Path,
|
||||
@@ -519,7 +550,7 @@ function Write-JsSymbols {
|
||||
foreach ($name in @($FunctionMeta.psbase.Keys)) {
|
||||
$meta = $FunctionMeta[$name]
|
||||
$maxArgsJs = if ($null -eq $meta.MaxArgs) { 'null' } else { $meta.MaxArgs }
|
||||
[void]$sb.AppendLine(" $(ConvertTo-JsString $name): { minArgs: $($meta.MinArgs), maxArgs: $maxArgsJs, signature: $(ConvertTo-JsString $meta.Signature), forms: $(ConvertTo-JsForms $meta.Forms), description: $(ConvertTo-JsString $meta.Description), details: $(ConvertTo-JsString $meta.Details), aliases: $(ConvertTo-JsArray $meta.Aliases) },")
|
||||
[void]$sb.AppendLine(" $(ConvertTo-JsString $name): { minArgs: $($meta.MinArgs), maxArgs: $maxArgsJs, signature: $(ConvertTo-JsString $meta.Signature), forms: $(ConvertTo-JsForms $meta.Forms), description: $(ConvertTo-JsString $meta.Description), details: $(ConvertTo-JsString $meta.Details), params: $(ConvertTo-JsObject $meta.Params), aliases: $(ConvertTo-JsArray $meta.Aliases) },")
|
||||
}
|
||||
[void]$sb.AppendLine('};')
|
||||
|
||||
@@ -551,7 +582,7 @@ function Write-PySymbols {
|
||||
foreach ($name in @($FunctionMeta.psbase.Keys)) {
|
||||
$meta = $FunctionMeta[$name]
|
||||
$maxArgsPy = if ($null -eq $meta.MaxArgs) { 'None' } else { $meta.MaxArgs }
|
||||
[void]$sb.AppendLine(" $(ConvertTo-PyString $name): {'min_args': $($meta.MinArgs), 'max_args': $maxArgsPy, 'signature': $(ConvertTo-PyString $meta.Signature), 'forms': $(ConvertTo-PyForms $meta.Forms), 'description': $(ConvertTo-PyString $meta.Description), 'details': $(ConvertTo-PyString $meta.Details), 'aliases': $(ConvertTo-PyList $meta.Aliases)},")
|
||||
[void]$sb.AppendLine(" $(ConvertTo-PyString $name): {'min_args': $($meta.MinArgs), 'max_args': $maxArgsPy, 'signature': $(ConvertTo-PyString $meta.Signature), 'forms': $(ConvertTo-PyForms $meta.Forms), 'description': $(ConvertTo-PyString $meta.Description), 'details': $(ConvertTo-PyString $meta.Details), 'params': $(ConvertTo-PyDict $meta.Params), 'aliases': $(ConvertTo-PyList $meta.Aliases)},")
|
||||
}
|
||||
[void]$sb.AppendLine('}')
|
||||
|
||||
|
||||
+322
-322
@@ -10,326 +10,326 @@ INBUILT_FUNCTIONS = {
|
||||
}
|
||||
|
||||
INBUILT_FUNCTION_META = {
|
||||
'sin': {'min_args': 1, 'max_args': 1, 'signature': 'sin(x)', 'forms': [['x']], 'description': 'applies sine function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'cos': {'min_args': 1, 'max_args': 1, 'signature': 'cos(x)', 'forms': [['x']], 'description': 'applies cosine function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'tan': {'min_args': 1, 'max_args': 1, 'signature': 'tan(x)', 'forms': [['x']], 'description': 'applies tangent function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'asin': {'min_args': 1, 'max_args': 1, 'signature': 'asin(x)', 'forms': [['x']], 'description': 'applies arcus sine function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'acos': {'min_args': 1, 'max_args': 1, 'signature': 'acos(x)', 'forms': [['x']], 'description': 'applies arcus cosine function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'atan': {'min_args': 1, 'max_args': 1, 'signature': 'atan(x)', 'forms': [['x']], 'description': 'applies arcus tangent function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'atan2': {'min_args': 2, 'max_args': 2, 'signature': 'atan2(y, x)', 'forms': [['y', 'x']], 'description': 'computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant', 'details': '', 'aliases': []},
|
||||
'sinh': {'min_args': 1, 'max_args': 1, 'signature': 'sinh(x)', 'forms': [['x']], 'description': 'applies hyperbolic sine function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'cosh': {'min_args': 1, 'max_args': 1, 'signature': 'cosh(x)', 'forms': [['x']], 'description': 'applies hyperbolic cosine function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'tanh': {'min_args': 1, 'max_args': 1, 'signature': 'tanh(x)', 'forms': [['x']], 'description': 'applies hyperbolic tangent function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'asinh': {'min_args': 1, 'max_args': 1, 'signature': 'asinh(x)', 'forms': [['x']], 'description': 'applies hyperbolic arcus sine function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'acosh': {'min_args': 1, 'max_args': 1, 'signature': 'acosh(x)', 'forms': [['x']], 'description': 'applies hyperbolic arcus cosine function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'atanh': {'min_args': 1, 'max_args': 1, 'signature': 'atanh(x)', 'forms': [['x']], 'description': 'applies hyperbolic arcus tangent function to value or each element of value', 'details': '', 'aliases': []},
|
||||
'abs': {'min_args': 1, 'max_args': 1, 'signature': 'abs(x)', 'forms': [['x']], 'description': 'applies per element absolute value function. Same as |x| for numbers.', 'details': '', 'aliases': []},
|
||||
'sqrt': {'min_args': 1, 'max_args': 1, 'signature': 'sqrt(x)', 'forms': [['x']], 'description': 'applies square root per element. Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
|
||||
'ln': {'min_args': 1, 'max_args': 1, 'signature': 'ln(x)', 'forms': [['x']], 'description': 'applies natural logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
|
||||
'log': {'min_args': 1, 'max_args': 1, 'signature': 'log(x)', 'forms': [['x']], 'description': 'applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
|
||||
'log2': {'min_args': 1, 'max_args': 1, 'signature': 'log2(x)', 'forms': [['x']], 'description': 'applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'aliases': []},
|
||||
'exp': {'min_args': 1, 'max_args': 1, 'signature': 'exp(x)', 'forms': [['x']], 'description': 'applies e^x to value (per element)', 'details': '', 'aliases': []},
|
||||
'log1p': {'min_args': 1, 'max_args': 1, 'signature': 'log1p(x)', 'forms': [['x']], 'description': 'applies ln(1+x) accurately for values near zero', 'details': '', 'aliases': []},
|
||||
'expm1': {'min_args': 1, 'max_args': 1, 'signature': 'expm1(x)', 'forms': [['x']], 'description': 'applies exp(x)-1 accurately for values near zero', 'details': '', 'aliases': []},
|
||||
'sinc': {'min_args': 1, 'max_args': 1, 'signature': 'sinc(x)', 'forms': [['x']], 'description': 'computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1', 'details': '', 'aliases': []},
|
||||
'cbrt': {'min_args': 1, 'max_args': 1, 'signature': 'cbrt(x)', 'forms': [['x']], 'description': 'computes the real cube root of each value, including negative values', 'details': '', 'aliases': []},
|
||||
'reciprocal': {'min_args': 1, 'max_args': 1, 'signature': 'reciprocal(x)', 'forms': [['x']], 'description': 'computes 1/x element-wise', 'details': '', 'aliases': []},
|
||||
'logaddexp': {'min_args': 2, 'max_args': 2, 'signature': 'logaddexp(x, y)', 'forms': [['x', 'y']], 'description': 'computes log(exp(x) + exp(y)) element-wise using a numerically stable method', 'details': '', 'aliases': []},
|
||||
'logsumexp': {'min_args': 1, 'max_args': 2, 'signature': 'logsumexp(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions', 'details': '', 'aliases': []},
|
||||
'norm': {'min_args': 1, 'max_args': 3, 'signature': 'norm(x, [p], [dims])', 'forms': [['x', '[p]', '[dims]']], 'description': 'computes the p-norm globally or along one or more dimensions (default p=2)', 'details': '', 'aliases': []},
|
||||
'normalize': {'min_args': 1, 'max_args': 4, 'signature': 'normalize(x, [p], [dim], [eps])', 'forms': [['x', '[p]', '[dim]', '[eps]']], 'description': 'normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)', 'details': '', 'aliases': []},
|
||||
'group_norm': {'min_args': 2, 'max_args': 5, 'signature': 'group_norm(x, groups, [weight], [bias], [eps])', 'forms': [['x', 'groups', '[weight]', '[bias]', '[eps]']], 'description': 'applies channel-first GroupNorm to [N, C, ...] input', 'details': '', 'aliases': []},
|
||||
'outer': {'min_args': 2, 'max_args': 2, 'signature': 'outer(x, y)', 'forms': [['x', 'y']], 'description': 'computes the outer product of flattened x and y', 'details': '', 'aliases': []},
|
||||
'trace': {'min_args': 1, 'max_args': 1, 'signature': 'trace(x)', 'forms': [['x']], 'description': 'sums the main diagonal of each square matrix in x', 'details': '', 'aliases': []},
|
||||
'det': {'min_args': 1, 'max_args': 1, 'signature': 'det(x)', 'forms': [['x']], 'description': 'computes the determinant of each square matrix in x', 'details': '', 'aliases': []},
|
||||
'rfft': {'min_args': 1, 'max_args': 2, 'signature': 'rfft(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the one-dimensional real-input FFT along dim (default: last dimension)', 'details': '', 'aliases': []},
|
||||
'irfft': {'min_args': 1, 'max_args': 3, 'signature': 'irfft(x, [n], [dim])', 'forms': [['x', '[n]', '[dim]']], 'description': 'computes the inverse one-dimensional real FFT along dim (default: last dimension)', 'details': '', 'aliases': []},
|
||||
'isnan': {'min_args': 1, 'max_args': 1, 'signature': 'isnan(x)', 'forms': [['x']], 'description': 'returns 1.0 for NaN values and 0.0 otherwise', 'details': '', 'aliases': []},
|
||||
'isinf': {'min_args': 1, 'max_args': 1, 'signature': 'isinf(x)', 'forms': [['x']], 'description': 'returns 1.0 for infinite values and 0.0 otherwise', 'details': '', 'aliases': []},
|
||||
'isfinite': {'min_args': 1, 'max_args': 1, 'signature': 'isfinite(x)', 'forms': [['x']], 'description': 'returns 1.0 for finite values and 0.0 otherwise', 'details': '', 'aliases': []},
|
||||
'smin': {'min_args': 1, 'max_args': None, 'signature': 'smin(x, ...)', 'forms': [['x', '...']], 'description': 'computes the minimum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smin(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.', 'details': '', 'aliases': []},
|
||||
'smax': {'min_args': 1, 'max_args': None, 'signature': 'smax(x, ...)', 'forms': [['x', '...']], 'description': 'computes the maximum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smax(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.', 'details': '', 'aliases': []},
|
||||
'tmin': {'min_args': 2, 'max_args': 2, 'signature': 'tmin(x, y)', 'forms': [['x', 'y']], 'description': 'elementwise minimum of tensor or list. min(x,y) when inputs are floats', 'details': '', 'aliases': []},
|
||||
'tmax': {'min_args': 2, 'max_args': 2, 'signature': 'tmax(x,y)', 'forms': [['x', 'y']], 'description': 'elementwise maximum of tensor or list. max(x,y) when inputs are floats', 'details': '', 'aliases': []},
|
||||
'tnorm': {'min_args': 1, 'max_args': 2, 'signature': 'tnorm(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'normalises tensor or list by multiplication such that sum(x^2)==1.0 for each slice. Defaults to the last dimension; dim selects a different slicing dimension.', 'details': '', 'aliases': []},
|
||||
'snorm': {'min_args': 1, 'max_args': 2, 'signature': 'snorm(x,[dim])', 'forms': [['x', '[dim]']], 'description': 'frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.', 'details': '', 'aliases': []},
|
||||
'floor': {'min_args': 1, 'max_args': 1, 'signature': 'floor(x)', 'forms': [['x']], 'description': 'returns the largest integer less than or equal to x', 'details': '', 'aliases': []},
|
||||
'ceil': {'min_args': 1, 'max_args': 1, 'signature': 'ceil(x)', 'forms': [['x']], 'description': 'returns the smallest integer greater than or equal to x', 'details': '', 'aliases': []},
|
||||
'round': {'min_args': 1, 'max_args': 1, 'signature': 'round(x)', 'forms': [['x']], 'description': 'rounds x to the nearest integer', 'details': '', 'aliases': []},
|
||||
'gamma': {'min_args': 1, 'max_args': 1, 'signature': 'gamma(x)', 'forms': [['x']], 'description': 'computes the gamma function (per element)', 'details': '', 'aliases': []},
|
||||
'pow': {'min_args': 2, 'max_args': 2, 'signature': 'pow(x, y)', 'forms': [['x', 'y']], 'description': 'computes x raised to the power of y', 'details': '', 'aliases': []},
|
||||
'sigm': {'min_args': 1, 'max_args': 1, 'signature': 'sigm(x)', 'forms': [['x']], 'description': 'applies the sigmoid function: 1 / (1 + exp(-x))', 'details': '', 'aliases': []},
|
||||
'clamp': {'min_args': 3, 'max_args': 3, 'signature': 'clamp(x, min, max)', 'forms': [['x', 'min', 'max']], 'description': 'clamps x between min and max per element', 'details': '', 'aliases': []},
|
||||
'fft': {'min_args': 1, 'max_args': 1, 'signature': 'fft(x)', 'forms': [['x']], 'description': 'computes fast Fourier transform of x', 'details': '', 'aliases': []},
|
||||
'ifft': {'min_args': 1, 'max_args': 2, 'signature': 'ifft(x, [shape])', 'forms': [['x', '[shape]']], 'description': 'inverse fast Fourier transform of x. shape (defaults to the node\'s tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.', 'details': '', 'aliases': []},
|
||||
'angle': {'min_args': 1, 'max_args': 1, 'signature': 'angle(x)', 'forms': [['x']], 'description': 'returns the angle of a complex number or vector', 'details': '', 'aliases': []},
|
||||
'print': {'min_args': 1, 'max_args': 1, 'signature': 'print(x)', 'forms': [['x']], 'description': 'prints the value of x to the console while passing output unchanged', 'details': '', 'aliases': []},
|
||||
'print_shape': {'min_args': 1, 'max_args': 1, 'signature': 'print_shape(x)', 'forms': [['x']], 'description': 'prints the shape of the tensor x', 'details': '', 'aliases': ['pshp']},
|
||||
'pshp': {'min_args': 1, 'max_args': 1, 'signature': 'pshp(x)', 'forms': [['x']], 'description': 'prints the shape of the tensor x', 'details': '', 'aliases': ['print_shape']},
|
||||
'nvl': {'min_args': 4, 'max_args': 4, 'signature': 'nvl(x, nan, pos_inf, neg_inf)', 'forms': [['x', 'nan', 'pos_inf', 'neg_inf']], 'description': 'replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)', 'details': '', 'aliases': ['nan_to_num']},
|
||||
'nan_to_num': {'min_args': 4, 'max_args': 4, 'signature': 'nan_to_num(x, nan, pos_inf, neg_inf)', 'forms': [['x', 'nan', 'pos_inf', 'neg_inf']], 'description': 'replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)', 'details': '', 'aliases': ['nvl']},
|
||||
'lerp': {'min_args': 3, 'max_args': 3, 'signature': 'lerp(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'linear interpolation between a and b by t per element. t can be float or tensor.', 'details': '', 'aliases': []},
|
||||
'slerp': {'min_args': 3, 'max_args': 4, 'signature': 'slerp(a, b, t, [dim])', 'forms': [['a', 'b', 't', '[dim]']], 'description': 'interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.', 'details': '', 'aliases': []},
|
||||
'step': {'min_args': 2, 'max_args': 2, 'signature': 'step(x, edge)', 'forms': [['x', 'edge']], 'description': 'returns 0 if x < edge, else 1', 'details': '', 'aliases': []},
|
||||
'smoothstep': {'min_args': 3, 'max_args': 3, 'signature': 'smoothstep(x, edge0, edge1)', 'forms': [['x', 'edge0', 'edge1']], 'description': 'smooth interpolation between edge0 and edge1', 'details': '', 'aliases': []},
|
||||
'fract': {'min_args': 1, 'max_args': 1, 'signature': 'fract(x)', 'forms': [['x']], 'description': 'returns the fractional part of x: x - floor(x)', 'details': '', 'aliases': []},
|
||||
'relu': {'min_args': 1, 'max_args': 1, 'signature': 'relu(x)', 'forms': [['x']], 'description': 'applies rectified linear unit function: max(0, x)', 'details': '', 'aliases': []},
|
||||
'softsign': {'min_args': 1, 'max_args': 1, 'signature': 'softsign(x)', 'forms': [['x']], 'description': 'applies x / (1 + abs(x)) element-wise', 'details': '', 'aliases': []},
|
||||
'leaky_relu': {'min_args': 1, 'max_args': 2, 'signature': 'leaky_relu(x, [negative_slope])', 'forms': [['x', '[negative_slope]']], 'description': 'applies leaky ReLU element-wise; negative_slope defaults to 0.01', 'details': '', 'aliases': []},
|
||||
'softplus': {'min_args': 1, 'max_args': 1, 'signature': 'softplus(x)', 'forms': [['x']], 'description': 'applies the softplus function: ln(1 + exp(x))', 'details': '', 'aliases': []},
|
||||
'gelu': {'min_args': 1, 'max_args': 1, 'signature': 'gelu(x)', 'forms': [['x']], 'description': 'applies the Gaussian Error Linear Unit (GELU) activation function', 'details': '', 'aliases': []},
|
||||
'silu': {'min_args': 1, 'max_args': 1, 'signature': 'silu(x)', 'forms': [['x']], 'description': 'applies the Sigmoid Linear Unit activation element-wise', 'details': '', 'aliases': []},
|
||||
'sign': {'min_args': 1, 'max_args': 1, 'signature': 'sign(x)', 'forms': [['x']], 'description': 'returns the sign of x: -1, 0, or 1', 'details': '', 'aliases': []},
|
||||
'degrees': {'min_args': 1, 'max_args': 1, 'signature': 'degrees(x)', 'forms': [['x']], 'description': 'converts radians to degrees (per element)', 'details': '', 'aliases': []},
|
||||
'radians': {'min_args': 1, 'max_args': 1, 'signature': 'radians(x)', 'forms': [['x']], 'description': 'converts degrees to radians (per element)', 'details': '', 'aliases': []},
|
||||
'logical_not': {'min_args': 1, 'max_args': 1, 'signature': 'logical_not(x)', 'forms': [['x']], 'description': 'returns 1.0 where x is zero and 0.0 otherwise', 'details': '', 'aliases': []},
|
||||
'logical_and': {'min_args': 2, 'max_args': 2, 'signature': 'logical_and(x, y)', 'forms': [['x', 'y']], 'description': 'returns 1.0 if both values are non-zero, else 0.0', 'details': '', 'aliases': []},
|
||||
'logical_or': {'min_args': 2, 'max_args': 2, 'signature': 'logical_or(x, y)', 'forms': [['x', 'y']], 'description': 'returns 1.0 if either value is non-zero, else 0.0', 'details': '', 'aliases': []},
|
||||
'hypot': {'min_args': 2, 'max_args': 2, 'signature': 'hypot(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise Euclidean distance from the origin', 'details': '', 'aliases': []},
|
||||
'map': {'min_args': 2, 'max_args': 4, 'signature': 'map(tensor, coord1, [coord2], [coord3])', 'forms': [['tensor', 'coord1', '[coord2]', '[coord3]']], 'description': 'samples/remaps input tensor using coordinates', 'details': '', 'aliases': []},
|
||||
'ezconvolution': {'min_args': 3, 'max_args': 5, 'signature': 'ezconvolution(tensor, size_x, kernel) / ezconvolution(tensor, size_x, size_y, kernel) / ezconvolution(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'aliases': ['ezconv']},
|
||||
'ezconv': {'min_args': 3, 'max_args': 5, 'signature': 'ezconv(tensor, size_x, kernel) / ezconv(tensor, size_x, size_y, kernel) / ezconv(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'aliases': ['ezconvolution']},
|
||||
'convolution': {'min_args': 3, 'max_args': 5, 'signature': 'convolution(tensor, size_x, kernel) / convolution(tensor, size_x, size_y, kernel) / convolution(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'aliases': ['conv']},
|
||||
'conv': {'min_args': 3, 'max_args': 5, 'signature': 'conv(tensor, size_x, kernel) / conv(tensor, size_x, size_y, kernel) / conv(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'aliases': ['convolution']},
|
||||
'swap': {'min_args': 4, 'max_args': 4, 'signature': 'swap(x, dim, idx1, idx2)', 'forms': [['x', 'dim', 'idx1', 'idx2']], 'description': 'swaps elements along dim between idx1 and idx2', 'details': '', 'aliases': []},
|
||||
'transpose': {'min_args': 3, 'max_args': 3, 'signature': 'transpose(x, dim0, dim1) / transpose(x, dim0, dim1)', 'forms': [['x', 'dim0', 'dim1'], ['x', 'dim0', 'dim1']], 'description': 'swaps two tensor dimensions', 'details': '', 'aliases': ['swapaxes']},
|
||||
'swapaxes': {'min_args': 3, 'max_args': 3, 'signature': 'swapaxes(x, dim0, dim1) / swapaxes(x, dim0, dim1)', 'forms': [['x', 'dim0', 'dim1'], ['x', 'dim0', 'dim1']], 'description': 'swaps two tensor dimensions', 'details': '', 'aliases': ['transpose']},
|
||||
'permute': {'min_args': 2, 'max_args': 2, 'signature': 'permute(x, dims)', 'forms': [['x', 'dims']], 'description': 'permutes the dimensions of tensor x according to dims', 'details': '', 'aliases': ['perm']},
|
||||
'perm': {'min_args': 2, 'max_args': 2, 'signature': 'perm(x, dims)', 'forms': [['x', 'dims']], 'description': 'permutes the dimensions of tensor x according to dims', 'details': '', 'aliases': ['permute']},
|
||||
'reshape': {'min_args': 2, 'max_args': 2, 'signature': 'reshape(x, shape)', 'forms': [['x', 'shape']], 'description': 'reshapes tensor x to the specified shape', 'details': '', 'aliases': ['rshp']},
|
||||
'rshp': {'min_args': 2, 'max_args': 2, 'signature': 'rshp(x, shape)', 'forms': [['x', 'shape']], 'description': 'reshapes tensor x to the specified shape', 'details': '', 'aliases': ['reshape']},
|
||||
'range': {'min_args': 3, 'max_args': 3, 'signature': 'range(start, stop, step)', 'forms': [['start', 'stop', 'step']], 'description': 'creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.', 'details': '', 'aliases': []},
|
||||
'linspace': {'min_args': 3, 'max_args': 3, 'signature': 'linspace(start, stop, num)', 'forms': [['start', 'stop', 'num']], 'description': 'creates num linearly spaced values from start to stop (inclusive). Use range if you want to control the step between values.', 'details': '', 'aliases': []},
|
||||
'logspace': {'min_args': 4, 'max_args': 4, 'signature': 'logspace(start, stop, num, base)', 'forms': [['start', 'stop', 'num', 'base']], 'description': 'creates logarithmically spaced values', 'details': '', 'aliases': []},
|
||||
'topk': {'min_args': 2, 'max_args': 3, 'signature': 'topk(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.', 'details': '', 'aliases': []},
|
||||
'botk': {'min_args': 2, 'max_args': 3, 'signature': 'botk(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.', 'details': '', 'aliases': []},
|
||||
'pinv': {'min_args': 1, 'max_args': 1, 'signature': 'pinv(x)', 'forms': [['x']], 'description': 'computes the inverse permutation of x: where x[i] == j the result has result[j] == i. Not the matrix pseudoinverse; use inv(x, 1) for that', 'details': '', 'aliases': []},
|
||||
'inv': {'min_args': 1, 'max_args': 2, 'signature': 'inv(x, [pseudo])', 'forms': [['x', '[pseudo]']], 'description': 'computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead', 'details': '', 'aliases': []},
|
||||
'sum': {'min_args': 1, 'max_args': 2, 'signature': 'sum(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the sum of elements of x, optionally along one or more dimensions', 'details': '', 'aliases': []},
|
||||
'mean': {'min_args': 1, 'max_args': 2, 'signature': 'mean(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the arithmetic mean of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
|
||||
'std': {'min_args': 1, 'max_args': 2, 'signature': 'std(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the sample standard deviation of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
|
||||
'var': {'min_args': 1, 'max_args': 2, 'signature': 'var(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the sample variance of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
|
||||
'prod': {'min_args': 1, 'max_args': 2, 'signature': 'prod(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the product of elements of x globally or along one or more dimensions', 'details': '', 'aliases': []},
|
||||
'isclose': {'min_args': 2, 'max_args': 4, 'signature': 'isclose(a, b, [rtol], [atol])', 'forms': [['a', 'b', '[rtol]', '[atol]']], 'description': 'elementwise approximate equality test', 'details': '', 'aliases': []},
|
||||
'allclose': {'min_args': 2, 'max_args': 4, 'signature': 'allclose(a, b, [rtol], [atol])', 'forms': [['a', 'b', '[rtol]', '[atol]']], 'description': 'returns 1.0 if all elements are approximately equal, else 0.0', 'details': '', 'aliases': []},
|
||||
'quartile': {'min_args': 2, 'max_args': 3, 'signature': 'quartile(x, q, [dim])', 'forms': [['x', 'q', '[dim]']], 'description': 'computes the q-th quartile globally or along dim', 'details': '', 'aliases': ['quartil']},
|
||||
'quartil': {'min_args': 2, 'max_args': 3, 'signature': 'quartil(x, q, [dim])', 'forms': [['x', 'q', '[dim]']], 'description': 'computes the q-th quartile globally or along dim', 'details': '', 'aliases': ['quartile']},
|
||||
'percentile': {'min_args': 2, 'max_args': 3, 'signature': 'percentile(x, p, [dim])', 'forms': [['x', 'p', '[dim]']], 'description': 'computes the p-th percentile globally or along dim', 'details': '', 'aliases': ['prcnt']},
|
||||
'prcnt': {'min_args': 2, 'max_args': 3, 'signature': 'prcnt(x, p, [dim])', 'forms': [['x', 'p', '[dim]']], 'description': 'computes the p-th percentile globally or along dim', 'details': '', 'aliases': ['percentile']},
|
||||
'quantile': {'min_args': 2, 'max_args': 3, 'signature': 'quantile(x, q, [dim])', 'forms': [['x', 'q', '[dim]']], 'description': 'computes the q-th quantile globally or along dim', 'details': '', 'aliases': []},
|
||||
'dot': {'min_args': 2, 'max_args': 2, 'signature': 'dot(x, y)', 'forms': [['x', 'y']], 'description': 'computes the dot product of x and y after flattening both to 1D. Use cross(x, y) if you need a per-vector product with the last dimension kept.', 'details': '', 'aliases': []},
|
||||
'moment': {'min_args': 3, 'max_args': 3, 'signature': 'moment(x, a, k)', 'forms': [['x', 'a', 'k']], 'description': 'computes the k-th moment of x around a', 'details': '', 'aliases': []},
|
||||
'erf': {'min_args': 1, 'max_args': 1, 'signature': 'erf(x)', 'forms': [['x']], 'description': 'computes the error function (torch.erf)', 'details': '', 'aliases': []},
|
||||
'erfc': {'min_args': 1, 'max_args': 1, 'signature': 'erfc(x)', 'forms': [['x']], 'description': 'computes the complementary error function (torch.special.erfc)', 'details': '', 'aliases': []},
|
||||
'erfinv': {'min_args': 1, 'max_args': 1, 'signature': 'erfinv(x)', 'forms': [['x']], 'description': 'computes the inverse error function (torch.erfinv)', 'details': '', 'aliases': []},
|
||||
'any': {'min_args': 1, 'max_args': 1, 'signature': 'any(x)', 'forms': [['x']], 'description': 'returns 1 if any element of x is non-zero otherwise 0', 'details': '', 'aliases': []},
|
||||
'all': {'min_args': 1, 'max_args': 1, 'signature': 'all(x)', 'forms': [['x']], 'description': 'returns 1 if all elements of x are non-zero otherwise 0', 'details': '', 'aliases': []},
|
||||
'edge': {'min_args': 1, 'max_args': 2, 'signature': 'edge(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'detects edges in x with a Sobel filter. kernel_size must be odd and at least 3 (default 3).', 'details': '', 'aliases': []},
|
||||
'blur': {'min_args': 2, 'max_args': 3, 'signature': 'blur(x, sigma, [reshape])', 'forms': [['x', 'sigma', '[reshape]']], 'description': 'applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.', 'details': '', 'aliases': ['gaussian']},
|
||||
'gaussian': {'min_args': 2, 'max_args': 3, 'signature': 'gaussian(x, sigma, [reshape])', 'forms': [['x', 'sigma', '[reshape]']], 'description': 'applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.', 'details': '', 'aliases': ['blur']},
|
||||
'median': {'min_args': 1, 'max_args': 2, 'signature': 'median(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the median globally or along one dimension', 'details': '', 'aliases': []},
|
||||
'mode': {'min_args': 1, 'max_args': 2, 'signature': 'mode(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the mode globally or along one dimension', 'details': '', 'aliases': []},
|
||||
'cumsum': {'min_args': 1, 'max_args': 2, 'signature': 'cumsum(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the cumulative sum, defaulting to the first dimension.', 'details': '', 'aliases': []},
|
||||
'cumprod': {'min_args': 1, 'max_args': 1, 'signature': 'cumprod(x)', 'forms': [['x']], 'description': 'computes the cumulative product over first dimension.', 'details': '', 'aliases': []},
|
||||
'topk_ind': {'min_args': 2, 'max_args': 3, 'signature': 'topk_ind(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'aliases': ['topk_indices']},
|
||||
'topk_indices': {'min_args': 2, 'max_args': 3, 'signature': 'topk_indices(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'aliases': ['topk_ind']},
|
||||
'botk_ind': {'min_args': 2, 'max_args': 3, 'signature': 'botk_ind(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'aliases': ['botk_indices']},
|
||||
'botk_indices': {'min_args': 2, 'max_args': 3, 'signature': 'botk_indices(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'aliases': ['botk_ind']},
|
||||
'cubic_ease': {'min_args': 3, 'max_args': 3, 'signature': 'cubic_ease(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'cubic ease between a and b', 'details': '', 'aliases': ['cubic']},
|
||||
'cubic': {'min_args': 3, 'max_args': 3, 'signature': 'cubic(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'cubic ease between a and b', 'details': '', 'aliases': ['cubic_ease']},
|
||||
'elastic_ease': {'min_args': 3, 'max_args': 3, 'signature': 'elastic_ease(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'elastic ease between a and b', 'details': '', 'aliases': ['elastic']},
|
||||
'elastic': {'min_args': 3, 'max_args': 3, 'signature': 'elastic(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'elastic ease between a and b', 'details': '', 'aliases': ['elastic_ease']},
|
||||
'sine_ease': {'min_args': 3, 'max_args': 3, 'signature': 'sine_ease(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'sine easing between a and b', 'details': '', 'aliases': ['sine']},
|
||||
'sine': {'min_args': 3, 'max_args': 3, 'signature': 'sine(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'sine easing between a and b', 'details': '', 'aliases': ['sine_ease']},
|
||||
'smootherstep': {'min_args': 3, 'max_args': 3, 'signature': 'smootherstep(x, edge0, edge1)', 'forms': [['x', 'edge0', 'edge1']], 'description': 'smoother interpolation between edge0 and edge1', 'details': '', 'aliases': []},
|
||||
'dist': {'min_args': 4, 'max_args': 4, 'signature': 'dist(x1, y1, x2, y2)', 'forms': [['x1', 'y1', 'x2', 'y2']], 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)', 'details': '', 'aliases': ['distance']},
|
||||
'distance': {'min_args': 4, 'max_args': 4, 'signature': 'distance(x1, y1, x2, y2)', 'forms': [['x1', 'y1', 'x2', 'y2']], 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)', 'details': '', 'aliases': ['dist']},
|
||||
'remap': {'min_args': 5, 'max_args': 5, 'signature': 'remap(v, i_min, i_max, o_min, o_max)', 'forms': [['v', 'i_min', 'i_max', 'o_min', 'o_max']], 'description': 'remaps values from input range to output range', 'details': '', 'aliases': []},
|
||||
'cossim': {'min_args': 2, 'max_args': 2, 'signature': 'cossim(x, y)', 'forms': [['x', 'y']], 'description': 'computes the cosine similarity between x and y.', 'details': '', 'aliases': ['cosine_similarity']},
|
||||
'cosine_similarity': {'min_args': 2, 'max_args': 2, 'signature': 'cosine_similarity(x, y)', 'forms': [['x', 'y']], 'description': 'computes the cosine similarity between x and y.', 'details': '', 'aliases': ['cossim']},
|
||||
'count': {'min_args': 1, 'max_args': 1, 'signature': 'count(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['cnt', 'length']},
|
||||
'cnt': {'min_args': 1, 'max_args': 1, 'signature': 'cnt(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['count', 'length']},
|
||||
'length': {'min_args': 1, 'max_args': 1, 'signature': 'length(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'aliases': ['count', 'cnt']},
|
||||
'keys': {'min_args': 1, 'max_args': 1, 'signature': 'keys(x)', 'forms': [['x']], 'description': 'returns a list of dictionary keys in insertion order', 'details': '', 'aliases': []},
|
||||
'enable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'enable_tracking(d)', 'forms': [['d']], 'description': 'enables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_on']},
|
||||
'track_on': {'min_args': 1, 'max_args': 1, 'signature': 'track_on(d)', 'forms': [['d']], 'description': 'enables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['enable_tracking']},
|
||||
'disable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'disable_tracking(d)', 'forms': [['d']], 'description': 'disables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_off']},
|
||||
'track_off': {'min_args': 1, 'max_args': 1, 'signature': 'track_off(d)', 'forms': [['d']], 'description': 'disables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['disable_tracking']},
|
||||
'reset_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'reset_tracking(d)', 'forms': [['d']], 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['track_reset']},
|
||||
'track_reset': {'min_args': 1, 'max_args': 1, 'signature': 'track_reset(d)', 'forms': [['d']], 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)', 'details': '', 'aliases': ['reset_tracking']},
|
||||
'get_changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_changed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d', 'details': '', 'aliases': ['changed_keys']},
|
||||
'changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'changed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d', 'details': '', 'aliases': ['get_changed_keys']},
|
||||
'get_added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_added_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d', 'details': '', 'aliases': ['added_keys']},
|
||||
'added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'added_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d', 'details': '', 'aliases': ['get_added_keys']},
|
||||
'get_removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_removed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were removed from ChangeTrackingDict d', 'details': '', 'aliases': ['removed_keys']},
|
||||
'removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'removed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were removed from ChangeTrackingDict d', 'details': '', 'aliases': ['get_removed_keys']},
|
||||
'get_unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_unchanged_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d', 'details': '', 'aliases': ['unchanged_keys']},
|
||||
'unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'unchanged_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d', 'details': '', 'aliases': ['get_unchanged_keys']},
|
||||
'repeat': {'min_args': 2, 'max_args': 3, 'signature': 'repeat(x, count, [dims])', 'forms': [['x', 'count', '[dims]']], 'description': 'repeats tensor elements; count may be scalar or per-dim list', 'details': '', 'aliases': []},
|
||||
'flatten': {'min_args': 1, 'max_args': 1, 'signature': 'flatten(x)', 'forms': [['x']], 'description': 'flattens tensor into a 1D tensor', 'details': '', 'aliases': []},
|
||||
'append': {'min_args': 2, 'max_args': 2, 'signature': 'append(x, y)', 'forms': [['x', 'y']], 'description': 'appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)', 'details': '', 'aliases': []},
|
||||
'get_value': {'min_args': 2, 'max_args': 2, 'signature': 'get_value(tensor, position)', 'forms': [['tensor', 'position']], 'description': 'reads the value at an N-D position of tensor. Superseded by tensor[position] indexing', 'details': '', 'aliases': []},
|
||||
'flow_apply': {'min_args': 2, 'max_args': 2, 'signature': 'flow_apply(image, flow)', 'forms': [['image', 'flow']], 'description': 'applies optical flow to an image', 'details': '', 'aliases': []},
|
||||
'batch_shuffle': {'min_args': 2, 'max_args': 2, 'signature': 'batch_shuffle(x, indices)', 'forms': [['x', 'indices']], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['shuffle', 'select']},
|
||||
'shuffle': {'min_args': 2, 'max_args': 2, 'signature': 'shuffle(x, indices)', 'forms': [['x', 'indices']], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['batch_shuffle', 'select']},
|
||||
'select': {'min_args': 2, 'max_args': 2, 'signature': 'select(x, indices)', 'forms': [['x', 'indices']], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'aliases': ['batch_shuffle', 'shuffle']},
|
||||
'motion_mask': {'min_args': 1, 'max_args': 1, 'signature': 'motion_mask(x)', 'forms': [['x']], 'description': 'generates a motion mask from optical flow', 'details': '', 'aliases': []},
|
||||
'flow_to_image': {'min_args': 1, 'max_args': 1, 'signature': 'flow_to_image(x)', 'forms': [['x']], 'description': 'converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta.', 'details': '', 'aliases': []},
|
||||
'flow_mag': {'min_args': 1, 'max_args': 1, 'signature': 'flow_mag(x)', 'forms': [['x']], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'aliases': ['flow_magnitude']},
|
||||
'flow_magnitude': {'min_args': 1, 'max_args': 1, 'signature': 'flow_magnitude(x)', 'forms': [['x']], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'aliases': ['flow_mag']},
|
||||
'flow_ang': {'min_args': 1, 'max_args': 1, 'signature': 'flow_ang(x)', 'forms': [['x']], 'description': 'computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)', 'details': '', 'aliases': ['flow_angle']},
|
||||
'flow_angle': {'min_args': 1, 'max_args': 1, 'signature': 'flow_angle(x)', 'forms': [['x']], 'description': 'computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)', 'details': '', 'aliases': ['flow_ang']},
|
||||
'where': {'min_args': 3, 'max_args': 3, 'signature': 'where(condition, x, y)', 'forms': [['condition', 'x', 'y']], 'description': 'returns x if condition is true, else y. Runs per element.', 'details': '', 'aliases': []},
|
||||
'histogram': {'min_args': 4, 'max_args': 4, 'signature': 'histogram(x, bins, min, max)', 'forms': [['x', 'bins', 'min', 'max']], 'description': 'counts the elements of flatten(x) in bins equal-width bins over [min, max]', 'details': '', 'aliases': ['hist']},
|
||||
'hist': {'min_args': 4, 'max_args': 4, 'signature': 'hist(x, bins, min, max)', 'forms': [['x', 'bins', 'min', 'max']], 'description': 'counts the elements of flatten(x) in bins equal-width bins over [min, max]', 'details': '', 'aliases': ['histogram']},
|
||||
'overlay': {'min_args': 3, 'max_args': 4, 'signature': 'overlay(base, overlay, offset, [opacity])', 'forms': [['base', 'overlay', 'offset', '[opacity]']], 'description': 'overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.', 'details': '', 'aliases': []},
|
||||
'pad': {'min_args': 2, 'max_args': 2, 'signature': 'pad(x, padding)', 'forms': [['x', 'padding']], 'description': 'pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)', 'details': '', 'aliases': []},
|
||||
'cross': {'min_args': 2, 'max_args': 2, 'signature': 'cross(x, y)', 'forms': [['x', 'y']], 'description': 'computes the cross product of x and y. Last dimension must be 3', 'details': '', 'aliases': []},
|
||||
'matmul': {'min_args': 2, 'max_args': 2, 'signature': 'matmul(x, y)', 'forms': [['x', 'y']], 'description': 'computes the matrix multiplication of x and y', 'details': '', 'aliases': []},
|
||||
'solve': {'min_args': 2, 'max_args': 2, 'signature': 'solve(A, b)', 'forms': [['A', 'b']], 'description': 'solves the square linear system A*x=b without explicitly forming A inverse', 'details': '', 'aliases': []},
|
||||
'matrix_rank': {'min_args': 1, 'max_args': 2, 'signature': 'matrix_rank(x, [tol])', 'forms': [['x', '[tol]']], 'description': 'computes the numerical rank of each matrix using optional absolute tolerance tol', 'details': '', 'aliases': []},
|
||||
'rife': {'min_args': 2, 'max_args': 5, 'signature': 'rife(image1, image2, [tiling_size], [iterations], [multi_scale])', 'forms': [['image1', 'image2', '[tiling_size]', '[iterations]', '[multi_scale]']], 'description': 'computes the optical flow field ([H, W, 2]) between image1 and image2 using a RAFT-based model', 'details': '- tiling_size: splits the image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution\n- iterations: how many times to run the flow model. Default 12\n- multi_scale: also use low resolution of base image for giant movements. Default false', 'aliases': []},
|
||||
'bnot': {'min_args': 1, 'max_args': 1, 'signature': 'bnot(x)', 'forms': [['x']], 'description': 'computes the bitwise NOT', 'details': '', 'aliases': ['bitwise_not']},
|
||||
'bitwise_not': {'min_args': 1, 'max_args': 1, 'signature': 'bitwise_not(x)', 'forms': [['x']], 'description': 'computes the bitwise NOT', 'details': '', 'aliases': ['bnot']},
|
||||
'bitcount': {'min_args': 1, 'max_args': 1, 'signature': 'bitcount(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['popcount', 'popcnt']},
|
||||
'popcount': {'min_args': 1, 'max_args': 1, 'signature': 'popcount(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['bitcount', 'popcnt']},
|
||||
'popcnt': {'min_args': 1, 'max_args': 1, 'signature': 'popcnt(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'aliases': ['bitcount', 'popcount']},
|
||||
'shape': {'min_args': 1, 'max_args': 1, 'signature': 'shape(x)', 'forms': [['x']], 'description': 'returns the shape of tensor as a list', 'details': '', 'aliases': []},
|
||||
'band': {'min_args': 2, 'max_args': 2, 'signature': 'band(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise AND of x and y', 'details': '', 'aliases': ['bitwise_and']},
|
||||
'bitwise_and': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_and(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise AND of x and y', 'details': '', 'aliases': ['band']},
|
||||
'bxor': {'min_args': 2, 'max_args': 2, 'signature': 'bxor(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise XOR of x and y', 'details': '', 'aliases': ['bitwise_xor']},
|
||||
'bitwise_xor': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_xor(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise XOR of x and y', 'details': '', 'aliases': ['bxor']},
|
||||
'bor': {'min_args': 2, 'max_args': 2, 'signature': 'bor(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise OR of x and y', 'details': '', 'aliases': ['bitwise_or']},
|
||||
'bitwise_or': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_or(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise OR of x and y', 'details': '', 'aliases': ['bor']},
|
||||
'tensor': {'min_args': 1, 'max_args': 3, 'signature': 'tensor(shape, [value], [dtype_template])', 'forms': [['shape', '[value]', '[dtype_template]']], 'description': 'creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32', 'details': '', 'aliases': []},
|
||||
'zeros': {'min_args': 1, 'max_args': 2, 'signature': 'zeros(shape, [dtype_template])', 'forms': [['shape', '[dtype_template]']], 'description': 'creates a zero-filled tensor on the current device', 'details': '', 'aliases': []},
|
||||
'ones': {'min_args': 1, 'max_args': 2, 'signature': 'ones(shape, [dtype_template])', 'forms': [['shape', '[dtype_template]']], 'description': 'creates a one-filled tensor on the current device', 'details': '', 'aliases': []},
|
||||
'eye': {'min_args': 1, 'max_args': 2, 'signature': 'eye(n, [dtype_template])', 'forms': [['n', '[dtype_template]']], 'description': 'creates an n-by-n identity matrix', 'details': '', 'aliases': []},
|
||||
'one_hot': {'min_args': 2, 'max_args': 2, 'signature': 'one_hot(indices, classes)', 'forms': [['indices', 'classes']], 'description': 'converts integer class indices to float32 one-hot vectors', 'details': '', 'aliases': []},
|
||||
'mse': {'min_args': 2, 'max_args': 3, 'signature': 'mse(a, b, [reduction])', 'forms': [['a', 'b', '[reduction]']], 'description': 'mean squared error; reduction is mean (default), sum, or none', 'details': '', 'aliases': []},
|
||||
'mae': {'min_args': 2, 'max_args': 3, 'signature': 'mae(a, b, [reduction])', 'forms': [['a', 'b', '[reduction]']], 'description': 'mean absolute error; reduction is mean (default), sum, or none', 'details': '', 'aliases': []},
|
||||
'psnr': {'min_args': 2, 'max_args': 3, 'signature': 'psnr(a, b, [data_range])', 'forms': [['a', 'b', '[data_range]']], 'description': 'peak signal-to-noise ratio in dB; data_range defaults to 1', 'details': '', 'aliases': []},
|
||||
'weighted_mean': {'min_args': 2, 'max_args': 3, 'signature': 'weighted_mean(x, weights, [dims])', 'forms': [['x', 'weights', '[dims]']], 'description': 'computes the weighted mean globally or along one or more dimensions', 'details': '', 'aliases': []},
|
||||
'huber_loss': {'min_args': 2, 'max_args': 4, 'signature': 'huber_loss(prediction, target, [delta], [reduction])', 'forms': [['prediction', 'target', '[delta]', '[reduction]']], 'description': 'computes Huber loss; delta defaults to 1 and reduction to mean', 'details': '', 'aliases': []},
|
||||
'cross_entropy': {'min_args': 2, 'max_args': 4, 'signature': 'cross_entropy(logits, target, [dim], [reduction])', 'forms': [['logits', 'target', '[dim]', '[reduction]']], 'description': 'computes cross-entropy from class logits and class indices or target probabilities', 'details': '', 'aliases': []},
|
||||
'add_key': {'min_args': 3, 'max_args': 3, 'signature': 'add_key(dict, key, value)', 'forms': [['dict', 'key', 'value']], 'description': 'adds or replaces a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': []},
|
||||
'remove_key': {'min_args': 2, 'max_args': 2, 'signature': 'remove_key(dict, key)', 'forms': [['dict', 'key']], 'description': 'removes a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': ['rm_key']},
|
||||
'rm_key': {'min_args': 2, 'max_args': 2, 'signature': 'rm_key(dict, key)', 'forms': [['dict', 'key']], 'description': 'removes a dictionary entry and returns the updated dictionary', 'details': '', 'aliases': ['remove_key']},
|
||||
'stack_push': {'min_args': 2, 'max_args': 2, 'signature': 'stack_push(slot, val)', 'forms': [['slot', 'val']], 'description': 'pushes val onto the end of slot stack', 'details': '', 'aliases': []},
|
||||
'stack_pop': {'min_args': 1, 'max_args': 1, 'signature': 'stack_pop(slot)', 'forms': [['slot']], 'description': 'removes and returns the last element of slot stack', 'details': '', 'aliases': []},
|
||||
'stack_clear': {'min_args': 1, 'max_args': 1, 'signature': 'stack_clear(slot)', 'forms': [['slot']], 'description': 'clears the contents of slot stack', 'details': '', 'aliases': []},
|
||||
'stack_has': {'min_args': 1, 'max_args': 1, 'signature': 'stack_has(slot)', 'forms': [['slot']], 'description': 'returns 1.0 if slot exists in stack and is not empty else returns 0.0', 'details': '', 'aliases': []},
|
||||
'stack_get': {'min_args': 1, 'max_args': 1, 'signature': 'stack_get(slot)', 'forms': [['slot']], 'description': 'returns the last pushed value in slot without popping it', 'details': '', 'aliases': []},
|
||||
'cat': {'min_args': 2, 'max_args': None, 'signature': 'cat(x, ..., dim)', 'forms': [['x', '...', 'dim']], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['concat', 'concatenate']},
|
||||
'concat': {'min_args': 2, 'max_args': None, 'signature': 'concat(x, ..., dim)', 'forms': [['x', '...', 'dim']], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['cat', 'concatenate']},
|
||||
'concatenate': {'min_args': 2, 'max_args': None, 'signature': 'concatenate(x, ..., dim)', 'forms': [['x', '...', 'dim']], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'aliases': ['cat', 'concat']},
|
||||
'stack': {'min_args': 1, 'max_args': 2, 'signature': 'stack(tensors, [dim])', 'forms': [['tensors', '[dim]']], 'description': 'stacks a list of tensors along a new dimension', 'details': '', 'aliases': []},
|
||||
'nonzero': {'min_args': 1, 'max_args': 1, 'signature': 'nonzero(x)', 'forms': [['x']], 'description': 'returns an N-by-rank tensor of coordinates for nonzero elements', 'details': '', 'aliases': []},
|
||||
'int': {'min_args': 1, 'max_args': 1, 'signature': 'int(x)', 'forms': [['x']], 'description': 'casts x to integer', 'details': '', 'aliases': []},
|
||||
'float': {'min_args': 1, 'max_args': 1, 'signature': 'float(x)', 'forms': [['x']], 'description': 'casts x to float', 'details': '', 'aliases': []},
|
||||
'upper': {'min_args': 1, 'max_args': 1, 'signature': 'upper(x)', 'forms': [['x']], 'description': 'converts string to uppercase', 'details': '', 'aliases': []},
|
||||
'lower': {'min_args': 1, 'max_args': 1, 'signature': 'lower(x)', 'forms': [['x']], 'description': 'converts string to lowercase', 'details': '', 'aliases': []},
|
||||
'trim': {'min_args': 1, 'max_args': 1, 'signature': 'trim(x)', 'forms': [['x']], 'description': 'removes leading and trailing whitespace from string', 'details': '', 'aliases': []},
|
||||
'split': {'min_args': 1, 'max_args': 2, 'signature': 'split(x, [delimiter])', 'forms': [['x', '[delimiter]']], 'description': 'splits string to list of strings based on delimiter. Default is space.', 'details': '', 'aliases': []},
|
||||
'join': {'min_args': 1, 'max_args': 2, 'signature': 'join(x, [separator])', 'forms': [['x', '[separator]']], 'description': 'joins the items of list x as text using separator (default ""). Use concatenate(...) to join tensors', 'details': '', 'aliases': []},
|
||||
'substring': {'min_args': 2, 'max_args': 3, 'signature': 'substring(s, start, [length])', 'forms': [['s', 'start', '[length]']], 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'aliases': ['substr']},
|
||||
'substr': {'min_args': 2, 'max_args': 3, 'signature': 'substr(s, start, [length])', 'forms': [['s', 'start', '[length]']], 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'aliases': ['substring']},
|
||||
'find': {'min_args': 2, 'max_args': 2, 'signature': 'find(s, sub)', 'forms': [['s', 'sub']], 'description': 'returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings.', 'details': '', 'aliases': []},
|
||||
'replace': {'min_args': 3, 'max_args': 3, 'signature': 'replace(s, old, new)', 'forms': [['s', 'old', 'new']], 'description': 'replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.', 'details': '', 'aliases': []},
|
||||
'dilate': {'min_args': 1, 'max_args': 2, 'signature': 'dilate(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological dilation to x with a square kernel (default size 3).', 'details': '', 'aliases': []},
|
||||
'erode': {'min_args': 1, 'max_args': 2, 'signature': 'erode(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological erosion to x with a square kernel (default size 3).', 'details': '', 'aliases': []},
|
||||
'morph_open': {'min_args': 1, 'max_args': 2, 'signature': 'morph_open(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological opening (erosion then dilation) to x with a square kernel (default size 3).', 'details': '', 'aliases': []},
|
||||
'morph_close': {'min_args': 1, 'max_args': 2, 'signature': 'morph_close(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological closing (dilation then erosion) to x with a square kernel (default size 3).', 'details': '', 'aliases': []},
|
||||
'rgb_to_oklab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_oklab(rgb) / rgb_to_oklab(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'converts 0-1 sRGB to OKLab. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result', 'details': '', 'aliases': []},
|
||||
'rgb_to_cielab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_cielab(rgb) / rgb_to_cielab(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'converts 0-1 sRGB to CIELAB (D65) divided by 100, so L is 0-1. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result', 'details': '', 'aliases': []},
|
||||
'oklab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)', 'forms': [['oklab'], ['l', 'a', 'b']], 'description': 'converts OKLab to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result', 'details': '', 'aliases': []},
|
||||
'cielab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)', 'forms': [['cielab'], ['l', 'a', 'b']], 'description': 'converts CIELAB divided by 100 (as returned by rgb_to_cielab) to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result', 'details': '', 'aliases': []},
|
||||
'rgb_to_hsv': {'min_args': 1, 'max_args': 4, 'signature': 'rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees])', 'forms': [['rgb', '[degrees]'], ['r', 'g', 'b', '[degrees]']], 'description': 'converts RGB to HSV. With one color argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is 0-360 instead of 0-1', 'details': '', 'aliases': []},
|
||||
'hsv_to_rgb': {'min_args': 1, 'max_args': 4, 'signature': 'hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees])', 'forms': [['hsv', '[degrees]'], ['h', 's', 'v', '[degrees]']], 'description': 'converts HSV to RGB. With one color argument its last dimension holds H, S, V; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is read as 0-360 instead of 0-1', 'details': '', 'aliases': []},
|
||||
'int_to_rgb': {'min_args': 1, 'max_args': 1, 'signature': 'int_to_rgb(val)', 'forms': [['val']], 'description': 'unpacks 0xRRGGBB integers into 0-1 RGB colors. Tensors get R, G, B stacked in a new last dimension, lists return a list of colors and a number returns a 3-item list', 'details': '', 'aliases': []},
|
||||
'rgb_to_int': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_int(rgb) / rgb_to_int(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'packs 0-1 RGB components into 0xRRGGBB integers. With one argument the last dimension (or a 3-item list) holds R, G, B; with three, each argument is one channel', 'details': '', 'aliases': []},
|
||||
'interpolate_linear': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_linear(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with (bi/tri)linear interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'aliases': []},
|
||||
'interpolate_area': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_area(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with area interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'aliases': []},
|
||||
'interpolate_nearest': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_nearest(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'aliases': ['interpolate_nearest_exact']},
|
||||
'interpolate_nearest_exact': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_nearest_exact(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'aliases': ['interpolate_nearest']},
|
||||
'text_image': {'min_args': 3, 'max_args': 9, 'signature': 'text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline])', 'forms': [['text', 'font', 'size', '[max_width]', '[weight]', '[rotation_angle]', '[line_spacing]', '[italic]', '[underline]']], 'description': 'renders text to a 2D tensor with values 0-1', 'details': '', 'aliases': []},
|
||||
'as_nested_tensor': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested_tensor(x)', 'forms': [['x']], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'aliases': ['as_nested']},
|
||||
'as_nested': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested(x)', 'forms': [['x']], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'aliases': ['as_nested_tensor']},
|
||||
'svd': {'min_args': 1, 'max_args': 2, 'signature': 'svd(x, [full_matrices])', 'forms': [['x', '[full_matrices]']], 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)', 'details': '', 'aliases': ['singular_value_decomposition']},
|
||||
'singular_value_decomposition': {'min_args': 1, 'max_args': 2, 'signature': 'singular_value_decomposition(x, [full_matrices])', 'forms': [['x', '[full_matrices]']], 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)', 'details': '', 'aliases': ['svd']},
|
||||
'diagonal_matrix': {'min_args': 2, 'max_args': 5, 'signature': 'diagonal_matrix(x, shape, [offset], [dim1], [dim2])', 'forms': [['x', 'shape', '[offset]', '[dim1]', '[dim2]']], 'description': 'creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.', 'details': '', 'aliases': ['diag']},
|
||||
'diag': {'min_args': 2, 'max_args': 5, 'signature': 'diag(x, shape, [offset], [dim1], [dim2])', 'forms': [['x', 'shape', '[offset]', '[dim1]', '[dim2]']], 'description': 'creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.', 'details': '', 'aliases': ['diagonal_matrix']},
|
||||
'timestamp': {'min_args': 0, 'max_args': 0, 'signature': 'timestamp()', 'forms': [[]], 'description': 'returns the current system timestamp', 'details': '', 'aliases': ['now']},
|
||||
'now': {'min_args': 0, 'max_args': 0, 'signature': 'now()', 'forms': [[]], 'description': 'returns the current system timestamp', 'details': '', 'aliases': ['timestamp']},
|
||||
'sort': {'min_args': 1, 'max_args': 3, 'signature': 'sort(x, [descending], [dim])', 'forms': [['x', '[descending]', '[dim]']], 'description': 'returns x sorted ascending, or descending when descending is truthy. Tensors are sorted along dim (default: last dimension); lists use Python sorting', 'details': '', 'aliases': []},
|
||||
'argsort': {'min_args': 1, 'max_args': 3, 'signature': 'argsort(x, [descending], [dim])', 'forms': [['x', '[descending]', '[dim]']], 'description': 'returns the indices that would sort x. descending defaults to false and dim defaults to the last dimension.', 'details': '', 'aliases': []},
|
||||
'argmin': {'min_args': 1, 'max_args': 3, 'signature': 'argmin(x, [as_position], [dim])', 'forms': [['x', '[as_position]', '[dim]']], 'description': 'returns the minimum index globally or along dim; as_position returns global coordinates', 'details': '', 'aliases': []},
|
||||
'argmax': {'min_args': 1, 'max_args': 3, 'signature': 'argmax(x, [as_position], [dim])', 'forms': [['x', '[as_position]', '[dim]']], 'description': 'returns the maximum index globally or along dim; as_position returns global coordinates', 'details': '', 'aliases': []},
|
||||
'softmax': {'min_args': 1, 'max_args': 2, 'signature': 'softmax(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'applies the softmax function to x (each slice sums to 1.0). dim defaults to the last dimension.', 'details': '', 'aliases': []},
|
||||
'softmin': {'min_args': 1, 'max_args': 2, 'signature': 'softmin(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'applies the softmin function to x (same as softmax(-x, [dim])). dim defaults to the last dimension.', 'details': '', 'aliases': []},
|
||||
'unique': {'min_args': 1, 'max_args': 1, 'signature': 'unique(x)', 'forms': [['x']], 'description': 'returns the sorted unique elements of x (tensors are flattened first)', 'details': '', 'aliases': []},
|
||||
'flip': {'min_args': 2, 'max_args': 2, 'signature': 'flip(x, dims)', 'forms': [['x', 'dims']], 'description': 'reverses the order of elements along the specified dimensions. Text is reversed as a whole', 'details': '', 'aliases': []},
|
||||
'startswith': {'min_args': 2, 'max_args': 2, 'signature': 'startswith(text, prefix)', 'forms': [['text', 'prefix']], 'description': 'returns 1 if text starts with prefix, else 0', 'details': '', 'aliases': []},
|
||||
'endswith': {'min_args': 2, 'max_args': 2, 'signature': 'endswith(text, suffix)', 'forms': [['text', 'suffix']], 'description': 'returns 1 if text ends with suffix, else 0', 'details': '', 'aliases': []},
|
||||
'squeeze': {'min_args': 1, 'max_args': 2, 'signature': 'squeeze(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'removes size-1 dimensions from tensor x, optionally at dim', 'details': '', 'aliases': []},
|
||||
'unsqueeze': {'min_args': 2, 'max_args': 2, 'signature': 'unsqueeze(x, dim)', 'forms': [['x', 'dim']], 'description': 'inserts a size-1 dimension into tensor x at dim', 'details': '', 'aliases': []},
|
||||
'roll': {'min_args': 2, 'max_args': 3, 'signature': 'roll(x, shifts, [dim])', 'forms': [['x', 'shifts', '[dim]']], 'description': 'circularly shifts tensor x along dim (default 0)', 'details': '', 'aliases': []},
|
||||
'cov': {'min_args': 2, 'max_args': 2, 'signature': 'cov(x, y)', 'forms': [['x', 'y']], 'description': 'computes the sample covariance of the flattened x and y (which must have the same number of elements)', 'details': '', 'aliases': []},
|
||||
'corr': {'min_args': 2, 'max_args': 2, 'signature': 'corr(x, y)', 'forms': [['x', 'y']], 'description': 'computes the Pearson correlation coefficient between x and y', 'details': '', 'aliases': ['correlation']},
|
||||
'correlation': {'min_args': 2, 'max_args': 2, 'signature': 'correlation(x, y)', 'forms': [['x', 'y']], 'description': 'computes the Pearson correlation coefficient between x and y', 'details': '', 'aliases': ['corr']},
|
||||
'entropy': {'min_args': 1, 'max_args': 1, 'signature': 'entropy(x)', 'forms': [['x']], 'description': 'computes the Shannon entropy (in nats) of softmax(x), i.e. x is treated as logits over all of its elements', 'details': '', 'aliases': []},
|
||||
'crop': {'min_args': 3, 'max_args': 3, 'signature': 'crop(x, start, size)', 'forms': [['x', 'start', 'size']], 'description': 'crops the region of x beginning at start (the low corner). The result always has shape size; parts outside x are zero-filled. On text, returns at most size characters', 'details': '', 'aliases': []},
|
||||
'coords': {'min_args': 2, 'max_args': 3, 'signature': 'coords(shape, dim, [dtype_template])', 'forms': [['shape', 'dim', '[dtype_template]']], 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).', 'details': '', 'aliases': ['coordinates']},
|
||||
'coordinates': {'min_args': 2, 'max_args': 3, 'signature': 'coordinates(shape, dim, [dtype_template])', 'forms': [['shape', 'dim', '[dtype_template]']], 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).', 'details': '', 'aliases': ['coords']},
|
||||
'gather': {'min_args': 3, 'max_args': 3, 'signature': 'gather(x, dim, idx)', 'forms': [['x', 'dim', 'idx']], 'description': 'gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.', 'details': '', 'aliases': []},
|
||||
'scatter': {'min_args': 4, 'max_args': 4, 'signature': 'scatter(x, dim, idx, src)', 'forms': [['x', 'dim', 'idx', 'src']], 'description': 'scatters elements from src into x along dim using the indices specified in idx. The output tensor has the same shape as x.', 'details': '', 'aliases': []},
|
||||
'scatter_add': {'min_args': 4, 'max_args': 4, 'signature': 'scatter_add(x, dim, idx, src)', 'forms': [['x', 'dim', 'idx', 'src']], 'description': 'scatters elements from src into x along dim using the indices specified in idx, adding to existing values. The output tensor has the same shape as x.', 'details': '', 'aliases': []},
|
||||
'noise': {'min_args': 1, 'max_args': 2, 'signature': 'noise(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['randn', 'random_normal']},
|
||||
'randn': {'min_args': 1, 'max_args': 2, 'signature': 'randn(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['noise', 'random_normal']},
|
||||
'random_normal': {'min_args': 1, 'max_args': 2, 'signature': 'random_normal(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates normally distributed random noise', 'details': '', 'aliases': ['noise', 'randn']},
|
||||
'pink_noise': {'min_args': 1, 'max_args': 2, 'signature': 'pink_noise(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic pink noise (approximately 1/f power spectrum) with zero mean and unit variance per row', 'details': '', 'aliases': ['pink']},
|
||||
'pink': {'min_args': 1, 'max_args': 2, 'signature': 'pink(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic pink noise (approximately 1/f power spectrum) with zero mean and unit variance per row', 'details': '', 'aliases': ['pink_noise']},
|
||||
'brown_noise': {'min_args': 1, 'max_args': 2, 'signature': 'brown_noise(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum) with zero mean and unit variance per row', 'details': '', 'aliases': ['brown']},
|
||||
'brown': {'min_args': 1, 'max_args': 2, 'signature': 'brown(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum) with zero mean and unit variance per row', 'details': '', 'aliases': ['brown_noise']},
|
||||
'rand': {'min_args': 1, 'max_args': 2, 'signature': 'rand(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['randu', 'random_uniform']},
|
||||
'randu': {'min_args': 1, 'max_args': 2, 'signature': 'randu(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['rand', 'random_uniform']},
|
||||
'random_uniform': {'min_args': 1, 'max_args': 2, 'signature': 'random_uniform(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates uniformly distributed random noise', 'details': '', 'aliases': ['rand', 'randu']},
|
||||
'randc': {'min_args': 3, 'max_args': 4, 'signature': 'randc(seed, median, sigma, [shape])', 'forms': [['seed', 'median', 'sigma', '[shape]']], 'description': 'generates Cauchy distributed random values.', 'details': '', 'aliases': ['random_cauchy']},
|
||||
'random_cauchy': {'min_args': 3, 'max_args': 4, 'signature': 'random_cauchy(seed, median, sigma, [shape])', 'forms': [['seed', 'median', 'sigma', '[shape]']], 'description': 'generates Cauchy distributed random values.', 'details': '', 'aliases': ['randc']},
|
||||
'rande': {'min_args': 2, 'max_args': 3, 'signature': 'rande(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates exponentially distributed random values', 'details': '', 'aliases': ['random_exponential']},
|
||||
'random_exponential': {'min_args': 2, 'max_args': 3, 'signature': 'random_exponential(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates exponentially distributed random values', 'details': '', 'aliases': ['rande']},
|
||||
'randln': {'min_args': 3, 'max_args': 4, 'signature': 'randln(seed, mean, std, [shape])', 'forms': [['seed', 'mean', 'std', '[shape]']], 'description': 'generates log-normally distributed random values.', 'details': '', 'aliases': ['random_log_normal']},
|
||||
'random_log_normal': {'min_args': 3, 'max_args': 4, 'signature': 'random_log_normal(seed, mean, std, [shape])', 'forms': [['seed', 'mean', 'std', '[shape]']], 'description': 'generates log-normally distributed random values.', 'details': '', 'aliases': ['randln']},
|
||||
'randb': {'min_args': 2, 'max_args': 3, 'signature': 'randb(seed, probability, [shape])', 'forms': [['seed', 'probability', '[shape]']], 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor', 'details': '', 'aliases': ['random_bernoulli']},
|
||||
'random_bernoulli': {'min_args': 2, 'max_args': 3, 'signature': 'random_bernoulli(seed, probability, [shape])', 'forms': [['seed', 'probability', '[shape]']], 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor', 'details': '', 'aliases': ['randb']},
|
||||
'randp': {'min_args': 2, 'max_args': 3, 'signature': 'randp(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates Poisson distributed random values.', 'details': '', 'aliases': ['random_poisson']},
|
||||
'random_poisson': {'min_args': 2, 'max_args': 3, 'signature': 'random_poisson(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates Poisson distributed random values.', 'details': '', 'aliases': ['randp']},
|
||||
'randg': {'min_args': 3, 'max_args': 4, 'signature': 'randg(seed, shape_param, scale, [shape])', 'forms': [['seed', 'shape_param', 'scale', '[shape]']], 'description': 'generates Gamma distributed random values.', 'details': '', 'aliases': ['random_gamma']},
|
||||
'random_gamma': {'min_args': 3, 'max_args': 4, 'signature': 'random_gamma(seed, shape_param, scale, [shape])', 'forms': [['seed', 'shape_param', 'scale', '[shape]']], 'description': 'generates Gamma distributed random values.', 'details': '', 'aliases': ['randg']},
|
||||
'randbeta': {'min_args': 3, 'max_args': 4, 'signature': 'randbeta(seed, alpha, beta, [shape])', 'forms': [['seed', 'alpha', 'beta', '[shape]']], 'description': 'generates Beta distributed random values', 'details': '', 'aliases': ['random_beta']},
|
||||
'random_beta': {'min_args': 3, 'max_args': 4, 'signature': 'random_beta(seed, alpha, beta, [shape])', 'forms': [['seed', 'alpha', 'beta', '[shape]']], 'description': 'generates Beta distributed random values', 'details': '', 'aliases': ['randbeta']},
|
||||
'randl': {'min_args': 3, 'max_args': 4, 'signature': 'randl(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Laplace distributed random values', 'details': '', 'aliases': ['random_laplace']},
|
||||
'random_laplace': {'min_args': 3, 'max_args': 4, 'signature': 'random_laplace(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Laplace distributed random values', 'details': '', 'aliases': ['randl']},
|
||||
'randgumbel': {'min_args': 3, 'max_args': 4, 'signature': 'randgumbel(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Gumbel distributed random values', 'details': '', 'aliases': ['random_gumbel']},
|
||||
'random_gumbel': {'min_args': 3, 'max_args': 4, 'signature': 'random_gumbel(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Gumbel distributed random values', 'details': '', 'aliases': ['randgumbel']},
|
||||
'randw': {'min_args': 3, 'max_args': 4, 'signature': 'randw(seed, scale, concentration, [shape])', 'forms': [['seed', 'scale', 'concentration', '[shape]']], 'description': 'generates Weibull distributed random values', 'details': '', 'aliases': ['random_weibull']},
|
||||
'random_weibull': {'min_args': 3, 'max_args': 4, 'signature': 'random_weibull(seed, scale, concentration, [shape])', 'forms': [['seed', 'scale', 'concentration', '[shape]']], 'description': 'generates Weibull distributed random values', 'details': '', 'aliases': ['randw']},
|
||||
'randchi2': {'min_args': 2, 'max_args': 3, 'signature': 'randchi2(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Chi-squared distributed random values', 'details': '', 'aliases': ['random_chi2']},
|
||||
'random_chi2': {'min_args': 2, 'max_args': 3, 'signature': 'random_chi2(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Chi-squared distributed random values', 'details': '', 'aliases': ['randchi2']},
|
||||
'randt': {'min_args': 2, 'max_args': 3, 'signature': 'randt(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Student-t distributed random values', 'details': '', 'aliases': ['random_studentt']},
|
||||
'random_studentt': {'min_args': 2, 'max_args': 3, 'signature': 'random_studentt(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Student-t distributed random values', 'details': '', 'aliases': ['randt']},
|
||||
'perlin': {'min_args': 2, 'max_args': 5, 'signature': 'perlin(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Perlin gradient noise in 0-1 (default 1 octave)', 'details': '', 'aliases': ['perlin_noise']},
|
||||
'perlin_noise': {'min_args': 2, 'max_args': 5, 'signature': 'perlin_noise(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Perlin gradient noise in 0-1 (default 1 octave)', 'details': '', 'aliases': ['perlin']},
|
||||
'cellular': {'min_args': 2, 'max_args': 5, 'signature': 'cellular(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)', 'details': '', 'aliases': ['voronoi', 'worley', 'cellular_noise', 'voronoi_noise']},
|
||||
'voronoi': {'min_args': 2, 'max_args': 5, 'signature': 'voronoi(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)', 'details': '', 'aliases': ['cellular', 'worley', 'cellular_noise', 'voronoi_noise']},
|
||||
'worley': {'min_args': 2, 'max_args': 5, 'signature': 'worley(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)', 'details': '', 'aliases': ['cellular', 'voronoi', 'cellular_noise', 'voronoi_noise']},
|
||||
'cellular_noise': {'min_args': 2, 'max_args': 5, 'signature': 'cellular_noise(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)', 'details': '', 'aliases': ['cellular', 'voronoi', 'worley', 'voronoi_noise']},
|
||||
'voronoi_noise': {'min_args': 2, 'max_args': 5, 'signature': 'voronoi_noise(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)', 'details': '', 'aliases': ['cellular', 'voronoi', 'worley', 'cellular_noise']},
|
||||
'plasma': {'min_args': 2, 'max_args': 5, 'signature': 'plasma(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4', 'details': '', 'aliases': ['turbulence', 'plasma_noise']},
|
||||
'turbulence': {'min_args': 2, 'max_args': 5, 'signature': 'turbulence(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4', 'details': '', 'aliases': ['plasma', 'plasma_noise']},
|
||||
'plasma_noise': {'min_args': 2, 'max_args': 5, 'signature': 'plasma_noise(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4', 'details': '', 'aliases': ['plasma', 'turbulence']},
|
||||
'ridged': {'min_args': 2, 'max_args': 5, 'signature': 'ridged(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates ridged multi-fractal noise in 0-1 (default 4 octaves)', 'details': '', 'aliases': ['ridged_noise']},
|
||||
'ridged_noise': {'min_args': 2, 'max_args': 5, 'signature': 'ridged_noise(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates ridged multi-fractal noise in 0-1 (default 4 octaves)', 'details': '', 'aliases': ['ridged']},
|
||||
'domain_warp': {'min_args': 4, 'max_args': 8, 'signature': 'domain_warp(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])', 'forms': [['seed', 'scale', 'warp_scale', 'warp_strength', '[octaves]', '[warp_octaves]', '[offset]', '[shape]']], 'description': 'generates domain warped Perlin noise in 0-1 (defaults: 4 octaves, 2 warp octaves)', 'details': '', 'aliases': ['domain_warp_noise']},
|
||||
'domain_warp_noise': {'min_args': 4, 'max_args': 8, 'signature': 'domain_warp_noise(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])', 'forms': [['seed', 'scale', 'warp_scale', 'warp_strength', '[octaves]', '[warp_octaves]', '[offset]', '[shape]']], 'description': 'generates domain warped Perlin noise in 0-1 (defaults: 4 octaves, 2 warp octaves)', 'details': '', 'aliases': ['domain_warp']},
|
||||
'sin': {'min_args': 1, 'max_args': 1, 'signature': 'sin(x)', 'forms': [['x']], 'description': 'applies sine function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'cos': {'min_args': 1, 'max_args': 1, 'signature': 'cos(x)', 'forms': [['x']], 'description': 'applies cosine function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'tan': {'min_args': 1, 'max_args': 1, 'signature': 'tan(x)', 'forms': [['x']], 'description': 'applies tangent function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'asin': {'min_args': 1, 'max_args': 1, 'signature': 'asin(x)', 'forms': [['x']], 'description': 'applies arcus sine function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'acos': {'min_args': 1, 'max_args': 1, 'signature': 'acos(x)', 'forms': [['x']], 'description': 'applies arcus cosine function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'atan': {'min_args': 1, 'max_args': 1, 'signature': 'atan(x)', 'forms': [['x']], 'description': 'applies arcus tangent function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'atan2': {'min_args': 2, 'max_args': 2, 'signature': 'atan2(y, x)', 'forms': [['y', 'x']], 'description': 'computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant', 'details': '', 'params': {'y': 'y coordinate (numerator)', 'x': 'x coordinate (denominator)'}, 'aliases': []},
|
||||
'sinh': {'min_args': 1, 'max_args': 1, 'signature': 'sinh(x)', 'forms': [['x']], 'description': 'applies hyperbolic sine function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'cosh': {'min_args': 1, 'max_args': 1, 'signature': 'cosh(x)', 'forms': [['x']], 'description': 'applies hyperbolic cosine function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'tanh': {'min_args': 1, 'max_args': 1, 'signature': 'tanh(x)', 'forms': [['x']], 'description': 'applies hyperbolic tangent function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'asinh': {'min_args': 1, 'max_args': 1, 'signature': 'asinh(x)', 'forms': [['x']], 'description': 'applies hyperbolic arcus sine function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'acosh': {'min_args': 1, 'max_args': 1, 'signature': 'acosh(x)', 'forms': [['x']], 'description': 'applies hyperbolic arcus cosine function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'atanh': {'min_args': 1, 'max_args': 1, 'signature': 'atanh(x)', 'forms': [['x']], 'description': 'applies hyperbolic arcus tangent function to value or each element of value', 'details': '', 'params': {}, 'aliases': []},
|
||||
'abs': {'min_args': 1, 'max_args': 1, 'signature': 'abs(x)', 'forms': [['x']], 'description': 'applies per element absolute value function. Same as |x| for numbers.', 'details': '', 'params': {}, 'aliases': []},
|
||||
'sqrt': {'min_args': 1, 'max_args': 1, 'signature': 'sqrt(x)', 'forms': [['x']], 'description': 'applies square root per element. Negative numbers return NaN (not a number)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'ln': {'min_args': 1, 'max_args': 1, 'signature': 'ln(x)', 'forms': [['x']], 'description': 'applies natural logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'log': {'min_args': 1, 'max_args': 1, 'signature': 'log(x)', 'forms': [['x']], 'description': 'applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'log2': {'min_args': 1, 'max_args': 1, 'signature': 'log2(x)', 'forms': [['x']], 'description': 'applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'exp': {'min_args': 1, 'max_args': 1, 'signature': 'exp(x)', 'forms': [['x']], 'description': 'applies e^x to value (per element)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'log1p': {'min_args': 1, 'max_args': 1, 'signature': 'log1p(x)', 'forms': [['x']], 'description': 'applies ln(1+x) accurately for values near zero', 'details': '', 'params': {}, 'aliases': []},
|
||||
'expm1': {'min_args': 1, 'max_args': 1, 'signature': 'expm1(x)', 'forms': [['x']], 'description': 'applies exp(x)-1 accurately for values near zero', 'details': '', 'params': {}, 'aliases': []},
|
||||
'sinc': {'min_args': 1, 'max_args': 1, 'signature': 'sinc(x)', 'forms': [['x']], 'description': 'computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1', 'details': '', 'params': {}, 'aliases': []},
|
||||
'cbrt': {'min_args': 1, 'max_args': 1, 'signature': 'cbrt(x)', 'forms': [['x']], 'description': 'computes the real cube root of each value, including negative values', 'details': '', 'params': {}, 'aliases': []},
|
||||
'reciprocal': {'min_args': 1, 'max_args': 1, 'signature': 'reciprocal(x)', 'forms': [['x']], 'description': 'computes 1/x element-wise', 'details': '', 'params': {}, 'aliases': []},
|
||||
'logaddexp': {'min_args': 2, 'max_args': 2, 'signature': 'logaddexp(x, y)', 'forms': [['x', 'y']], 'description': 'computes log(exp(x) + exp(y)) element-wise using a numerically stable method', 'details': '', 'params': {}, 'aliases': []},
|
||||
'logsumexp': {'min_args': 1, 'max_args': 2, 'signature': 'logsumexp(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions', 'details': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, 'aliases': []},
|
||||
'norm': {'min_args': 1, 'max_args': 3, 'signature': 'norm(x, [p], [dims])', 'forms': [['x', '[p]', '[dims]']], 'description': 'computes the p-norm globally or along one or more dimensions (default p=2)', 'details': '', 'params': {'p': 'norm order (default: 2)', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, 'aliases': []},
|
||||
'normalize': {'min_args': 1, 'max_args': 4, 'signature': 'normalize(x, [p], [dim], [eps])', 'forms': [['x', '[p]', '[dim]', '[eps]']], 'description': 'normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)', 'details': '', 'params': {'p': 'norm order (default: 2)', 'dim': 'dimension to work along (default: last)', 'eps': 'smallest allowed divisor (default: 1e-12)'}, 'aliases': []},
|
||||
'group_norm': {'min_args': 2, 'max_args': 5, 'signature': 'group_norm(x, groups, [weight], [bias], [eps])', 'forms': [['x', 'groups', '[weight]', '[bias]', '[eps]']], 'description': 'applies channel-first GroupNorm to [N, C, ...] input', 'details': '', 'params': {'groups': 'number of channel groups; must divide the channel count', 'weight': 'per-channel scale, length C (default: none)', 'bias': 'per-channel shift, length C (default: none)', 'eps': 'value added to the variance for stability (default: 1e-5)'}, 'aliases': []},
|
||||
'outer': {'min_args': 2, 'max_args': 2, 'signature': 'outer(x, y)', 'forms': [['x', 'y']], 'description': 'computes the outer product of flattened x and y', 'details': '', 'params': {}, 'aliases': []},
|
||||
'trace': {'min_args': 1, 'max_args': 1, 'signature': 'trace(x)', 'forms': [['x']], 'description': 'sums the main diagonal of each square matrix in x', 'details': '', 'params': {}, 'aliases': []},
|
||||
'det': {'min_args': 1, 'max_args': 1, 'signature': 'det(x)', 'forms': [['x']], 'description': 'computes the determinant of each square matrix in x', 'details': '', 'params': {}, 'aliases': []},
|
||||
'rfft': {'min_args': 1, 'max_args': 2, 'signature': 'rfft(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the one-dimensional real-input FFT along dim (default: last dimension)', 'details': '', 'params': {'dim': 'dimension to transform (default: last)'}, 'aliases': []},
|
||||
'irfft': {'min_args': 1, 'max_args': 3, 'signature': 'irfft(x, [n], [dim])', 'forms': [['x', '[n]', '[dim]']], 'description': 'computes the inverse one-dimensional real FFT along dim (default: last dimension)', 'details': '', 'params': {'n': 'length of the output signal (default: 2 * (input length - 1))', 'dim': 'dimension to transform (default: last)'}, 'aliases': []},
|
||||
'isnan': {'min_args': 1, 'max_args': 1, 'signature': 'isnan(x)', 'forms': [['x']], 'description': 'returns 1.0 for NaN values and 0.0 otherwise', 'details': '', 'params': {}, 'aliases': []},
|
||||
'isinf': {'min_args': 1, 'max_args': 1, 'signature': 'isinf(x)', 'forms': [['x']], 'description': 'returns 1.0 for infinite values and 0.0 otherwise', 'details': '', 'params': {}, 'aliases': []},
|
||||
'isfinite': {'min_args': 1, 'max_args': 1, 'signature': 'isfinite(x)', 'forms': [['x']], 'description': 'returns 1.0 for finite values and 0.0 otherwise', 'details': '', 'params': {}, 'aliases': []},
|
||||
'smin': {'min_args': 1, 'max_args': None, 'signature': 'smin(x, ...)', 'forms': [['x', '...']], 'description': 'computes the minimum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smin(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.', 'details': '', 'params': {}, 'aliases': []},
|
||||
'smax': {'min_args': 1, 'max_args': None, 'signature': 'smax(x, ...)', 'forms': [['x', '...']], 'description': 'computes the maximum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smax(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.', 'details': '', 'params': {}, 'aliases': []},
|
||||
'tmin': {'min_args': 2, 'max_args': 2, 'signature': 'tmin(x, y)', 'forms': [['x', 'y']], 'description': 'elementwise minimum of tensor or list. min(x,y) when inputs are floats', 'details': '', 'params': {}, 'aliases': []},
|
||||
'tmax': {'min_args': 2, 'max_args': 2, 'signature': 'tmax(x,y)', 'forms': [['x', 'y']], 'description': 'elementwise maximum of tensor or list. max(x,y) when inputs are floats', 'details': '', 'params': {}, 'aliases': []},
|
||||
'tnorm': {'min_args': 1, 'max_args': 2, 'signature': 'tnorm(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'normalises tensor or list by multiplication such that sum(x^2)==1.0 for each slice. Defaults to the last dimension; dim selects a different slicing dimension.', 'details': '', 'params': {'dim': 'dimension whose slices are normalised (default: last)'}, 'aliases': []},
|
||||
'snorm': {'min_args': 1, 'max_args': 2, 'signature': 'snorm(x,[dim])', 'forms': [['x', '[dim]']], 'description': 'frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.', 'details': '', 'params': {'dim': 'dimension or list of dimensions to reduce (default: all elements)'}, 'aliases': []},
|
||||
'floor': {'min_args': 1, 'max_args': 1, 'signature': 'floor(x)', 'forms': [['x']], 'description': 'returns the largest integer less than or equal to x', 'details': '', 'params': {}, 'aliases': []},
|
||||
'ceil': {'min_args': 1, 'max_args': 1, 'signature': 'ceil(x)', 'forms': [['x']], 'description': 'returns the smallest integer greater than or equal to x', 'details': '', 'params': {}, 'aliases': []},
|
||||
'round': {'min_args': 1, 'max_args': 1, 'signature': 'round(x)', 'forms': [['x']], 'description': 'rounds x to the nearest integer', 'details': '', 'params': {}, 'aliases': []},
|
||||
'gamma': {'min_args': 1, 'max_args': 1, 'signature': 'gamma(x)', 'forms': [['x']], 'description': 'computes the gamma function (per element)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'pow': {'min_args': 2, 'max_args': 2, 'signature': 'pow(x, y)', 'forms': [['x', 'y']], 'description': 'computes x raised to the power of y', 'details': '', 'params': {'x': 'base', 'y': 'exponent'}, 'aliases': []},
|
||||
'sigm': {'min_args': 1, 'max_args': 1, 'signature': 'sigm(x)', 'forms': [['x']], 'description': 'applies the sigmoid function: 1 / (1 + exp(-x))', 'details': '', 'params': {}, 'aliases': []},
|
||||
'clamp': {'min_args': 3, 'max_args': 3, 'signature': 'clamp(x, min, max)', 'forms': [['x', 'min', 'max']], 'description': 'clamps x between min and max per element', 'details': '', 'params': {}, 'aliases': []},
|
||||
'fft': {'min_args': 1, 'max_args': 1, 'signature': 'fft(x)', 'forms': [['x']], 'description': 'computes fast Fourier transform of x', 'details': '', 'params': {}, 'aliases': []},
|
||||
'ifft': {'min_args': 1, 'max_args': 2, 'signature': 'ifft(x, [shape])', 'forms': [['x', '[shape]']], 'description': 'inverse fast Fourier transform of x. shape (defaults to the node\'s tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.', 'details': '', 'params': {'shape': 'shape used for the K/Kx/Ky frequency variables (default: the node\'s input shape)'}, 'aliases': []},
|
||||
'angle': {'min_args': 1, 'max_args': 1, 'signature': 'angle(x)', 'forms': [['x']], 'description': 'returns the angle of a complex number or vector', 'details': '', 'params': {}, 'aliases': []},
|
||||
'print': {'min_args': 1, 'max_args': 1, 'signature': 'print(x)', 'forms': [['x']], 'description': 'prints the value of x to the console while passing output unchanged', 'details': '', 'params': {}, 'aliases': []},
|
||||
'print_shape': {'min_args': 1, 'max_args': 1, 'signature': 'print_shape(x)', 'forms': [['x']], 'description': 'prints the shape of the tensor x', 'details': '', 'params': {}, 'aliases': ['pshp']},
|
||||
'pshp': {'min_args': 1, 'max_args': 1, 'signature': 'pshp(x)', 'forms': [['x']], 'description': 'prints the shape of the tensor x', 'details': '', 'params': {}, 'aliases': ['print_shape']},
|
||||
'nvl': {'min_args': 4, 'max_args': 4, 'signature': 'nvl(x, nan, pos_inf, neg_inf)', 'forms': [['x', 'nan', 'pos_inf', 'neg_inf']], 'description': 'replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)', 'details': '', 'params': {'nan': 'replacement for NaN', 'pos_inf': 'replacement for +infinity', 'neg_inf': 'replacement for -infinity'}, 'aliases': ['nan_to_num']},
|
||||
'nan_to_num': {'min_args': 4, 'max_args': 4, 'signature': 'nan_to_num(x, nan, pos_inf, neg_inf)', 'forms': [['x', 'nan', 'pos_inf', 'neg_inf']], 'description': 'replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)', 'details': '', 'params': {'nan': 'replacement for NaN', 'pos_inf': 'replacement for +infinity', 'neg_inf': 'replacement for -infinity'}, 'aliases': ['nvl']},
|
||||
'lerp': {'min_args': 3, 'max_args': 3, 'signature': 'lerp(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'linear interpolation between a and b by t per element. t can be float or tensor.', 'details': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, 'aliases': []},
|
||||
'slerp': {'min_args': 3, 'max_args': 4, 'signature': 'slerp(a, b, t, [dim])', 'forms': [['a', 'b', 't', '[dim]']], 'description': 'interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.', 'details': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)', 'dim': 'dimension holding the vector components (default: all elements form one vector)'}, 'aliases': []},
|
||||
'step': {'min_args': 2, 'max_args': 2, 'signature': 'step(x, edge)', 'forms': [['x', 'edge']], 'description': 'returns 0 if x < edge, else 1', 'details': '', 'params': {'edge': 'threshold; the result is 1 where x >= edge, otherwise 0'}, 'aliases': []},
|
||||
'smoothstep': {'min_args': 3, 'max_args': 3, 'signature': 'smoothstep(x, edge0, edge1)', 'forms': [['x', 'edge0', 'edge1']], 'description': 'smooth interpolation between edge0 and edge1', 'details': '', 'params': {'edge0': 'value mapped to 0', 'edge1': 'value mapped to 1'}, 'aliases': []},
|
||||
'fract': {'min_args': 1, 'max_args': 1, 'signature': 'fract(x)', 'forms': [['x']], 'description': 'returns the fractional part of x: x - floor(x)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'relu': {'min_args': 1, 'max_args': 1, 'signature': 'relu(x)', 'forms': [['x']], 'description': 'applies rectified linear unit function: max(0, x)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'softsign': {'min_args': 1, 'max_args': 1, 'signature': 'softsign(x)', 'forms': [['x']], 'description': 'applies x / (1 + abs(x)) element-wise', 'details': '', 'params': {}, 'aliases': []},
|
||||
'leaky_relu': {'min_args': 1, 'max_args': 2, 'signature': 'leaky_relu(x, [negative_slope])', 'forms': [['x', '[negative_slope]']], 'description': 'applies leaky ReLU element-wise; negative_slope defaults to 0.01', 'details': '', 'params': {'negative_slope': 'slope used for negative inputs (default: 0.01)'}, 'aliases': []},
|
||||
'softplus': {'min_args': 1, 'max_args': 1, 'signature': 'softplus(x)', 'forms': [['x']], 'description': 'applies the softplus function: ln(1 + exp(x))', 'details': '', 'params': {}, 'aliases': []},
|
||||
'gelu': {'min_args': 1, 'max_args': 1, 'signature': 'gelu(x)', 'forms': [['x']], 'description': 'applies the Gaussian Error Linear Unit (GELU) activation function', 'details': '', 'params': {}, 'aliases': []},
|
||||
'silu': {'min_args': 1, 'max_args': 1, 'signature': 'silu(x)', 'forms': [['x']], 'description': 'applies the Sigmoid Linear Unit activation element-wise', 'details': '', 'params': {}, 'aliases': []},
|
||||
'sign': {'min_args': 1, 'max_args': 1, 'signature': 'sign(x)', 'forms': [['x']], 'description': 'returns the sign of x: -1, 0, or 1', 'details': '', 'params': {}, 'aliases': []},
|
||||
'degrees': {'min_args': 1, 'max_args': 1, 'signature': 'degrees(x)', 'forms': [['x']], 'description': 'converts radians to degrees (per element)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'radians': {'min_args': 1, 'max_args': 1, 'signature': 'radians(x)', 'forms': [['x']], 'description': 'converts degrees to radians (per element)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'logical_not': {'min_args': 1, 'max_args': 1, 'signature': 'logical_not(x)', 'forms': [['x']], 'description': 'returns 1.0 where x is zero and 0.0 otherwise', 'details': '', 'params': {}, 'aliases': []},
|
||||
'logical_and': {'min_args': 2, 'max_args': 2, 'signature': 'logical_and(x, y)', 'forms': [['x', 'y']], 'description': 'returns 1.0 if both values are non-zero, else 0.0', 'details': '', 'params': {}, 'aliases': []},
|
||||
'logical_or': {'min_args': 2, 'max_args': 2, 'signature': 'logical_or(x, y)', 'forms': [['x', 'y']], 'description': 'returns 1.0 if either value is non-zero, else 0.0', 'details': '', 'params': {}, 'aliases': []},
|
||||
'hypot': {'min_args': 2, 'max_args': 2, 'signature': 'hypot(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise Euclidean distance from the origin', 'details': '', 'params': {}, 'aliases': []},
|
||||
'map': {'min_args': 2, 'max_args': 4, 'signature': 'map(tensor, coord1, [coord2], [coord3])', 'forms': [['tensor', 'coord1', '[coord2]', '[coord3]']], 'description': 'samples/remaps input tensor using coordinates', 'details': '', 'params': {'coord1': 'sample positions (element indices) along the first mapped dimension; mapped dimensions are the last ones of tensor', 'coord2': 'sample positions along the second mapped dimension', 'coord3': 'sample positions along the third mapped dimension'}, 'aliases': []},
|
||||
'ezconvolution': {'min_args': 3, 'max_args': 5, 'signature': 'ezconvolution(tensor, size_x, kernel) / ezconvolution(tensor, size_x, size_y, kernel) / ezconvolution(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'params': {'tensor': 'input, channels first or last', 'size_x': 'kernel size along the first spatial dimension', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre'}, 'aliases': ['ezconv']},
|
||||
'ezconv': {'min_args': 3, 'max_args': 5, 'signature': 'ezconv(tensor, size_x, kernel) / ezconv(tensor, size_x, size_y, kernel) / ezconv(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'params': {'tensor': 'input, channels first or last', 'size_x': 'kernel size along the first spatial dimension', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre'}, 'aliases': ['ezconvolution']},
|
||||
'convolution': {'min_args': 3, 'max_args': 5, 'signature': 'convolution(tensor, size_x, kernel) / convolution(tensor, size_x, size_y, kernel) / convolution(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'params': {'tensor': 'input shaped [batch, channel, spatial...]', 'size_x': 'kernel size along the first spatial dimension', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre'}, 'aliases': ['conv']},
|
||||
'conv': {'min_args': 3, 'max_args': 5, 'signature': 'conv(tensor, size_x, kernel) / conv(tensor, size_x, size_y, kernel) / conv(tensor, size_x, size_y, size_z, kernel)', 'forms': [['tensor', 'size_x', 'kernel'], ['tensor', 'size_x', 'size_y', 'kernel'], ['tensor', 'size_x', 'size_y', 'size_z', 'kernel']], 'description': 'convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates', 'details': '', 'params': {'tensor': 'input shaped [batch, channel, spatial...]', 'size_x': 'kernel size along the first spatial dimension', 'size_y': 'kernel size along the second spatial dimension', 'size_z': 'kernel size along the third spatial dimension', 'kernel': 'expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre'}, 'aliases': ['convolution']},
|
||||
'swap': {'min_args': 4, 'max_args': 4, 'signature': 'swap(x, dim, idx1, idx2)', 'forms': [['x', 'dim', 'idx1', 'idx2']], 'description': 'swaps elements along dim between idx1 and idx2', 'details': '', 'params': {'dim': 'dimension to swap along', 'idx1': 'first position', 'idx2': 'second position'}, 'aliases': []},
|
||||
'transpose': {'min_args': 3, 'max_args': 3, 'signature': 'transpose(x, dim0, dim1) / transpose(x, dim0, dim1)', 'forms': [['x', 'dim0', 'dim1'], ['x', 'dim0', 'dim1']], 'description': 'swaps two tensor dimensions', 'details': '', 'params': {'dim0': 'first dimension to swap', 'dim1': 'second dimension to swap'}, 'aliases': ['swapaxes']},
|
||||
'swapaxes': {'min_args': 3, 'max_args': 3, 'signature': 'swapaxes(x, dim0, dim1) / swapaxes(x, dim0, dim1)', 'forms': [['x', 'dim0', 'dim1'], ['x', 'dim0', 'dim1']], 'description': 'swaps two tensor dimensions', 'details': '', 'params': {'dim0': 'first dimension to swap', 'dim1': 'second dimension to swap'}, 'aliases': ['transpose']},
|
||||
'permute': {'min_args': 2, 'max_args': 2, 'signature': 'permute(x, dims)', 'forms': [['x', 'dims']], 'description': 'permutes the dimensions of tensor x according to dims', 'details': '', 'params': {'dims': 'new order of the dimensions, e.g. [0, 2, 1]'}, 'aliases': ['perm']},
|
||||
'perm': {'min_args': 2, 'max_args': 2, 'signature': 'perm(x, dims)', 'forms': [['x', 'dims']], 'description': 'permutes the dimensions of tensor x according to dims', 'details': '', 'params': {'dims': 'new order of the dimensions, e.g. [0, 2, 1]'}, 'aliases': ['permute']},
|
||||
'reshape': {'min_args': 2, 'max_args': 2, 'signature': 'reshape(x, shape)', 'forms': [['x', 'shape']], 'description': 'reshapes tensor x to the specified shape', 'details': '', 'params': {'shape': 'new shape; the total number of elements must stay the same'}, 'aliases': ['rshp']},
|
||||
'rshp': {'min_args': 2, 'max_args': 2, 'signature': 'rshp(x, shape)', 'forms': [['x', 'shape']], 'description': 'reshapes tensor x to the specified shape', 'details': '', 'params': {'shape': 'new shape; the total number of elements must stay the same'}, 'aliases': ['reshape']},
|
||||
'range': {'min_args': 3, 'max_args': 3, 'signature': 'range(start, stop, step)', 'forms': [['start', 'stop', 'step']], 'description': 'creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.', 'details': '', 'params': {'start': 'first value', 'stop': 'end of the range (not included)', 'step': 'distance between consecutive values'}, 'aliases': []},
|
||||
'linspace': {'min_args': 3, 'max_args': 3, 'signature': 'linspace(start, stop, num)', 'forms': [['start', 'stop', 'num']], 'description': 'creates num linearly spaced values from start to stop (inclusive). Use range if you want to control the step between values.', 'details': '', 'params': {'num': 'number of values'}, 'aliases': []},
|
||||
'logspace': {'min_args': 4, 'max_args': 4, 'signature': 'logspace(start, stop, num, base)', 'forms': [['start', 'stop', 'num', 'base']], 'description': 'creates logarithmically spaced values', 'details': '', 'params': {'start': 'exponent of the first value', 'stop': 'exponent of the last value', 'num': 'number of values', 'base': 'base of the exponent'}, 'aliases': []},
|
||||
'topk': {'min_args': 2, 'max_args': 3, 'signature': 'topk(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.', 'details': '', 'params': {'k': 'number of elements to keep', 'dim': 'dimension to select along (default: last)'}, 'aliases': []},
|
||||
'botk': {'min_args': 2, 'max_args': 3, 'signature': 'botk(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.', 'details': '', 'params': {'k': 'number of elements to keep', 'dim': 'dimension to select along (default: last)'}, 'aliases': []},
|
||||
'pinv': {'min_args': 1, 'max_args': 1, 'signature': 'pinv(x)', 'forms': [['x']], 'description': 'computes the inverse permutation of x: where x[i] == j the result has result[j] == i. Not the matrix pseudoinverse; use inv(x, 1) for that', 'details': '', 'params': {}, 'aliases': []},
|
||||
'inv': {'min_args': 1, 'max_args': 2, 'signature': 'inv(x, [pseudo])', 'forms': [['x', '[pseudo]']], 'description': 'computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead', 'details': '', 'params': {'pseudo': 'truthy to compute the Moore-Penrose pseudoinverse, which also works for singular and non-square matrices (default: false)'}, 'aliases': []},
|
||||
'sum': {'min_args': 1, 'max_args': 2, 'signature': 'sum(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the sum of elements of x, optionally along one or more dimensions', 'details': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, 'aliases': []},
|
||||
'mean': {'min_args': 1, 'max_args': 2, 'signature': 'mean(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the arithmetic mean of elements of x globally or along one or more dimensions', 'details': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, 'aliases': []},
|
||||
'std': {'min_args': 1, 'max_args': 2, 'signature': 'std(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the sample standard deviation of elements of x globally or along one or more dimensions', 'details': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, 'aliases': []},
|
||||
'var': {'min_args': 1, 'max_args': 2, 'signature': 'var(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the sample variance of elements of x globally or along one or more dimensions', 'details': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, 'aliases': []},
|
||||
'prod': {'min_args': 1, 'max_args': 2, 'signature': 'prod(x, [dims])', 'forms': [['x', '[dims]']], 'description': 'computes the product of elements of x globally or along one or more dimensions', 'details': '', 'params': {'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, 'aliases': []},
|
||||
'isclose': {'min_args': 2, 'max_args': 4, 'signature': 'isclose(a, b, [rtol], [atol])', 'forms': [['a', 'b', '[rtol]', '[atol]']], 'description': 'elementwise approximate equality test', 'details': '', 'params': {'rtol': 'relative tolerance (default: 1e-5)', 'atol': 'absolute tolerance (default: 1e-8)'}, 'aliases': []},
|
||||
'allclose': {'min_args': 2, 'max_args': 4, 'signature': 'allclose(a, b, [rtol], [atol])', 'forms': [['a', 'b', '[rtol]', '[atol]']], 'description': 'returns 1.0 if all elements are approximately equal, else 0.0', 'details': '', 'params': {'rtol': 'relative tolerance (default: 1e-5)', 'atol': 'absolute tolerance (default: 1e-8)'}, 'aliases': []},
|
||||
'quartile': {'min_args': 2, 'max_args': 3, 'signature': 'quartile(x, q, [dim])', 'forms': [['x', 'q', '[dim]']], 'description': 'computes the q-th quartile globally or along dim', 'details': '', 'params': {'q': 'quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)', 'dim': 'dimension to reduce (default: all elements)'}, 'aliases': ['quartil']},
|
||||
'quartil': {'min_args': 2, 'max_args': 3, 'signature': 'quartil(x, q, [dim])', 'forms': [['x', 'q', '[dim]']], 'description': 'computes the q-th quartile globally or along dim', 'details': '', 'params': {'q': 'quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)', 'dim': 'dimension to reduce (default: all elements)'}, 'aliases': ['quartile']},
|
||||
'percentile': {'min_args': 2, 'max_args': 3, 'signature': 'percentile(x, p, [dim])', 'forms': [['x', 'p', '[dim]']], 'description': 'computes the p-th percentile globally or along dim', 'details': '', 'params': {'p': 'percentile 0-100', 'dim': 'dimension to reduce (default: all elements)'}, 'aliases': ['prcnt']},
|
||||
'prcnt': {'min_args': 2, 'max_args': 3, 'signature': 'prcnt(x, p, [dim])', 'forms': [['x', 'p', '[dim]']], 'description': 'computes the p-th percentile globally or along dim', 'details': '', 'params': {'p': 'percentile 0-100', 'dim': 'dimension to reduce (default: all elements)'}, 'aliases': ['percentile']},
|
||||
'quantile': {'min_args': 2, 'max_args': 3, 'signature': 'quantile(x, q, [dim])', 'forms': [['x', 'q', '[dim]']], 'description': 'computes the q-th quantile globally or along dim', 'details': '', 'params': {'q': 'quantile 0-1', 'dim': 'dimension to reduce (default: all elements)'}, 'aliases': []},
|
||||
'dot': {'min_args': 2, 'max_args': 2, 'signature': 'dot(x, y)', 'forms': [['x', 'y']], 'description': 'computes the dot product of x and y after flattening both to 1D. Use cross(x, y) if you need a per-vector product with the last dimension kept.', 'details': '', 'params': {}, 'aliases': []},
|
||||
'moment': {'min_args': 3, 'max_args': 3, 'signature': 'moment(x, a, k)', 'forms': [['x', 'a', 'k']], 'description': 'computes the k-th moment of x around a', 'details': '', 'params': {'a': 'centre the moment is taken around', 'k': 'order of the moment'}, 'aliases': []},
|
||||
'erf': {'min_args': 1, 'max_args': 1, 'signature': 'erf(x)', 'forms': [['x']], 'description': 'computes the error function (torch.erf)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'erfc': {'min_args': 1, 'max_args': 1, 'signature': 'erfc(x)', 'forms': [['x']], 'description': 'computes the complementary error function (torch.special.erfc)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'erfinv': {'min_args': 1, 'max_args': 1, 'signature': 'erfinv(x)', 'forms': [['x']], 'description': 'computes the inverse error function (torch.erfinv)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'any': {'min_args': 1, 'max_args': 1, 'signature': 'any(x)', 'forms': [['x']], 'description': 'returns 1 if any element of x is non-zero otherwise 0', 'details': '', 'params': {}, 'aliases': []},
|
||||
'all': {'min_args': 1, 'max_args': 1, 'signature': 'all(x)', 'forms': [['x']], 'description': 'returns 1 if all elements of x are non-zero otherwise 0', 'details': '', 'params': {}, 'aliases': []},
|
||||
'edge': {'min_args': 1, 'max_args': 2, 'signature': 'edge(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'detects edges in x with a Sobel filter. kernel_size must be odd and at least 3 (default 3).', 'details': '', 'params': {'kernel_size': 'odd Sobel kernel size, at least 3 (default: 3)'}, 'aliases': []},
|
||||
'blur': {'min_args': 2, 'max_args': 3, 'signature': 'blur(x, sigma, [reshape])', 'forms': [['x', 'sigma', '[reshape]']], 'description': 'applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.', 'details': '', 'params': {'sigma': 'blur strength as the standard deviation in elements; 0 or less returns x unchanged', 'reshape': 'truthy to find the channel dimension automatically; otherwise channels must be last (default: false)'}, 'aliases': ['gaussian']},
|
||||
'gaussian': {'min_args': 2, 'max_args': 3, 'signature': 'gaussian(x, sigma, [reshape])', 'forms': [['x', 'sigma', '[reshape]']], 'description': 'applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.', 'details': '', 'params': {'sigma': 'blur strength as the standard deviation in elements; 0 or less returns x unchanged', 'reshape': 'truthy to find the channel dimension automatically; otherwise channels must be last (default: false)'}, 'aliases': ['blur']},
|
||||
'median': {'min_args': 1, 'max_args': 2, 'signature': 'median(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the median globally or along one dimension', 'details': '', 'params': {'dim': 'dimension to reduce (default: all elements)'}, 'aliases': []},
|
||||
'mode': {'min_args': 1, 'max_args': 2, 'signature': 'mode(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the mode globally or along one dimension', 'details': '', 'params': {'dim': 'dimension to reduce (default: all elements)'}, 'aliases': []},
|
||||
'cumsum': {'min_args': 1, 'max_args': 2, 'signature': 'cumsum(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the cumulative sum, defaulting to the first dimension.', 'details': '', 'params': {'dim': 'dimension to accumulate along (default: 0)'}, 'aliases': []},
|
||||
'cumprod': {'min_args': 1, 'max_args': 1, 'signature': 'cumprod(x)', 'forms': [['x']], 'description': 'computes the cumulative product over first dimension.', 'details': '', 'params': {}, 'aliases': []},
|
||||
'topk_ind': {'min_args': 2, 'max_args': 3, 'signature': 'topk_ind(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'params': {'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, 'aliases': ['topk_indices']},
|
||||
'topk_indices': {'min_args': 2, 'max_args': 3, 'signature': 'topk_indices(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'params': {'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, 'aliases': ['topk_ind']},
|
||||
'botk_ind': {'min_args': 2, 'max_args': 3, 'signature': 'botk_ind(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'params': {'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, 'aliases': ['botk_indices']},
|
||||
'botk_indices': {'min_args': 2, 'max_args': 3, 'signature': 'botk_indices(x, k, [dim])', 'forms': [['x', 'k', '[dim]']], 'description': 'returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)', 'details': '', 'params': {'k': 'number of indices to return', 'dim': 'dimension to select along (default: indices into flatten(x))'}, 'aliases': ['botk_ind']},
|
||||
'cubic_ease': {'min_args': 3, 'max_args': 3, 'signature': 'cubic_ease(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'cubic ease between a and b', 'details': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, 'aliases': ['cubic']},
|
||||
'cubic': {'min_args': 3, 'max_args': 3, 'signature': 'cubic(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'cubic ease between a and b', 'details': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, 'aliases': ['cubic_ease']},
|
||||
'elastic_ease': {'min_args': 3, 'max_args': 3, 'signature': 'elastic_ease(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'elastic ease between a and b', 'details': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, 'aliases': ['elastic']},
|
||||
'elastic': {'min_args': 3, 'max_args': 3, 'signature': 'elastic(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'elastic ease between a and b', 'details': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, 'aliases': ['elastic_ease']},
|
||||
'sine_ease': {'min_args': 3, 'max_args': 3, 'signature': 'sine_ease(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'sine easing between a and b', 'details': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, 'aliases': ['sine']},
|
||||
'sine': {'min_args': 3, 'max_args': 3, 'signature': 'sine(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'sine easing between a and b', 'details': '', 'params': {'t': 'progress from 0 (gives a) to 1 (gives b)'}, 'aliases': ['sine_ease']},
|
||||
'smootherstep': {'min_args': 3, 'max_args': 3, 'signature': 'smootherstep(x, edge0, edge1)', 'forms': [['x', 'edge0', 'edge1']], 'description': 'smoother interpolation between edge0 and edge1', 'details': '', 'params': {'edge0': 'value mapped to 0', 'edge1': 'value mapped to 1'}, 'aliases': []},
|
||||
'dist': {'min_args': 4, 'max_args': 4, 'signature': 'dist(x1, y1, x2, y2)', 'forms': [['x1', 'y1', 'x2', 'y2']], 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)', 'details': '', 'params': {}, 'aliases': ['distance']},
|
||||
'distance': {'min_args': 4, 'max_args': 4, 'signature': 'distance(x1, y1, x2, y2)', 'forms': [['x1', 'y1', 'x2', 'y2']], 'description': 'computes Euclidean distance between (x1, y1) and (x2, y2)', 'details': '', 'params': {}, 'aliases': ['dist']},
|
||||
'remap': {'min_args': 5, 'max_args': 5, 'signature': 'remap(v, i_min, i_max, o_min, o_max)', 'forms': [['v', 'i_min', 'i_max', 'o_min', 'o_max']], 'description': 'remaps values from input range to output range', 'details': '', 'params': {'i_min': 'start of the input range', 'i_max': 'end of the input range', 'o_min': 'value i_min maps to', 'o_max': 'value i_max maps to'}, 'aliases': []},
|
||||
'cossim': {'min_args': 2, 'max_args': 2, 'signature': 'cossim(x, y)', 'forms': [['x', 'y']], 'description': 'computes the cosine similarity between x and y.', 'details': '', 'params': {}, 'aliases': ['cosine_similarity']},
|
||||
'cosine_similarity': {'min_args': 2, 'max_args': 2, 'signature': 'cosine_similarity(x, y)', 'forms': [['x', 'y']], 'description': 'computes the cosine similarity between x and y.', 'details': '', 'params': {}, 'aliases': ['cossim']},
|
||||
'count': {'min_args': 1, 'max_args': 1, 'signature': 'count(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'params': {}, 'aliases': ['cnt', 'length']},
|
||||
'cnt': {'min_args': 1, 'max_args': 1, 'signature': 'cnt(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'params': {}, 'aliases': ['count', 'length']},
|
||||
'length': {'min_args': 1, 'max_args': 1, 'signature': 'length(x)', 'forms': [['x']], 'description': 'returns the number of elements in x', 'details': '', 'params': {}, 'aliases': ['count', 'cnt']},
|
||||
'keys': {'min_args': 1, 'max_args': 1, 'signature': 'keys(x)', 'forms': [['x']], 'description': 'returns a list of dictionary keys in insertion order', 'details': '', 'params': {}, 'aliases': []},
|
||||
'enable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'enable_tracking(d)', 'forms': [['d']], 'description': 'enables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'params': {}, 'aliases': ['track_on']},
|
||||
'track_on': {'min_args': 1, 'max_args': 1, 'signature': 'track_on(d)', 'forms': [['d']], 'description': 'enables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'params': {}, 'aliases': ['enable_tracking']},
|
||||
'disable_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'disable_tracking(d)', 'forms': [['d']], 'description': 'disables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'params': {}, 'aliases': ['track_off']},
|
||||
'track_off': {'min_args': 1, 'max_args': 1, 'signature': 'track_off(d)', 'forms': [['d']], 'description': 'disables change tracking for ChangeTrackingDict d (returns d)', 'details': '', 'params': {}, 'aliases': ['disable_tracking']},
|
||||
'reset_tracking': {'min_args': 1, 'max_args': 1, 'signature': 'reset_tracking(d)', 'forms': [['d']], 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)', 'details': '', 'params': {}, 'aliases': ['track_reset']},
|
||||
'track_reset': {'min_args': 1, 'max_args': 1, 'signature': 'track_reset(d)', 'forms': [['d']], 'description': 'resets change tracking state for ChangeTrackingDict d (returns d)', 'details': '', 'params': {}, 'aliases': ['reset_tracking']},
|
||||
'get_changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_changed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d', 'details': '', 'params': {}, 'aliases': ['changed_keys']},
|
||||
'changed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'changed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were modified or added in ChangeTrackingDict d', 'details': '', 'params': {}, 'aliases': ['get_changed_keys']},
|
||||
'get_added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_added_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d', 'details': '', 'params': {}, 'aliases': ['added_keys']},
|
||||
'added_keys': {'min_args': 1, 'max_args': 1, 'signature': 'added_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were added (newly created) in ChangeTrackingDict d', 'details': '', 'params': {}, 'aliases': ['get_added_keys']},
|
||||
'get_removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_removed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were removed from ChangeTrackingDict d', 'details': '', 'params': {}, 'aliases': ['removed_keys']},
|
||||
'removed_keys': {'min_args': 1, 'max_args': 1, 'signature': 'removed_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that were removed from ChangeTrackingDict d', 'details': '', 'params': {}, 'aliases': ['get_removed_keys']},
|
||||
'get_unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'get_unchanged_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d', 'details': '', 'params': {}, 'aliases': ['unchanged_keys']},
|
||||
'unchanged_keys': {'min_args': 1, 'max_args': 1, 'signature': 'unchanged_keys(d)', 'forms': [['d']], 'description': 'returns list of keys that remain unchanged in ChangeTrackingDict d', 'details': '', 'params': {}, 'aliases': ['get_unchanged_keys']},
|
||||
'repeat': {'min_args': 2, 'max_args': 3, 'signature': 'repeat(x, count, [dims])', 'forms': [['x', 'count', '[dims]']], 'description': 'repeats tensor elements; count may be scalar or per-dim list', 'details': '', 'params': {'count': 'number of repeats, or a list with one count per dimension', 'dims': 'dimension or list of dimensions to repeat along; without it a number repeats each element of the flattened input and a list tiles the whole tensor'}, 'aliases': []},
|
||||
'flatten': {'min_args': 1, 'max_args': 1, 'signature': 'flatten(x)', 'forms': [['x']], 'description': 'flattens tensor into a 1D tensor', 'details': '', 'params': {}, 'aliases': []},
|
||||
'append': {'min_args': 2, 'max_args': 2, 'signature': 'append(x, y)', 'forms': [['x', 'y']], 'description': 'appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)', 'details': '', 'params': {'y': 'item, list or tensor added to the end of x'}, 'aliases': []},
|
||||
'get_value': {'min_args': 2, 'max_args': 2, 'signature': 'get_value(tensor, position)', 'forms': [['tensor', 'position']], 'description': 'reads the value at an N-D position of tensor. Superseded by tensor[position] indexing', 'details': '', 'params': {'position': 'list with one index per dimension'}, 'aliases': []},
|
||||
'flow_apply': {'min_args': 2, 'max_args': 2, 'signature': 'flow_apply(image, flow)', 'forms': [['image', 'flow']], 'description': 'applies optical flow to an image', 'details': '', 'params': {}, 'aliases': []},
|
||||
'batch_shuffle': {'min_args': 2, 'max_args': 2, 'signature': 'batch_shuffle(x, indices)', 'forms': [['x', 'indices']], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'params': {'indices': 'batch indices to take, in order; batches may repeat or be skipped'}, 'aliases': ['shuffle', 'select']},
|
||||
'shuffle': {'min_args': 2, 'max_args': 2, 'signature': 'shuffle(x, indices)', 'forms': [['x', 'indices']], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'params': {'indices': 'batch indices to take, in order; batches may repeat or be skipped'}, 'aliases': ['batch_shuffle', 'select']},
|
||||
'select': {'min_args': 2, 'max_args': 2, 'signature': 'select(x, indices)', 'forms': [['x', 'indices']], 'description': 'shuffles and duplicates or skips the batch dimension of x according to indices', 'details': '', 'params': {'indices': 'batch indices to take, in order; batches may repeat or be skipped'}, 'aliases': ['batch_shuffle', 'shuffle']},
|
||||
'motion_mask': {'min_args': 1, 'max_args': 1, 'signature': 'motion_mask(x)', 'forms': [['x']], 'description': 'generates a motion mask from optical flow', 'details': '', 'params': {}, 'aliases': []},
|
||||
'flow_to_image': {'min_args': 1, 'max_args': 1, 'signature': 'flow_to_image(x)', 'forms': [['x']], 'description': 'converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta.', 'details': '', 'params': {}, 'aliases': []},
|
||||
'flow_mag': {'min_args': 1, 'max_args': 1, 'signature': 'flow_mag(x)', 'forms': [['x']], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'params': {}, 'aliases': ['flow_magnitude']},
|
||||
'flow_magnitude': {'min_args': 1, 'max_args': 1, 'signature': 'flow_magnitude(x)', 'forms': [['x']], 'description': 'computes the magnitude of optical flow (or any other structure with last dimension of 2)', 'details': '', 'params': {}, 'aliases': ['flow_mag']},
|
||||
'flow_ang': {'min_args': 1, 'max_args': 1, 'signature': 'flow_ang(x)', 'forms': [['x']], 'description': 'computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)', 'details': '', 'params': {}, 'aliases': ['flow_angle']},
|
||||
'flow_angle': {'min_args': 1, 'max_args': 1, 'signature': 'flow_angle(x)', 'forms': [['x']], 'description': 'computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)', 'details': '', 'params': {}, 'aliases': ['flow_ang']},
|
||||
'where': {'min_args': 3, 'max_args': 3, 'signature': 'where(condition, x, y)', 'forms': [['condition', 'x', 'y']], 'description': 'returns x if condition is true, else y. Runs per element.', 'details': '', 'params': {'condition': 'non-zero selects x, zero selects y'}, 'aliases': []},
|
||||
'histogram': {'min_args': 4, 'max_args': 4, 'signature': 'histogram(x, bins, min, max)', 'forms': [['x', 'bins', 'min', 'max']], 'description': 'counts the elements of flatten(x) in bins equal-width bins over [min, max]', 'details': '', 'params': {'bins': 'number of equal-width bins', 'min': 'lower edge of the first bin', 'max': 'upper edge of the last bin'}, 'aliases': ['hist']},
|
||||
'hist': {'min_args': 4, 'max_args': 4, 'signature': 'hist(x, bins, min, max)', 'forms': [['x', 'bins', 'min', 'max']], 'description': 'counts the elements of flatten(x) in bins equal-width bins over [min, max]', 'details': '', 'params': {'bins': 'number of equal-width bins', 'min': 'lower edge of the first bin', 'max': 'upper edge of the last bin'}, 'aliases': ['histogram']},
|
||||
'overlay': {'min_args': 3, 'max_args': 4, 'signature': 'overlay(base, overlay, offset, [opacity])', 'forms': [['base', 'overlay', 'offset', '[opacity]']], 'description': 'overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.', 'details': '', 'params': {'offset': 'position of the overlay\'s low corner in base, one value per dimension', 'opacity': '0-1 blend amount; a number or a tensor shaped like overlay (default: 1)'}, 'aliases': []},
|
||||
'pad': {'min_args': 2, 'max_args': 2, 'signature': 'pad(x, padding)', 'forms': [['x', 'padding']], 'description': 'pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)', 'details': '', 'params': {'padding': 'amounts as [dim0_before, dim0_after, dim1_before, dim1_after, ...]'}, 'aliases': []},
|
||||
'cross': {'min_args': 2, 'max_args': 2, 'signature': 'cross(x, y)', 'forms': [['x', 'y']], 'description': 'computes the cross product of x and y. Last dimension must be 3', 'details': '', 'params': {}, 'aliases': []},
|
||||
'matmul': {'min_args': 2, 'max_args': 2, 'signature': 'matmul(x, y)', 'forms': [['x', 'y']], 'description': 'computes the matrix multiplication of x and y', 'details': '', 'params': {}, 'aliases': []},
|
||||
'solve': {'min_args': 2, 'max_args': 2, 'signature': 'solve(A, b)', 'forms': [['A', 'b']], 'description': 'solves the square linear system A*x=b without explicitly forming A inverse', 'details': '', 'params': {'A': 'square coefficient matrix', 'b': 'right-hand side'}, 'aliases': []},
|
||||
'matrix_rank': {'min_args': 1, 'max_args': 2, 'signature': 'matrix_rank(x, [tol])', 'forms': [['x', '[tol]']], 'description': 'computes the numerical rank of each matrix using optional absolute tolerance tol', 'details': '', 'params': {'tol': 'absolute tolerance below which singular values count as zero'}, 'aliases': []},
|
||||
'rife': {'min_args': 2, 'max_args': 5, 'signature': 'rife(image1, image2, [tiling_size], [iterations], [multi_scale])', 'forms': [['image1', 'image2', '[tiling_size]', '[iterations]', '[multi_scale]']], 'description': 'computes the optical flow field ([H, W, 2]) between image1 and image2 using a RAFT-based model', 'details': '', 'params': {'tiling_size': 'splits the image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution', 'iterations': 'how many times to run the flow model. Default 12', 'multi_scale': 'also use low resolution of base image for giant movements. Default false'}, 'aliases': []},
|
||||
'bnot': {'min_args': 1, 'max_args': 1, 'signature': 'bnot(x)', 'forms': [['x']], 'description': 'computes the bitwise NOT', 'details': '', 'params': {}, 'aliases': ['bitwise_not']},
|
||||
'bitwise_not': {'min_args': 1, 'max_args': 1, 'signature': 'bitwise_not(x)', 'forms': [['x']], 'description': 'computes the bitwise NOT', 'details': '', 'params': {}, 'aliases': ['bnot']},
|
||||
'bitcount': {'min_args': 1, 'max_args': 1, 'signature': 'bitcount(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'params': {}, 'aliases': ['popcount', 'popcnt']},
|
||||
'popcount': {'min_args': 1, 'max_args': 1, 'signature': 'popcount(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'params': {}, 'aliases': ['bitcount', 'popcnt']},
|
||||
'popcnt': {'min_args': 1, 'max_args': 1, 'signature': 'popcnt(x)', 'forms': [['x']], 'description': 'returns the number of set bits', 'details': '', 'params': {}, 'aliases': ['bitcount', 'popcount']},
|
||||
'shape': {'min_args': 1, 'max_args': 1, 'signature': 'shape(x)', 'forms': [['x']], 'description': 'returns the shape of tensor as a list', 'details': '', 'params': {}, 'aliases': []},
|
||||
'band': {'min_args': 2, 'max_args': 2, 'signature': 'band(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise AND of x and y', 'details': '', 'params': {}, 'aliases': ['bitwise_and']},
|
||||
'bitwise_and': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_and(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise AND of x and y', 'details': '', 'params': {}, 'aliases': ['band']},
|
||||
'bxor': {'min_args': 2, 'max_args': 2, 'signature': 'bxor(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise XOR of x and y', 'details': '', 'params': {}, 'aliases': ['bitwise_xor']},
|
||||
'bitwise_xor': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_xor(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise XOR of x and y', 'details': '', 'params': {}, 'aliases': ['bxor']},
|
||||
'bor': {'min_args': 2, 'max_args': 2, 'signature': 'bor(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise OR of x and y', 'details': '', 'params': {}, 'aliases': ['bitwise_or']},
|
||||
'bitwise_or': {'min_args': 2, 'max_args': 2, 'signature': 'bitwise_or(x, y)', 'forms': [['x', 'y']], 'description': 'computes the element-wise bitwise OR of x and y', 'details': '', 'params': {}, 'aliases': ['bor']},
|
||||
'tensor': {'min_args': 1, 'max_args': 3, 'signature': 'tensor(shape, [value], [dtype_template])', 'forms': [['shape', '[value]', '[dtype_template]']], 'description': 'creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32', 'details': '', 'params': {'shape': 'list of dimension sizes', 'value': 'fill value (default: 0)', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, 'aliases': []},
|
||||
'zeros': {'min_args': 1, 'max_args': 2, 'signature': 'zeros(shape, [dtype_template])', 'forms': [['shape', '[dtype_template]']], 'description': 'creates a zero-filled tensor on the current device', 'details': '', 'params': {'shape': 'list of dimension sizes', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, 'aliases': []},
|
||||
'ones': {'min_args': 1, 'max_args': 2, 'signature': 'ones(shape, [dtype_template])', 'forms': [['shape', '[dtype_template]']], 'description': 'creates a one-filled tensor on the current device', 'details': '', 'params': {'shape': 'list of dimension sizes', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, 'aliases': []},
|
||||
'eye': {'min_args': 1, 'max_args': 2, 'signature': 'eye(n, [dtype_template])', 'forms': [['n', '[dtype_template]']], 'description': 'creates an n-by-n identity matrix', 'details': '', 'params': {'n': 'number of rows and columns', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, 'aliases': []},
|
||||
'one_hot': {'min_args': 2, 'max_args': 2, 'signature': 'one_hot(indices, classes)', 'forms': [['indices', 'classes']], 'description': 'converts integer class indices to float32 one-hot vectors', 'details': '', 'params': {'indices': 'integer class indices', 'classes': 'number of classes, i.e. the length of each one-hot vector'}, 'aliases': []},
|
||||
'mse': {'min_args': 2, 'max_args': 3, 'signature': 'mse(a, b, [reduction])', 'forms': [['a', 'b', '[reduction]']], 'description': 'mean squared error; reduction is mean (default), sum, or none', 'details': '', 'params': {'reduction': '"mean" (default), "sum", or "none" for element-wise values'}, 'aliases': []},
|
||||
'mae': {'min_args': 2, 'max_args': 3, 'signature': 'mae(a, b, [reduction])', 'forms': [['a', 'b', '[reduction]']], 'description': 'mean absolute error; reduction is mean (default), sum, or none', 'details': '', 'params': {'reduction': '"mean" (default), "sum", or "none" for element-wise values'}, 'aliases': []},
|
||||
'psnr': {'min_args': 2, 'max_args': 3, 'signature': 'psnr(a, b, [data_range])', 'forms': [['a', 'b', '[data_range]']], 'description': 'peak signal-to-noise ratio in dB; data_range defaults to 1', 'details': '', 'params': {'data_range': 'difference between the largest and smallest possible value (default: 1)'}, 'aliases': []},
|
||||
'weighted_mean': {'min_args': 2, 'max_args': 3, 'signature': 'weighted_mean(x, weights, [dims])', 'forms': [['x', 'weights', '[dims]']], 'description': 'computes the weighted mean globally or along one or more dimensions', 'details': '', 'params': {'weights': 'weight of each element, broadcast against x', 'dims': 'dimension or list of dimensions to reduce (default: all elements)'}, 'aliases': []},
|
||||
'huber_loss': {'min_args': 2, 'max_args': 4, 'signature': 'huber_loss(prediction, target, [delta], [reduction])', 'forms': [['prediction', 'target', '[delta]', '[reduction]']], 'description': 'computes Huber loss; delta defaults to 1 and reduction to mean', 'details': '', 'params': {'delta': 'error size where the loss changes from quadratic to linear (default: 1)', 'reduction': '"mean" (default), "sum", or "none" for element-wise values'}, 'aliases': []},
|
||||
'cross_entropy': {'min_args': 2, 'max_args': 4, 'signature': 'cross_entropy(logits, target, [dim], [reduction])', 'forms': [['logits', 'target', '[dim]', '[reduction]']], 'description': 'computes cross-entropy from class logits and class indices or target probabilities', 'details': '', 'params': {'logits': 'unnormalised class scores', 'target': 'class indices, or class probabilities with the same shape as logits', 'dim': 'class dimension (default: 1, or 0 for a single vector)', 'reduction': '"mean" (default), "sum", or "none" for element-wise values'}, 'aliases': []},
|
||||
'add_key': {'min_args': 3, 'max_args': 3, 'signature': 'add_key(dict, key, value)', 'forms': [['dict', 'key', 'value']], 'description': 'adds or replaces a dictionary entry and returns the updated dictionary', 'details': '', 'params': {}, 'aliases': []},
|
||||
'remove_key': {'min_args': 2, 'max_args': 2, 'signature': 'remove_key(dict, key)', 'forms': [['dict', 'key']], 'description': 'removes a dictionary entry and returns the updated dictionary', 'details': '', 'params': {}, 'aliases': ['rm_key']},
|
||||
'rm_key': {'min_args': 2, 'max_args': 2, 'signature': 'rm_key(dict, key)', 'forms': [['dict', 'key']], 'description': 'removes a dictionary entry and returns the updated dictionary', 'details': '', 'params': {}, 'aliases': ['remove_key']},
|
||||
'stack_push': {'min_args': 2, 'max_args': 2, 'signature': 'stack_push(slot, val)', 'forms': [['slot', 'val']], 'description': 'pushes val onto the end of slot stack', 'details': '', 'params': {'slot': 'stack number (any integer)', 'val': 'value to push; it is also returned'}, 'aliases': []},
|
||||
'stack_pop': {'min_args': 1, 'max_args': 1, 'signature': 'stack_pop(slot)', 'forms': [['slot']], 'description': 'removes and returns the last element of slot stack', 'details': '', 'params': {}, 'aliases': []},
|
||||
'stack_clear': {'min_args': 1, 'max_args': 1, 'signature': 'stack_clear(slot)', 'forms': [['slot']], 'description': 'clears the contents of slot stack', 'details': '', 'params': {}, 'aliases': []},
|
||||
'stack_has': {'min_args': 1, 'max_args': 1, 'signature': 'stack_has(slot)', 'forms': [['slot']], 'description': 'returns 1.0 if slot exists in stack and is not empty else returns 0.0', 'details': '', 'params': {}, 'aliases': []},
|
||||
'stack_get': {'min_args': 1, 'max_args': 1, 'signature': 'stack_get(slot)', 'forms': [['slot']], 'description': 'returns the last pushed value in slot without popping it', 'details': '', 'params': {}, 'aliases': []},
|
||||
'cat': {'min_args': 2, 'max_args': None, 'signature': 'cat(x, ..., dim)', 'forms': [['x', '...', 'dim']], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'params': {'dim': 'dimension to join along (the last argument)'}, 'aliases': ['concat', 'concatenate']},
|
||||
'concat': {'min_args': 2, 'max_args': None, 'signature': 'concat(x, ..., dim)', 'forms': [['x', '...', 'dim']], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'params': {'dim': 'dimension to join along (the last argument)'}, 'aliases': ['cat', 'concatenate']},
|
||||
'concatenate': {'min_args': 2, 'max_args': None, 'signature': 'concatenate(x, ..., dim)', 'forms': [['x', '...', 'dim']], 'description': 'concatenates one or more tensors along the specified dimension', 'details': '', 'params': {'dim': 'dimension to join along (the last argument)'}, 'aliases': ['cat', 'concat']},
|
||||
'stack': {'min_args': 1, 'max_args': 2, 'signature': 'stack(tensors, [dim])', 'forms': [['tensors', '[dim]']], 'description': 'stacks a list of tensors along a new dimension', 'details': '', 'params': {'tensors': 'list of tensors with equal shapes', 'dim': 'position of the new dimension (default: 0)'}, 'aliases': []},
|
||||
'nonzero': {'min_args': 1, 'max_args': 1, 'signature': 'nonzero(x)', 'forms': [['x']], 'description': 'returns an N-by-rank tensor of coordinates for nonzero elements', 'details': '', 'params': {}, 'aliases': []},
|
||||
'int': {'min_args': 1, 'max_args': 1, 'signature': 'int(x)', 'forms': [['x']], 'description': 'casts x to integer', 'details': '', 'params': {}, 'aliases': []},
|
||||
'float': {'min_args': 1, 'max_args': 1, 'signature': 'float(x)', 'forms': [['x']], 'description': 'casts x to float', 'details': '', 'params': {}, 'aliases': []},
|
||||
'upper': {'min_args': 1, 'max_args': 1, 'signature': 'upper(x)', 'forms': [['x']], 'description': 'converts string to uppercase', 'details': '', 'params': {}, 'aliases': []},
|
||||
'lower': {'min_args': 1, 'max_args': 1, 'signature': 'lower(x)', 'forms': [['x']], 'description': 'converts string to lowercase', 'details': '', 'params': {}, 'aliases': []},
|
||||
'trim': {'min_args': 1, 'max_args': 1, 'signature': 'trim(x)', 'forms': [['x']], 'description': 'removes leading and trailing whitespace from string', 'details': '', 'params': {}, 'aliases': []},
|
||||
'split': {'min_args': 1, 'max_args': 2, 'signature': 'split(x, [delimiter])', 'forms': [['x', '[delimiter]']], 'description': 'splits string to list of strings based on delimiter. Default is space.', 'details': '', 'params': {'delimiter': 'text to split on (default: a space)'}, 'aliases': []},
|
||||
'join': {'min_args': 1, 'max_args': 2, 'signature': 'join(x, [separator])', 'forms': [['x', '[separator]']], 'description': 'joins the items of list x as text using separator (default ""). Use concatenate(...) to join tensors', 'details': '', 'params': {'separator': 'text placed between the items (default: "")'}, 'aliases': []},
|
||||
'substring': {'min_args': 2, 'max_args': 3, 'signature': 'substring(s, start, [length])', 'forms': [['s', 'start', '[length]']], 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'params': {'start': 'index of the first character', 'length': 'number of characters (default: the rest of the text)'}, 'aliases': ['substr']},
|
||||
'substr': {'min_args': 2, 'max_args': 3, 'signature': 'substr(s, start, [length])', 'forms': [['s', 'start', '[length]']], 'description': 'returns length characters of s starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'params': {'start': 'index of the first character', 'length': 'number of characters (default: the rest of the text)'}, 'aliases': ['substring']},
|
||||
'find': {'min_args': 2, 'max_args': 2, 'signature': 'find(s, sub)', 'forms': [['s', 'sub']], 'description': 'returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings.', 'details': '', 'params': {}, 'aliases': []},
|
||||
'replace': {'min_args': 3, 'max_args': 3, 'signature': 'replace(s, old, new)', 'forms': [['s', 'old', 'new']], 'description': 'replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.', 'details': '', 'params': {'old': 'text or value to look for', 'new': 'replacement'}, 'aliases': []},
|
||||
'dilate': {'min_args': 1, 'max_args': 2, 'signature': 'dilate(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological dilation to x with a square kernel (default size 3).', 'details': '', 'params': {'kernel_size': 'size of the square kernel (default: 3)'}, 'aliases': []},
|
||||
'erode': {'min_args': 1, 'max_args': 2, 'signature': 'erode(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological erosion to x with a square kernel (default size 3).', 'details': '', 'params': {'kernel_size': 'size of the square kernel (default: 3)'}, 'aliases': []},
|
||||
'morph_open': {'min_args': 1, 'max_args': 2, 'signature': 'morph_open(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological opening (erosion then dilation) to x with a square kernel (default size 3).', 'details': '', 'params': {'kernel_size': 'size of the square kernel (default: 3)'}, 'aliases': []},
|
||||
'morph_close': {'min_args': 1, 'max_args': 2, 'signature': 'morph_close(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological closing (dilation then erosion) to x with a square kernel (default size 3).', 'details': '', 'params': {'kernel_size': 'size of the square kernel (default: 3)'}, 'aliases': []},
|
||||
'rgb_to_oklab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_oklab(rgb) / rgb_to_oklab(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'converts 0-1 sRGB to OKLab. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result', 'details': '', 'params': {}, 'aliases': []},
|
||||
'rgb_to_cielab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_cielab(rgb) / rgb_to_cielab(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'converts 0-1 sRGB to CIELAB (D65) divided by 100, so L is 0-1. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result', 'details': '', 'params': {}, 'aliases': []},
|
||||
'oklab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)', 'forms': [['oklab'], ['l', 'a', 'b']], 'description': 'converts OKLab to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result', 'details': '', 'params': {}, 'aliases': []},
|
||||
'cielab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)', 'forms': [['cielab'], ['l', 'a', 'b']], 'description': 'converts CIELAB divided by 100 (as returned by rgb_to_cielab) to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result', 'details': '', 'params': {}, 'aliases': []},
|
||||
'rgb_to_hsv': {'min_args': 1, 'max_args': 4, 'signature': 'rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees])', 'forms': [['rgb', '[degrees]'], ['r', 'g', 'b', '[degrees]']], 'description': 'converts RGB to HSV. With one color argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is 0-360 instead of 0-1', 'details': '', 'params': {'degrees': 'truthy to use hue in 0-360 instead of 0-1'}, 'aliases': []},
|
||||
'hsv_to_rgb': {'min_args': 1, 'max_args': 4, 'signature': 'hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees])', 'forms': [['hsv', '[degrees]'], ['h', 's', 'v', '[degrees]']], 'description': 'converts HSV to RGB. With one color argument its last dimension holds H, S, V; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is read as 0-360 instead of 0-1', 'details': '', 'params': {'degrees': 'truthy to use hue in 0-360 instead of 0-1'}, 'aliases': []},
|
||||
'int_to_rgb': {'min_args': 1, 'max_args': 1, 'signature': 'int_to_rgb(val)', 'forms': [['val']], 'description': 'unpacks 0xRRGGBB integers into 0-1 RGB colors. Tensors get R, G, B stacked in a new last dimension, lists return a list of colors and a number returns a 3-item list', 'details': '', 'params': {}, 'aliases': []},
|
||||
'rgb_to_int': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_int(rgb) / rgb_to_int(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'packs 0-1 RGB components into 0xRRGGBB integers. With one argument the last dimension (or a 3-item list) holds R, G, B; with three, each argument is one channel', 'details': '', 'params': {}, 'aliases': []},
|
||||
'interpolate_linear': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_linear(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with (bi/tri)linear interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'params': {'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, 'aliases': []},
|
||||
'interpolate_area': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_area(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with area interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'params': {'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, 'aliases': []},
|
||||
'interpolate_nearest': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_nearest(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'params': {'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, 'aliases': ['interpolate_nearest_exact']},
|
||||
'interpolate_nearest_exact': {'min_args': 2, 'max_args': 2, 'signature': 'interpolate_nearest_exact(x, scale)', 'forms': [['x', 'scale']], 'description': 'resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size', 'details': '', 'params': {'scale': 'a number scales every spatial dimension; a list gives the target spatial size'}, 'aliases': ['interpolate_nearest']},
|
||||
'text_image': {'min_args': 3, 'max_args': 9, 'signature': 'text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline])', 'forms': [['text', 'font', 'size', '[max_width]', '[weight]', '[rotation_angle]', '[line_spacing]', '[italic]', '[underline]']], 'description': 'renders text to a 2D tensor with values 0-1', 'details': '', 'params': {'font': 'font name to look up in the system fonts, or a path to a font file', 'size': 'font size in pixels', 'max_width': 'wrap lines wider than this many pixels (default: 0, no wrapping)', 'weight': 'font weight 100-900 as in CSS (default: 400)', 'rotation_angle': 'rotation in degrees, counter-clockwise (default: 0)', 'line_spacing': 'line distance as a multiple of the line height (default: 1)', 'italic': 'truthy for italic text (default: false)', 'underline': 'truthy to underline the text (default: false)'}, 'aliases': []},
|
||||
'as_nested_tensor': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested_tensor(x)', 'forms': [['x']], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'params': {}, 'aliases': ['as_nested']},
|
||||
'as_nested': {'min_args': 1, 'max_args': 1, 'signature': 'as_nested(x)', 'forms': [['x']], 'description': 'converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)', 'details': '', 'params': {}, 'aliases': ['as_nested_tensor']},
|
||||
'svd': {'min_args': 1, 'max_args': 2, 'signature': 'svd(x, [full_matrices])', 'forms': [['x', '[full_matrices]']], 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)', 'details': '', 'params': {'full_matrices': 'truthy to return full-size U and Vh (default: false)'}, 'aliases': ['singular_value_decomposition']},
|
||||
'singular_value_decomposition': {'min_args': 1, 'max_args': 2, 'signature': 'singular_value_decomposition(x, [full_matrices])', 'forms': [['x', '[full_matrices]']], 'description': 'computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)', 'details': '', 'params': {'full_matrices': 'truthy to return full-size U and Vh (default: false)'}, 'aliases': ['svd']},
|
||||
'diagonal_matrix': {'min_args': 2, 'max_args': 5, 'signature': 'diagonal_matrix(x, shape, [offset], [dim1], [dim2])', 'forms': [['x', 'shape', '[offset]', '[dim1]', '[dim2]']], 'description': 'creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.', 'details': '', 'params': {'shape': 'shape of the result', 'offset': 'diagonal offset: positive above, negative below the main diagonal (default: 0)', 'dim1': 'first dimension of the matrix (default: -2)', 'dim2': 'second dimension of the matrix (default: -1)'}, 'aliases': ['diag']},
|
||||
'diag': {'min_args': 2, 'max_args': 5, 'signature': 'diag(x, shape, [offset], [dim1], [dim2])', 'forms': [['x', 'shape', '[offset]', '[dim1]', '[dim2]']], 'description': 'creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.', 'details': '', 'params': {'shape': 'shape of the result', 'offset': 'diagonal offset: positive above, negative below the main diagonal (default: 0)', 'dim1': 'first dimension of the matrix (default: -2)', 'dim2': 'second dimension of the matrix (default: -1)'}, 'aliases': ['diagonal_matrix']},
|
||||
'timestamp': {'min_args': 0, 'max_args': 0, 'signature': 'timestamp()', 'forms': [[]], 'description': 'returns the current system timestamp', 'details': '', 'params': {}, 'aliases': ['now']},
|
||||
'now': {'min_args': 0, 'max_args': 0, 'signature': 'now()', 'forms': [[]], 'description': 'returns the current system timestamp', 'details': '', 'params': {}, 'aliases': ['timestamp']},
|
||||
'sort': {'min_args': 1, 'max_args': 3, 'signature': 'sort(x, [descending], [dim])', 'forms': [['x', '[descending]', '[dim]']], 'description': 'returns x sorted ascending, or descending when descending is truthy. Tensors are sorted along dim (default: last dimension); lists use Python sorting', 'details': '', 'params': {'descending': 'truthy to sort from largest to smallest (default: false)', 'dim': 'dimension to sort along (default: last)'}, 'aliases': []},
|
||||
'argsort': {'min_args': 1, 'max_args': 3, 'signature': 'argsort(x, [descending], [dim])', 'forms': [['x', '[descending]', '[dim]']], 'description': 'returns the indices that would sort x. descending defaults to false and dim defaults to the last dimension.', 'details': '', 'params': {'descending': 'truthy to sort from largest to smallest (default: false)', 'dim': 'dimension to sort along (default: last)'}, 'aliases': []},
|
||||
'argmin': {'min_args': 1, 'max_args': 3, 'signature': 'argmin(x, [as_position], [dim])', 'forms': [['x', '[as_position]', '[dim]']], 'description': 'returns the minimum index globally or along dim; as_position returns global coordinates', 'details': '', 'params': {'as_position': 'truthy to return the coordinates of the minimum instead of a flat index', 'dim': 'dimension to search along; cannot be combined with as_position'}, 'aliases': []},
|
||||
'argmax': {'min_args': 1, 'max_args': 3, 'signature': 'argmax(x, [as_position], [dim])', 'forms': [['x', '[as_position]', '[dim]']], 'description': 'returns the maximum index globally or along dim; as_position returns global coordinates', 'details': '', 'params': {'as_position': 'truthy to return the coordinates of the maximum instead of a flat index', 'dim': 'dimension to search along; cannot be combined with as_position'}, 'aliases': []},
|
||||
'softmax': {'min_args': 1, 'max_args': 2, 'signature': 'softmax(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'applies the softmax function to x (each slice sums to 1.0). dim defaults to the last dimension.', 'details': '', 'params': {'dim': 'dimension whose slices sum to 1 (default: last)'}, 'aliases': []},
|
||||
'softmin': {'min_args': 1, 'max_args': 2, 'signature': 'softmin(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'applies the softmin function to x (same as softmax(-x, [dim])). dim defaults to the last dimension.', 'details': '', 'params': {'dim': 'dimension whose slices sum to 1 (default: last)'}, 'aliases': []},
|
||||
'unique': {'min_args': 1, 'max_args': 1, 'signature': 'unique(x)', 'forms': [['x']], 'description': 'returns the sorted unique elements of x (tensors are flattened first)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'flip': {'min_args': 2, 'max_args': 2, 'signature': 'flip(x, dims)', 'forms': [['x', 'dims']], 'description': 'reverses the order of elements along the specified dimensions. Text is reversed as a whole', 'details': '', 'params': {'dims': 'dimension or list of dimensions to reverse'}, 'aliases': []},
|
||||
'startswith': {'min_args': 2, 'max_args': 2, 'signature': 'startswith(text, prefix)', 'forms': [['text', 'prefix']], 'description': 'returns 1 if text starts with prefix, else 0', 'details': '', 'params': {}, 'aliases': []},
|
||||
'endswith': {'min_args': 2, 'max_args': 2, 'signature': 'endswith(text, suffix)', 'forms': [['text', 'suffix']], 'description': 'returns 1 if text ends with suffix, else 0', 'details': '', 'params': {}, 'aliases': []},
|
||||
'squeeze': {'min_args': 1, 'max_args': 2, 'signature': 'squeeze(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'removes size-1 dimensions from tensor x, optionally at dim', 'details': '', 'params': {'dim': 'only remove this dimension, if it has size 1'}, 'aliases': []},
|
||||
'unsqueeze': {'min_args': 2, 'max_args': 2, 'signature': 'unsqueeze(x, dim)', 'forms': [['x', 'dim']], 'description': 'inserts a size-1 dimension into tensor x at dim', 'details': '', 'params': {'dim': 'position of the new size-1 dimension'}, 'aliases': []},
|
||||
'roll': {'min_args': 2, 'max_args': 3, 'signature': 'roll(x, shifts, [dim])', 'forms': [['x', 'shifts', '[dim]']], 'description': 'circularly shifts tensor x along dim (default 0)', 'details': '', 'params': {'shifts': 'number of places to shift; elements pushed off one end come back at the other', 'dim': 'dimension to shift along (default: 0)'}, 'aliases': []},
|
||||
'cov': {'min_args': 2, 'max_args': 2, 'signature': 'cov(x, y)', 'forms': [['x', 'y']], 'description': 'computes the sample covariance of the flattened x and y (which must have the same number of elements)', 'details': '', 'params': {}, 'aliases': []},
|
||||
'corr': {'min_args': 2, 'max_args': 2, 'signature': 'corr(x, y)', 'forms': [['x', 'y']], 'description': 'computes the Pearson correlation coefficient between x and y', 'details': '', 'params': {}, 'aliases': ['correlation']},
|
||||
'correlation': {'min_args': 2, 'max_args': 2, 'signature': 'correlation(x, y)', 'forms': [['x', 'y']], 'description': 'computes the Pearson correlation coefficient between x and y', 'details': '', 'params': {}, 'aliases': ['corr']},
|
||||
'entropy': {'min_args': 1, 'max_args': 1, 'signature': 'entropy(x)', 'forms': [['x']], 'description': 'computes the Shannon entropy (in nats) of softmax(x), i.e. x is treated as logits over all of its elements', 'details': '', 'params': {}, 'aliases': []},
|
||||
'crop': {'min_args': 3, 'max_args': 3, 'signature': 'crop(x, start, size)', 'forms': [['x', 'start', 'size']], 'description': 'crops the region of x beginning at start (the low corner). The result always has shape size; parts outside x are zero-filled. On text, returns at most size characters', 'details': '', 'params': {'start': 'low corner of the region, one index per dimension', 'size': 'size of the result, one value per dimension'}, 'aliases': []},
|
||||
'coords': {'min_args': 2, 'max_args': 3, 'signature': 'coords(shape, dim, [dtype_template])', 'forms': [['shape', 'dim', '[dtype_template]']], 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).', 'details': '', 'params': {'shape': 'list of dimension sizes', 'dim': 'dimension whose index becomes the value', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, 'aliases': ['coordinates']},
|
||||
'coordinates': {'min_args': 2, 'max_args': 3, 'signature': 'coordinates(shape, dim, [dtype_template])', 'forms': [['shape', 'dim', '[dtype_template]']], 'description': 'generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).', 'details': '', 'params': {'shape': 'list of dimension sizes', 'dim': 'dimension whose index becomes the value', 'dtype_template': 'tensor whose dtype the result uses (default: float32)'}, 'aliases': ['coords']},
|
||||
'gather': {'min_args': 3, 'max_args': 3, 'signature': 'gather(x, dim, idx)', 'forms': [['x', 'dim', 'idx']], 'description': 'gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.', 'details': '', 'params': {'dim': 'dimension to gather along', 'idx': 'indices along dim; the result has the shape of idx'}, 'aliases': []},
|
||||
'scatter': {'min_args': 4, 'max_args': 4, 'signature': 'scatter(x, dim, idx, src)', 'forms': [['x', 'dim', 'idx', 'src']], 'description': 'scatters elements from src into x along dim using the indices specified in idx. The output tensor has the same shape as x.', 'details': '', 'params': {'dim': 'dimension to scatter along', 'idx': 'position along dim for each element of src', 'src': 'values to write'}, 'aliases': []},
|
||||
'scatter_add': {'min_args': 4, 'max_args': 4, 'signature': 'scatter_add(x, dim, idx, src)', 'forms': [['x', 'dim', 'idx', 'src']], 'description': 'scatters elements from src into x along dim using the indices specified in idx, adding to existing values. The output tensor has the same shape as x.', 'details': '', 'params': {'dim': 'dimension to scatter along', 'idx': 'position along dim for each element of src', 'src': 'values to add'}, 'aliases': []},
|
||||
'noise': {'min_args': 1, 'max_args': 2, 'signature': 'noise(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates normally distributed random noise', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randn', 'random_normal']},
|
||||
'randn': {'min_args': 1, 'max_args': 2, 'signature': 'randn(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates normally distributed random noise', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['noise', 'random_normal']},
|
||||
'random_normal': {'min_args': 1, 'max_args': 2, 'signature': 'random_normal(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates normally distributed random noise', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['noise', 'randn']},
|
||||
'pink_noise': {'min_args': 1, 'max_args': 2, 'signature': 'pink_noise(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic pink noise (approximately 1/f power spectrum) with zero mean and unit variance per row', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['pink']},
|
||||
'pink': {'min_args': 1, 'max_args': 2, 'signature': 'pink(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic pink noise (approximately 1/f power spectrum) with zero mean and unit variance per row', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['pink_noise']},
|
||||
'brown_noise': {'min_args': 1, 'max_args': 2, 'signature': 'brown_noise(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum) with zero mean and unit variance per row', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['brown']},
|
||||
'brown': {'min_args': 1, 'max_args': 2, 'signature': 'brown(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates deterministic brown noise (approximately 1/f^2 power spectrum) with zero mean and unit variance per row', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['brown_noise']},
|
||||
'rand': {'min_args': 1, 'max_args': 2, 'signature': 'rand(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates uniformly distributed random noise', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randu', 'random_uniform']},
|
||||
'randu': {'min_args': 1, 'max_args': 2, 'signature': 'randu(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates uniformly distributed random noise', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['rand', 'random_uniform']},
|
||||
'random_uniform': {'min_args': 1, 'max_args': 2, 'signature': 'random_uniform(seed, [shape])', 'forms': [['seed', '[shape]']], 'description': 'generates uniformly distributed random noise', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['rand', 'randu']},
|
||||
'randc': {'min_args': 3, 'max_args': 4, 'signature': 'randc(seed, median, sigma, [shape])', 'forms': [['seed', 'median', 'sigma', '[shape]']], 'description': 'generates Cauchy distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'median': 'centre of the distribution', 'sigma': 'half width at half maximum', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_cauchy']},
|
||||
'random_cauchy': {'min_args': 3, 'max_args': 4, 'signature': 'random_cauchy(seed, median, sigma, [shape])', 'forms': [['seed', 'median', 'sigma', '[shape]']], 'description': 'generates Cauchy distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'median': 'centre of the distribution', 'sigma': 'half width at half maximum', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randc']},
|
||||
'rande': {'min_args': 2, 'max_args': 3, 'signature': 'rande(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates exponentially distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'lambda': 'rate; the mean is 1 / lambda', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_exponential']},
|
||||
'random_exponential': {'min_args': 2, 'max_args': 3, 'signature': 'random_exponential(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates exponentially distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'lambda': 'rate; the mean is 1 / lambda', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['rande']},
|
||||
'randln': {'min_args': 3, 'max_args': 4, 'signature': 'randln(seed, mean, std, [shape])', 'forms': [['seed', 'mean', 'std', '[shape]']], 'description': 'generates log-normally distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'mean': 'mean of the underlying normal distribution', 'std': 'standard deviation of the underlying normal distribution', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_log_normal']},
|
||||
'random_log_normal': {'min_args': 3, 'max_args': 4, 'signature': 'random_log_normal(seed, mean, std, [shape])', 'forms': [['seed', 'mean', 'std', '[shape]']], 'description': 'generates log-normally distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'mean': 'mean of the underlying normal distribution', 'std': 'standard deviation of the underlying normal distribution', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randln']},
|
||||
'randb': {'min_args': 2, 'max_args': 3, 'signature': 'randb(seed, probability, [shape])', 'forms': [['seed', 'probability', '[shape]']], 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'probability': 'chance of a 1; a tensor gives one probability per element and sets the shape', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_bernoulli']},
|
||||
'random_bernoulli': {'min_args': 2, 'max_args': 3, 'signature': 'random_bernoulli(seed, probability, [shape])', 'forms': [['seed', 'probability', '[shape]']], 'description': 'generates Bernoulli distributed random values (0 or 1). Probability can be a tensor', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'probability': 'chance of a 1; a tensor gives one probability per element and sets the shape', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randb']},
|
||||
'randp': {'min_args': 2, 'max_args': 3, 'signature': 'randp(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates Poisson distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'lambda': 'expected count; a tensor gives one rate per element and sets the shape', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_poisson']},
|
||||
'random_poisson': {'min_args': 2, 'max_args': 3, 'signature': 'random_poisson(seed, lambda, [shape])', 'forms': [['seed', 'lambda', '[shape]']], 'description': 'generates Poisson distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'lambda': 'expected count; a tensor gives one rate per element and sets the shape', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randp']},
|
||||
'randg': {'min_args': 3, 'max_args': 4, 'signature': 'randg(seed, shape_param, scale, [shape])', 'forms': [['seed', 'shape_param', 'scale', '[shape]']], 'description': 'generates Gamma distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape_param': 'shape (concentration) k', 'scale': 'scale theta; the mean is k * theta', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_gamma']},
|
||||
'random_gamma': {'min_args': 3, 'max_args': 4, 'signature': 'random_gamma(seed, shape_param, scale, [shape])', 'forms': [['seed', 'shape_param', 'scale', '[shape]']], 'description': 'generates Gamma distributed random values.', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'shape_param': 'shape (concentration) k', 'scale': 'scale theta; the mean is k * theta', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randg']},
|
||||
'randbeta': {'min_args': 3, 'max_args': 4, 'signature': 'randbeta(seed, alpha, beta, [shape])', 'forms': [['seed', 'alpha', 'beta', '[shape]']], 'description': 'generates Beta distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'alpha': 'first concentration', 'beta': 'second concentration', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_beta']},
|
||||
'random_beta': {'min_args': 3, 'max_args': 4, 'signature': 'random_beta(seed, alpha, beta, [shape])', 'forms': [['seed', 'alpha', 'beta', '[shape]']], 'description': 'generates Beta distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'alpha': 'first concentration', 'beta': 'second concentration', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randbeta']},
|
||||
'randl': {'min_args': 3, 'max_args': 4, 'signature': 'randl(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Laplace distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'loc': 'centre of the distribution', 'scale': 'spread (diversity)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_laplace']},
|
||||
'random_laplace': {'min_args': 3, 'max_args': 4, 'signature': 'random_laplace(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Laplace distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'loc': 'centre of the distribution', 'scale': 'spread (diversity)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randl']},
|
||||
'randgumbel': {'min_args': 3, 'max_args': 4, 'signature': 'randgumbel(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Gumbel distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'loc': 'mode of the distribution', 'scale': 'spread', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_gumbel']},
|
||||
'random_gumbel': {'min_args': 3, 'max_args': 4, 'signature': 'random_gumbel(seed, loc, scale, [shape])', 'forms': [['seed', 'loc', 'scale', '[shape]']], 'description': 'generates Gumbel distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'loc': 'mode of the distribution', 'scale': 'spread', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randgumbel']},
|
||||
'randw': {'min_args': 3, 'max_args': 4, 'signature': 'randw(seed, scale, concentration, [shape])', 'forms': [['seed', 'scale', 'concentration', '[shape]']], 'description': 'generates Weibull distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'scale lambda', 'concentration': 'shape k', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_weibull']},
|
||||
'random_weibull': {'min_args': 3, 'max_args': 4, 'signature': 'random_weibull(seed, scale, concentration, [shape])', 'forms': [['seed', 'scale', 'concentration', '[shape]']], 'description': 'generates Weibull distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'scale lambda', 'concentration': 'shape k', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randw']},
|
||||
'randchi2': {'min_args': 2, 'max_args': 3, 'signature': 'randchi2(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Chi-squared distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'df': 'degrees of freedom', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_chi2']},
|
||||
'random_chi2': {'min_args': 2, 'max_args': 3, 'signature': 'random_chi2(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Chi-squared distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'df': 'degrees of freedom', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randchi2']},
|
||||
'randt': {'min_args': 2, 'max_args': 3, 'signature': 'randt(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Student-t distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'df': 'degrees of freedom', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['random_studentt']},
|
||||
'random_studentt': {'min_args': 2, 'max_args': 3, 'signature': 'random_studentt(seed, df, [shape])', 'forms': [['seed', 'df', '[shape]']], 'description': 'generates Student-t distributed random values', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'df': 'degrees of freedom', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['randt']},
|
||||
'perlin': {'min_args': 2, 'max_args': 5, 'signature': 'perlin(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Perlin gradient noise in 0-1 (default 1 octave)', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'feature size in elements; larger values give smoother noise', 'octaves': 'number of detail layers, each half the size of the previous (default: 1)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['perlin_noise']},
|
||||
'perlin_noise': {'min_args': 2, 'max_args': 5, 'signature': 'perlin_noise(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Perlin gradient noise in 0-1 (default 1 octave)', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'feature size in elements; larger values give smoother noise', 'octaves': 'number of detail layers, each half the size of the previous (default: 1)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['perlin']},
|
||||
'cellular': {'min_args': 2, 'max_args': 5, 'signature': 'cellular(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'cell size in elements', 'jitter': '0-1 randomness of the cell points (default: 0.5)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['voronoi', 'worley', 'cellular_noise', 'voronoi_noise']},
|
||||
'voronoi': {'min_args': 2, 'max_args': 5, 'signature': 'voronoi(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'cell size in elements', 'jitter': '0-1 randomness of the cell points (default: 0.5)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['cellular', 'worley', 'cellular_noise', 'voronoi_noise']},
|
||||
'worley': {'min_args': 2, 'max_args': 5, 'signature': 'worley(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'cell size in elements', 'jitter': '0-1 randomness of the cell points (default: 0.5)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['cellular', 'voronoi', 'cellular_noise', 'voronoi_noise']},
|
||||
'cellular_noise': {'min_args': 2, 'max_args': 5, 'signature': 'cellular_noise(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'cell size in elements', 'jitter': '0-1 randomness of the cell points (default: 0.5)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['cellular', 'voronoi', 'worley', 'voronoi_noise']},
|
||||
'voronoi_noise': {'min_args': 2, 'max_args': 5, 'signature': 'voronoi_noise(seed, scale, [jitter], [offset], [shape])', 'forms': [['seed', 'scale', '[jitter]', '[offset]', '[shape]']], 'description': 'generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'cell size in elements', 'jitter': '0-1 randomness of the cell points (default: 0.5)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['cellular', 'voronoi', 'worley', 'cellular_noise']},
|
||||
'plasma': {'min_args': 2, 'max_args': 5, 'signature': 'plasma(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'feature size in elements; larger values give smoother noise', 'octaves': 'number of detail layers, each half the size of the previous (default: 4)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['turbulence', 'plasma_noise']},
|
||||
'turbulence': {'min_args': 2, 'max_args': 5, 'signature': 'turbulence(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'feature size in elements; larger values give smoother noise', 'octaves': 'number of detail layers, each half the size of the previous (default: 4)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['plasma', 'plasma_noise']},
|
||||
'plasma_noise': {'min_args': 2, 'max_args': 5, 'signature': 'plasma_noise(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'feature size in elements; larger values give smoother noise', 'octaves': 'number of detail layers, each half the size of the previous (default: 4)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['plasma', 'turbulence']},
|
||||
'ridged': {'min_args': 2, 'max_args': 5, 'signature': 'ridged(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates ridged multi-fractal noise in 0-1 (default 4 octaves)', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'feature size in elements; larger values give smoother noise', 'octaves': 'number of detail layers, each half the size of the previous (default: 4)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['ridged_noise']},
|
||||
'ridged_noise': {'min_args': 2, 'max_args': 5, 'signature': 'ridged_noise(seed, scale, [octaves], [offset], [shape])', 'forms': [['seed', 'scale', '[octaves]', '[offset]', '[shape]']], 'description': 'generates ridged multi-fractal noise in 0-1 (default 4 octaves)', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'feature size in elements; larger values give smoother noise', 'octaves': 'number of detail layers, each half the size of the previous (default: 4)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['ridged']},
|
||||
'domain_warp': {'min_args': 4, 'max_args': 8, 'signature': 'domain_warp(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])', 'forms': [['seed', 'scale', 'warp_scale', 'warp_strength', '[octaves]', '[warp_octaves]', '[offset]', '[shape]']], 'description': 'generates domain warped Perlin noise in 0-1 (defaults: 4 octaves, 2 warp octaves)', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'feature size in elements; larger values give smoother noise', 'warp_scale': 'feature size of the warp field in elements', 'warp_strength': 'how far the warp field displaces the coordinates', 'octaves': 'detail layers of the base noise (default: 4)', 'warp_octaves': 'detail layers of the warp field (default: 2)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['domain_warp_noise']},
|
||||
'domain_warp_noise': {'min_args': 4, 'max_args': 8, 'signature': 'domain_warp_noise(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])', 'forms': [['seed', 'scale', 'warp_scale', 'warp_strength', '[octaves]', '[warp_octaves]', '[offset]', '[shape]']], 'description': 'generates domain warped Perlin noise in 0-1 (defaults: 4 octaves, 2 warp octaves)', 'details': '', 'params': {'seed': 'random seed; the same seed always gives the same values', 'scale': 'feature size in elements; larger values give smoother noise', 'warp_scale': 'feature size of the warp field in elements', 'warp_strength': 'how far the warp field displaces the coordinates', 'octaves': 'detail layers of the base noise (default: 4)', 'warp_octaves': 'detail layers of the warp field (default: 2)', 'offset': 'shift of the sampling grid, one value per dimension (default: 0)', 'shape': 'output shape as a list (default: the shape of the node\'s input)'}, 'aliases': ['domain_warp']},
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, onBeforeUnmount, nextTick, watch } from 'vue';
|
||||
import { app } from '/scripts/app.js';
|
||||
import { attachAutocomplete, escapeHtml, handleEditingKey, renderHighlight } from './autocomplete.js';
|
||||
|
||||
const modelValue = defineModel<string>({ default: '' });
|
||||
@@ -158,7 +159,7 @@ let autocompleteController: { destroy: () => void } | null = null;
|
||||
onMounted(() => {
|
||||
const textarea = textareaRef.value!;
|
||||
// Autocomplete first: its keydown handler must run before the editing keys.
|
||||
autocompleteController = attachAutocomplete(textarea);
|
||||
autocompleteController = attachAutocomplete(textarea, (id) => app.extensionManager?.setting?.get(id));
|
||||
textarea.addEventListener('keydown', onKeyDown);
|
||||
document.addEventListener('selectionchange', onSelectionChange);
|
||||
|
||||
|
||||
+50
-2
@@ -101,6 +101,22 @@ function ensureAutocompleteStyles() {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.mrmth-tt-param,
|
||||
.mrmth-sig-param {
|
||||
margin-top: 2px;
|
||||
color: #d5d9de;
|
||||
}
|
||||
|
||||
.mrmth-sig-param {
|
||||
padding-bottom: 4px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.mrmth-param-name {
|
||||
color: #ffd700;
|
||||
}
|
||||
|
||||
.mrmth-tt-details {
|
||||
margin-top: 4px;
|
||||
white-space: pre-wrap;
|
||||
@@ -555,15 +571,39 @@ function getCaretScreenPosition(textarea, position) {
|
||||
};
|
||||
}
|
||||
|
||||
export const SIGNATURE_HINTS_SETTING = "mrmth.ScriptEditor.SignatureHints";
|
||||
export const PARAMETER_DOCS_SETTING = "mrmth.ScriptEditor.ParameterDescriptions";
|
||||
|
||||
export const EDITOR_SETTINGS = [
|
||||
{
|
||||
id: SIGNATURE_HINTS_SETTING,
|
||||
category: ["More math", "Script editor", "Signature hints"],
|
||||
name: "Show signature hints",
|
||||
tooltip: "Show the function signature and description while typing its arguments.",
|
||||
type: "boolean",
|
||||
defaultValue: true,
|
||||
},
|
||||
{
|
||||
id: PARAMETER_DOCS_SETTING,
|
||||
category: ["More math", "Script editor", "Parameter descriptions"],
|
||||
name: "Show parameter descriptions",
|
||||
tooltip: "Describe the argument being typed in the signature hint, and list the arguments in the completion tooltip.",
|
||||
type: "boolean",
|
||||
defaultValue: true,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* Attach identifier autocomplete and built-in signature hints to a script
|
||||
* textarea. The popups are portaled to document.body. Must be attached before
|
||||
* other keydown handlers so they can skip keys it consumed (`defaultPrevented`).
|
||||
* @param {HTMLTextAreaElement} textarea
|
||||
* @param {(id: string) => unknown} [getSetting] - reads one of EDITOR_SETTINGS; features stay on unless it returns false
|
||||
* @returns {{ destroy: () => void, close: () => void }}
|
||||
*/
|
||||
export function attachAutocomplete(textarea) {
|
||||
export function attachAutocomplete(textarea, getSetting = () => undefined) {
|
||||
ensureAutocompleteStyles();
|
||||
const enabled = (id) => getSetting(id) !== false;
|
||||
|
||||
const layoutEl = document.createElement("div");
|
||||
layoutEl.className = "mrmth-autocomplete-layout";
|
||||
@@ -609,10 +649,13 @@ export function attachAutocomplete(textarea) {
|
||||
let argsText = `Arguments: min ${meta.minArgs}`;
|
||||
argsText += meta.maxArgs === null ? "+ (variadic)" : `, max ${meta.maxArgs}`;
|
||||
|
||||
const params = enabled(PARAMETER_DOCS_SETTING) ? Object.entries(meta.params) : [];
|
||||
|
||||
tooltipEl.innerHTML = `
|
||||
<div class="mrmth-tt-title">${escapeHtml(meta.signature)}</div>
|
||||
<div class="mrmth-tt-desc">${escapeHtml(meta.description)}</div>
|
||||
${meta.details ? `<div class="mrmth-tt-details">${escapeHtml(meta.details)}</div>` : ""}
|
||||
${params.map(([name, desc]) => `<div class="mrmth-tt-param"><span class="mrmth-param-name">${escapeHtml(name)}</span>: ${escapeHtml(desc)}</div>`).join("")}
|
||||
<div class="mrmth-tt-args">${argsText}</div>
|
||||
${meta.aliases.length ? `<div class="mrmth-tt-args">Also: ${escapeHtml(meta.aliases.join(", "))}</div>` : ""}
|
||||
`;
|
||||
@@ -801,7 +844,7 @@ export function attachAutocomplete(textarea) {
|
||||
|
||||
function updateHint() {
|
||||
const cursor = textarea.selectionStart;
|
||||
if (open || document.activeElement !== textarea || cursor !== textarea.selectionEnd) {
|
||||
if (open || !enabled(SIGNATURE_HINTS_SETTING) || document.activeElement !== textarea || cursor !== textarea.selectionEnd) {
|
||||
hideHint();
|
||||
return;
|
||||
}
|
||||
@@ -821,8 +864,13 @@ export function attachAutocomplete(textarea) {
|
||||
.map((a, i) => (i === active ? `<span class="mrmth-sig-active">${escapeHtml(a)}</span>` : escapeHtml(a)))
|
||||
.join(", ");
|
||||
|
||||
// Doc names drop the optional/variadic markup: "[dims]" and "[g" -> "dims", "g".
|
||||
const activeName = form[active]?.replace(/[[\].]/g, "").trim();
|
||||
const paramDesc = enabled(PARAMETER_DOCS_SETTING) ? meta.params[activeName] : undefined;
|
||||
|
||||
hintEl.innerHTML = `
|
||||
<div class="mrmth-sig-call">${escapeHtml(ctx.name)}(${args})</div>
|
||||
${paramDesc ? `<div class="mrmth-sig-param"><span class="mrmth-param-name">${escapeHtml(activeName)}</span>: ${escapeHtml(paramDesc)}</div>` : ""}
|
||||
${meta.description ? `<div class="mrmth-tt-desc">${escapeHtml(meta.description)}</div>` : ""}
|
||||
`;
|
||||
hintEl.hidden = false;
|
||||
|
||||
+322
-322
@@ -13,326 +13,326 @@ export const FUNCTIONS = new Set([
|
||||
]);
|
||||
|
||||
export const FUNCTION_META = {
|
||||
"sin": { minArgs: 1, maxArgs: 1, signature: "sin(x)", forms: [["x"]], description: "applies sine function to value or each element of value", details: "", aliases: [] },
|
||||
"cos": { minArgs: 1, maxArgs: 1, signature: "cos(x)", forms: [["x"]], description: "applies cosine function to value or each element of value", details: "", aliases: [] },
|
||||
"tan": { minArgs: 1, maxArgs: 1, signature: "tan(x)", forms: [["x"]], description: "applies tangent function to value or each element of value", details: "", aliases: [] },
|
||||
"asin": { minArgs: 1, maxArgs: 1, signature: "asin(x)", forms: [["x"]], description: "applies arcus sine function to value or each element of value", details: "", aliases: [] },
|
||||
"acos": { minArgs: 1, maxArgs: 1, signature: "acos(x)", forms: [["x"]], description: "applies arcus cosine function to value or each element of value", details: "", aliases: [] },
|
||||
"atan": { minArgs: 1, maxArgs: 1, signature: "atan(x)", forms: [["x"]], description: "applies arcus tangent function to value or each element of value", details: "", aliases: [] },
|
||||
"atan2": { minArgs: 2, maxArgs: 2, signature: "atan2(y, x)", forms: [["y", "x"]], description: "computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant", details: "", aliases: [] },
|
||||
"sinh": { minArgs: 1, maxArgs: 1, signature: "sinh(x)", forms: [["x"]], description: "applies hyperbolic sine function to value or each element of value", details: "", aliases: [] },
|
||||
"cosh": { minArgs: 1, maxArgs: 1, signature: "cosh(x)", forms: [["x"]], description: "applies hyperbolic cosine function to value or each element of value", details: "", aliases: [] },
|
||||
"tanh": { minArgs: 1, maxArgs: 1, signature: "tanh(x)", forms: [["x"]], description: "applies hyperbolic tangent function to value or each element of value", details: "", aliases: [] },
|
||||
"asinh": { minArgs: 1, maxArgs: 1, signature: "asinh(x)", forms: [["x"]], description: "applies hyperbolic arcus sine function to value or each element of value", details: "", aliases: [] },
|
||||
"acosh": { minArgs: 1, maxArgs: 1, signature: "acosh(x)", forms: [["x"]], description: "applies hyperbolic arcus cosine function to value or each element of value", details: "", aliases: [] },
|
||||
"atanh": { minArgs: 1, maxArgs: 1, signature: "atanh(x)", forms: [["x"]], description: "applies hyperbolic arcus tangent function to value or each element of value", details: "", aliases: [] },
|
||||
"abs": { minArgs: 1, maxArgs: 1, signature: "abs(x)", forms: [["x"]], description: "applies per element absolute value function. Same as |x| for numbers.", details: "", aliases: [] },
|
||||
"sqrt": { minArgs: 1, maxArgs: 1, signature: "sqrt(x)", forms: [["x"]], description: "applies square root per element. Negative numbers return NaN (not a number)", details: "", aliases: [] },
|
||||
"ln": { minArgs: 1, maxArgs: 1, signature: "ln(x)", forms: [["x"]], description: "applies natural logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] },
|
||||
"log": { minArgs: 1, maxArgs: 1, signature: "log(x)", forms: [["x"]], description: "applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] },
|
||||
"log2": { minArgs: 1, maxArgs: 1, signature: "log2(x)", forms: [["x"]], description: "applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", aliases: [] },
|
||||
"exp": { minArgs: 1, maxArgs: 1, signature: "exp(x)", forms: [["x"]], description: "applies e^x to value (per element)", details: "", aliases: [] },
|
||||
"log1p": { minArgs: 1, maxArgs: 1, signature: "log1p(x)", forms: [["x"]], description: "applies ln(1+x) accurately for values near zero", details: "", aliases: [] },
|
||||
"expm1": { minArgs: 1, maxArgs: 1, signature: "expm1(x)", forms: [["x"]], description: "applies exp(x)-1 accurately for values near zero", details: "", aliases: [] },
|
||||
"sinc": { minArgs: 1, maxArgs: 1, signature: "sinc(x)", forms: [["x"]], description: "computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1", details: "", aliases: [] },
|
||||
"cbrt": { minArgs: 1, maxArgs: 1, signature: "cbrt(x)", forms: [["x"]], description: "computes the real cube root of each value, including negative values", details: "", aliases: [] },
|
||||
"reciprocal": { minArgs: 1, maxArgs: 1, signature: "reciprocal(x)", forms: [["x"]], description: "computes 1/x element-wise", details: "", aliases: [] },
|
||||
"logaddexp": { minArgs: 2, maxArgs: 2, signature: "logaddexp(x, y)", forms: [["x", "y"]], description: "computes log(exp(x) + exp(y)) element-wise using a numerically stable method", details: "", aliases: [] },
|
||||
"logsumexp": { minArgs: 1, maxArgs: 2, signature: "logsumexp(x, [dims])", forms: [["x", "[dims]"]], description: "computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions", details: "", aliases: [] },
|
||||
"norm": { minArgs: 1, maxArgs: 3, signature: "norm(x, [p], [dims])", forms: [["x", "[p]", "[dims]"]], description: "computes the p-norm globally or along one or more dimensions (default p=2)", details: "", aliases: [] },
|
||||
"normalize": { minArgs: 1, maxArgs: 4, signature: "normalize(x, [p], [dim], [eps])", forms: [["x", "[p]", "[dim]", "[eps]"]], description: "normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)", details: "", aliases: [] },
|
||||
"group_norm": { minArgs: 2, maxArgs: 5, signature: "group_norm(x, groups, [weight], [bias], [eps])", forms: [["x", "groups", "[weight]", "[bias]", "[eps]"]], description: "applies channel-first GroupNorm to [N, C, ...] input", details: "", aliases: [] },
|
||||
"outer": { minArgs: 2, maxArgs: 2, signature: "outer(x, y)", forms: [["x", "y"]], description: "computes the outer product of flattened x and y", details: "", aliases: [] },
|
||||
"trace": { minArgs: 1, maxArgs: 1, signature: "trace(x)", forms: [["x"]], description: "sums the main diagonal of each square matrix in x", details: "", aliases: [] },
|
||||
"det": { minArgs: 1, maxArgs: 1, signature: "det(x)", forms: [["x"]], description: "computes the determinant of each square matrix in x", details: "", aliases: [] },
|
||||
"rfft": { minArgs: 1, maxArgs: 2, signature: "rfft(x, [dim])", forms: [["x", "[dim]"]], description: "computes the one-dimensional real-input FFT along dim (default: last dimension)", details: "", aliases: [] },
|
||||
"irfft": { minArgs: 1, maxArgs: 3, signature: "irfft(x, [n], [dim])", forms: [["x", "[n]", "[dim]"]], description: "computes the inverse one-dimensional real FFT along dim (default: last dimension)", details: "", aliases: [] },
|
||||
"isnan": { minArgs: 1, maxArgs: 1, signature: "isnan(x)", forms: [["x"]], description: "returns 1.0 for NaN values and 0.0 otherwise", details: "", aliases: [] },
|
||||
"isinf": { minArgs: 1, maxArgs: 1, signature: "isinf(x)", forms: [["x"]], description: "returns 1.0 for infinite values and 0.0 otherwise", details: "", aliases: [] },
|
||||
"isfinite": { minArgs: 1, maxArgs: 1, signature: "isfinite(x)", forms: [["x"]], description: "returns 1.0 for finite values and 0.0 otherwise", details: "", aliases: [] },
|
||||
"smin": { minArgs: 1, maxArgs: null, signature: "smin(x, ...)", forms: [["x", "..."]], description: "computes the minimum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smin(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.", details: "", aliases: [] },
|
||||
"smax": { minArgs: 1, maxArgs: null, signature: "smax(x, ...)", forms: [["x", "..."]], description: "computes the maximum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smax(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.", details: "", aliases: [] },
|
||||
"tmin": { minArgs: 2, maxArgs: 2, signature: "tmin(x, y)", forms: [["x", "y"]], description: "elementwise minimum of tensor or list. min(x,y) when inputs are floats", details: "", aliases: [] },
|
||||
"tmax": { minArgs: 2, maxArgs: 2, signature: "tmax(x,y)", forms: [["x", "y"]], description: "elementwise maximum of tensor or list. max(x,y) when inputs are floats", details: "", aliases: [] },
|
||||
"tnorm": { minArgs: 1, maxArgs: 2, signature: "tnorm(x, [dim])", forms: [["x", "[dim]"]], description: "normalises tensor or list by multiplication such that sum(x^2)==1.0 for each slice. Defaults to the last dimension; dim selects a different slicing dimension.", details: "", aliases: [] },
|
||||
"snorm": { minArgs: 1, maxArgs: 2, signature: "snorm(x,[dim])", forms: [["x", "[dim]"]], description: "frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.", details: "", aliases: [] },
|
||||
"floor": { minArgs: 1, maxArgs: 1, signature: "floor(x)", forms: [["x"]], description: "returns the largest integer less than or equal to x", details: "", aliases: [] },
|
||||
"ceil": { minArgs: 1, maxArgs: 1, signature: "ceil(x)", forms: [["x"]], description: "returns the smallest integer greater than or equal to x", details: "", aliases: [] },
|
||||
"round": { minArgs: 1, maxArgs: 1, signature: "round(x)", forms: [["x"]], description: "rounds x to the nearest integer", details: "", aliases: [] },
|
||||
"gamma": { minArgs: 1, maxArgs: 1, signature: "gamma(x)", forms: [["x"]], description: "computes the gamma function (per element)", details: "", aliases: [] },
|
||||
"pow": { minArgs: 2, maxArgs: 2, signature: "pow(x, y)", forms: [["x", "y"]], description: "computes x raised to the power of y", details: "", aliases: [] },
|
||||
"sigm": { minArgs: 1, maxArgs: 1, signature: "sigm(x)", forms: [["x"]], description: "applies the sigmoid function: 1 / (1 + exp(-x))", details: "", aliases: [] },
|
||||
"clamp": { minArgs: 3, maxArgs: 3, signature: "clamp(x, min, max)", forms: [["x", "min", "max"]], description: "clamps x between min and max per element", details: "", aliases: [] },
|
||||
"fft": { minArgs: 1, maxArgs: 1, signature: "fft(x)", forms: [["x"]], description: "computes fast Fourier transform of x", details: "", aliases: [] },
|
||||
"ifft": { minArgs: 1, maxArgs: 2, signature: "ifft(x, [shape])", forms: [["x", "[shape]"]], description: "inverse fast Fourier transform of x. shape (defaults to the node's tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.", details: "", aliases: [] },
|
||||
"angle": { minArgs: 1, maxArgs: 1, signature: "angle(x)", forms: [["x"]], description: "returns the angle of a complex number or vector", details: "", aliases: [] },
|
||||
"print": { minArgs: 1, maxArgs: 1, signature: "print(x)", forms: [["x"]], description: "prints the value of x to the console while passing output unchanged", details: "", aliases: [] },
|
||||
"print_shape": { minArgs: 1, maxArgs: 1, signature: "print_shape(x)", forms: [["x"]], description: "prints the shape of the tensor x", details: "", aliases: ["pshp"] },
|
||||
"pshp": { minArgs: 1, maxArgs: 1, signature: "pshp(x)", forms: [["x"]], description: "prints the shape of the tensor x", details: "", aliases: ["print_shape"] },
|
||||
"nvl": { minArgs: 4, maxArgs: 4, signature: "nvl(x, nan, pos_inf, neg_inf)", forms: [["x", "nan", "pos_inf", "neg_inf"]], description: "replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)", details: "", aliases: ["nan_to_num"] },
|
||||
"nan_to_num": { minArgs: 4, maxArgs: 4, signature: "nan_to_num(x, nan, pos_inf, neg_inf)", forms: [["x", "nan", "pos_inf", "neg_inf"]], description: "replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)", details: "", aliases: ["nvl"] },
|
||||
"lerp": { minArgs: 3, maxArgs: 3, signature: "lerp(a, b, t)", forms: [["a", "b", "t"]], description: "linear interpolation between a and b by t per element. t can be float or tensor.", details: "", aliases: [] },
|
||||
"slerp": { minArgs: 3, maxArgs: 4, signature: "slerp(a, b, t, [dim])", forms: [["a", "b", "t", "[dim]"]], description: "interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.", details: "", aliases: [] },
|
||||
"step": { minArgs: 2, maxArgs: 2, signature: "step(x, edge)", forms: [["x", "edge"]], description: "returns 0 if x < edge, else 1", details: "", aliases: [] },
|
||||
"smoothstep": { minArgs: 3, maxArgs: 3, signature: "smoothstep(x, edge0, edge1)", forms: [["x", "edge0", "edge1"]], description: "smooth interpolation between edge0 and edge1", details: "", aliases: [] },
|
||||
"fract": { minArgs: 1, maxArgs: 1, signature: "fract(x)", forms: [["x"]], description: "returns the fractional part of x: x - floor(x)", details: "", aliases: [] },
|
||||
"relu": { minArgs: 1, maxArgs: 1, signature: "relu(x)", forms: [["x"]], description: "applies rectified linear unit function: max(0, x)", details: "", aliases: [] },
|
||||
"softsign": { minArgs: 1, maxArgs: 1, signature: "softsign(x)", forms: [["x"]], description: "applies x / (1 + abs(x)) element-wise", details: "", aliases: [] },
|
||||
"leaky_relu": { minArgs: 1, maxArgs: 2, signature: "leaky_relu(x, [negative_slope])", forms: [["x", "[negative_slope]"]], description: "applies leaky ReLU element-wise; negative_slope defaults to 0.01", details: "", aliases: [] },
|
||||
"softplus": { minArgs: 1, maxArgs: 1, signature: "softplus(x)", forms: [["x"]], description: "applies the softplus function: ln(1 + exp(x))", details: "", aliases: [] },
|
||||
"gelu": { minArgs: 1, maxArgs: 1, signature: "gelu(x)", forms: [["x"]], description: "applies the Gaussian Error Linear Unit (GELU) activation function", details: "", aliases: [] },
|
||||
"silu": { minArgs: 1, maxArgs: 1, signature: "silu(x)", forms: [["x"]], description: "applies the Sigmoid Linear Unit activation element-wise", details: "", aliases: [] },
|
||||
"sign": { minArgs: 1, maxArgs: 1, signature: "sign(x)", forms: [["x"]], description: "returns the sign of x: -1, 0, or 1", details: "", aliases: [] },
|
||||
"degrees": { minArgs: 1, maxArgs: 1, signature: "degrees(x)", forms: [["x"]], description: "converts radians to degrees (per element)", details: "", aliases: [] },
|
||||
"radians": { minArgs: 1, maxArgs: 1, signature: "radians(x)", forms: [["x"]], description: "converts degrees to radians (per element)", details: "", aliases: [] },
|
||||
"logical_not": { minArgs: 1, maxArgs: 1, signature: "logical_not(x)", forms: [["x"]], description: "returns 1.0 where x is zero and 0.0 otherwise", details: "", aliases: [] },
|
||||
"logical_and": { minArgs: 2, maxArgs: 2, signature: "logical_and(x, y)", forms: [["x", "y"]], description: "returns 1.0 if both values are non-zero, else 0.0", details: "", aliases: [] },
|
||||
"logical_or": { minArgs: 2, maxArgs: 2, signature: "logical_or(x, y)", forms: [["x", "y"]], description: "returns 1.0 if either value is non-zero, else 0.0", details: "", aliases: [] },
|
||||
"hypot": { minArgs: 2, maxArgs: 2, signature: "hypot(x, y)", forms: [["x", "y"]], description: "computes the element-wise Euclidean distance from the origin", details: "", aliases: [] },
|
||||
"map": { minArgs: 2, maxArgs: 4, signature: "map(tensor, coord1, [coord2], [coord3])", forms: [["tensor", "coord1", "[coord2]", "[coord3]"]], description: "samples/remaps input tensor using coordinates", details: "", aliases: [] },
|
||||
"ezconvolution": { minArgs: 3, maxArgs: 5, signature: "ezconvolution(tensor, size_x, kernel) / ezconvolution(tensor, size_x, size_y, kernel) / ezconvolution(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", aliases: ["ezconv"] },
|
||||
"ezconv": { minArgs: 3, maxArgs: 5, signature: "ezconv(tensor, size_x, kernel) / ezconv(tensor, size_x, size_y, kernel) / ezconv(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", aliases: ["ezconvolution"] },
|
||||
"convolution": { minArgs: 3, maxArgs: 5, signature: "convolution(tensor, size_x, kernel) / convolution(tensor, size_x, size_y, kernel) / convolution(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", aliases: ["conv"] },
|
||||
"conv": { minArgs: 3, maxArgs: 5, signature: "conv(tensor, size_x, kernel) / conv(tensor, size_x, size_y, kernel) / conv(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", aliases: ["convolution"] },
|
||||
"swap": { minArgs: 4, maxArgs: 4, signature: "swap(x, dim, idx1, idx2)", forms: [["x", "dim", "idx1", "idx2"]], description: "swaps elements along dim between idx1 and idx2", details: "", aliases: [] },
|
||||
"transpose": { minArgs: 3, maxArgs: 3, signature: "transpose(x, dim0, dim1) / transpose(x, dim0, dim1)", forms: [["x", "dim0", "dim1"], ["x", "dim0", "dim1"]], description: "swaps two tensor dimensions", details: "", aliases: ["swapaxes"] },
|
||||
"swapaxes": { minArgs: 3, maxArgs: 3, signature: "swapaxes(x, dim0, dim1) / swapaxes(x, dim0, dim1)", forms: [["x", "dim0", "dim1"], ["x", "dim0", "dim1"]], description: "swaps two tensor dimensions", details: "", aliases: ["transpose"] },
|
||||
"permute": { minArgs: 2, maxArgs: 2, signature: "permute(x, dims)", forms: [["x", "dims"]], description: "permutes the dimensions of tensor x according to dims", details: "", aliases: ["perm"] },
|
||||
"perm": { minArgs: 2, maxArgs: 2, signature: "perm(x, dims)", forms: [["x", "dims"]], description: "permutes the dimensions of tensor x according to dims", details: "", aliases: ["permute"] },
|
||||
"reshape": { minArgs: 2, maxArgs: 2, signature: "reshape(x, shape)", forms: [["x", "shape"]], description: "reshapes tensor x to the specified shape", details: "", aliases: ["rshp"] },
|
||||
"rshp": { minArgs: 2, maxArgs: 2, signature: "rshp(x, shape)", forms: [["x", "shape"]], description: "reshapes tensor x to the specified shape", details: "", aliases: ["reshape"] },
|
||||
"range": { minArgs: 3, maxArgs: 3, signature: "range(start, stop, step)", forms: [["start", "stop", "step"]], description: "creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.", details: "", aliases: [] },
|
||||
"linspace": { minArgs: 3, maxArgs: 3, signature: "linspace(start, stop, num)", forms: [["start", "stop", "num"]], description: "creates num linearly spaced values from start to stop (inclusive). Use range if you want to control the step between values.", details: "", aliases: [] },
|
||||
"logspace": { minArgs: 4, maxArgs: 4, signature: "logspace(start, stop, num, base)", forms: [["start", "stop", "num", "base"]], description: "creates logarithmically spaced values", details: "", aliases: [] },
|
||||
"topk": { minArgs: 2, maxArgs: 3, signature: "topk(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.", details: "", aliases: [] },
|
||||
"botk": { minArgs: 2, maxArgs: 3, signature: "botk(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.", details: "", aliases: [] },
|
||||
"pinv": { minArgs: 1, maxArgs: 1, signature: "pinv(x)", forms: [["x"]], description: "computes the inverse permutation of x: where x[i] == j the result has result[j] == i. Not the matrix pseudoinverse; use inv(x, 1) for that", details: "", aliases: [] },
|
||||
"inv": { minArgs: 1, maxArgs: 2, signature: "inv(x, [pseudo])", forms: [["x", "[pseudo]"]], description: "computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead", details: "", aliases: [] },
|
||||
"sum": { minArgs: 1, maxArgs: 2, signature: "sum(x, [dims])", forms: [["x", "[dims]"]], description: "computes the sum of elements of x, optionally along one or more dimensions", details: "", aliases: [] },
|
||||
"mean": { minArgs: 1, maxArgs: 2, signature: "mean(x, [dims])", forms: [["x", "[dims]"]], description: "computes the arithmetic mean of elements of x globally or along one or more dimensions", details: "", aliases: [] },
|
||||
"std": { minArgs: 1, maxArgs: 2, signature: "std(x, [dims])", forms: [["x", "[dims]"]], description: "computes the sample standard deviation of elements of x globally or along one or more dimensions", details: "", aliases: [] },
|
||||
"var": { minArgs: 1, maxArgs: 2, signature: "var(x, [dims])", forms: [["x", "[dims]"]], description: "computes the sample variance of elements of x globally or along one or more dimensions", details: "", aliases: [] },
|
||||
"prod": { minArgs: 1, maxArgs: 2, signature: "prod(x, [dims])", forms: [["x", "[dims]"]], description: "computes the product of elements of x globally or along one or more dimensions", details: "", aliases: [] },
|
||||
"isclose": { minArgs: 2, maxArgs: 4, signature: "isclose(a, b, [rtol], [atol])", forms: [["a", "b", "[rtol]", "[atol]"]], description: "elementwise approximate equality test", details: "", aliases: [] },
|
||||
"allclose": { minArgs: 2, maxArgs: 4, signature: "allclose(a, b, [rtol], [atol])", forms: [["a", "b", "[rtol]", "[atol]"]], description: "returns 1.0 if all elements are approximately equal, else 0.0", details: "", aliases: [] },
|
||||
"quartile": { minArgs: 2, maxArgs: 3, signature: "quartile(x, q, [dim])", forms: [["x", "q", "[dim]"]], description: "computes the q-th quartile globally or along dim", details: "", aliases: ["quartil"] },
|
||||
"quartil": { minArgs: 2, maxArgs: 3, signature: "quartil(x, q, [dim])", forms: [["x", "q", "[dim]"]], description: "computes the q-th quartile globally or along dim", details: "", aliases: ["quartile"] },
|
||||
"percentile": { minArgs: 2, maxArgs: 3, signature: "percentile(x, p, [dim])", forms: [["x", "p", "[dim]"]], description: "computes the p-th percentile globally or along dim", details: "", aliases: ["prcnt"] },
|
||||
"prcnt": { minArgs: 2, maxArgs: 3, signature: "prcnt(x, p, [dim])", forms: [["x", "p", "[dim]"]], description: "computes the p-th percentile globally or along dim", details: "", aliases: ["percentile"] },
|
||||
"quantile": { minArgs: 2, maxArgs: 3, signature: "quantile(x, q, [dim])", forms: [["x", "q", "[dim]"]], description: "computes the q-th quantile globally or along dim", details: "", aliases: [] },
|
||||
"dot": { minArgs: 2, maxArgs: 2, signature: "dot(x, y)", forms: [["x", "y"]], description: "computes the dot product of x and y after flattening both to 1D. Use cross(x, y) if you need a per-vector product with the last dimension kept.", details: "", aliases: [] },
|
||||
"moment": { minArgs: 3, maxArgs: 3, signature: "moment(x, a, k)", forms: [["x", "a", "k"]], description: "computes the k-th moment of x around a", details: "", aliases: [] },
|
||||
"erf": { minArgs: 1, maxArgs: 1, signature: "erf(x)", forms: [["x"]], description: "computes the error function (torch.erf)", details: "", aliases: [] },
|
||||
"erfc": { minArgs: 1, maxArgs: 1, signature: "erfc(x)", forms: [["x"]], description: "computes the complementary error function (torch.special.erfc)", details: "", aliases: [] },
|
||||
"erfinv": { minArgs: 1, maxArgs: 1, signature: "erfinv(x)", forms: [["x"]], description: "computes the inverse error function (torch.erfinv)", details: "", aliases: [] },
|
||||
"any": { minArgs: 1, maxArgs: 1, signature: "any(x)", forms: [["x"]], description: "returns 1 if any element of x is non-zero otherwise 0", details: "", aliases: [] },
|
||||
"all": { minArgs: 1, maxArgs: 1, signature: "all(x)", forms: [["x"]], description: "returns 1 if all elements of x are non-zero otherwise 0", details: "", aliases: [] },
|
||||
"edge": { minArgs: 1, maxArgs: 2, signature: "edge(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "detects edges in x with a Sobel filter. kernel_size must be odd and at least 3 (default 3).", details: "", aliases: [] },
|
||||
"blur": { minArgs: 2, maxArgs: 3, signature: "blur(x, sigma, [reshape])", forms: [["x", "sigma", "[reshape]"]], description: "applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.", details: "", aliases: ["gaussian"] },
|
||||
"gaussian": { minArgs: 2, maxArgs: 3, signature: "gaussian(x, sigma, [reshape])", forms: [["x", "sigma", "[reshape]"]], description: "applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.", details: "", aliases: ["blur"] },
|
||||
"median": { minArgs: 1, maxArgs: 2, signature: "median(x, [dim])", forms: [["x", "[dim]"]], description: "computes the median globally or along one dimension", details: "", aliases: [] },
|
||||
"mode": { minArgs: 1, maxArgs: 2, signature: "mode(x, [dim])", forms: [["x", "[dim]"]], description: "computes the mode globally or along one dimension", details: "", aliases: [] },
|
||||
"cumsum": { minArgs: 1, maxArgs: 2, signature: "cumsum(x, [dim])", forms: [["x", "[dim]"]], description: "computes the cumulative sum, defaulting to the first dimension.", details: "", aliases: [] },
|
||||
"cumprod": { minArgs: 1, maxArgs: 1, signature: "cumprod(x)", forms: [["x"]], description: "computes the cumulative product over first dimension.", details: "", aliases: [] },
|
||||
"topk_ind": { minArgs: 2, maxArgs: 3, signature: "topk_ind(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)", details: "", aliases: ["topk_indices"] },
|
||||
"topk_indices": { minArgs: 2, maxArgs: 3, signature: "topk_indices(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)", details: "", aliases: ["topk_ind"] },
|
||||
"botk_ind": { minArgs: 2, maxArgs: 3, signature: "botk_ind(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)", details: "", aliases: ["botk_indices"] },
|
||||
"botk_indices": { minArgs: 2, maxArgs: 3, signature: "botk_indices(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)", details: "", aliases: ["botk_ind"] },
|
||||
"cubic_ease": { minArgs: 3, maxArgs: 3, signature: "cubic_ease(a, b, t)", forms: [["a", "b", "t"]], description: "cubic ease between a and b", details: "", aliases: ["cubic"] },
|
||||
"cubic": { minArgs: 3, maxArgs: 3, signature: "cubic(a, b, t)", forms: [["a", "b", "t"]], description: "cubic ease between a and b", details: "", aliases: ["cubic_ease"] },
|
||||
"elastic_ease": { minArgs: 3, maxArgs: 3, signature: "elastic_ease(a, b, t)", forms: [["a", "b", "t"]], description: "elastic ease between a and b", details: "", aliases: ["elastic"] },
|
||||
"elastic": { minArgs: 3, maxArgs: 3, signature: "elastic(a, b, t)", forms: [["a", "b", "t"]], description: "elastic ease between a and b", details: "", aliases: ["elastic_ease"] },
|
||||
"sine_ease": { minArgs: 3, maxArgs: 3, signature: "sine_ease(a, b, t)", forms: [["a", "b", "t"]], description: "sine easing between a and b", details: "", aliases: ["sine"] },
|
||||
"sine": { minArgs: 3, maxArgs: 3, signature: "sine(a, b, t)", forms: [["a", "b", "t"]], description: "sine easing between a and b", details: "", aliases: ["sine_ease"] },
|
||||
"smootherstep": { minArgs: 3, maxArgs: 3, signature: "smootherstep(x, edge0, edge1)", forms: [["x", "edge0", "edge1"]], description: "smoother interpolation between edge0 and edge1", details: "", aliases: [] },
|
||||
"dist": { minArgs: 4, maxArgs: 4, signature: "dist(x1, y1, x2, y2)", forms: [["x1", "y1", "x2", "y2"]], description: "computes Euclidean distance between (x1, y1) and (x2, y2)", details: "", aliases: ["distance"] },
|
||||
"distance": { minArgs: 4, maxArgs: 4, signature: "distance(x1, y1, x2, y2)", forms: [["x1", "y1", "x2", "y2"]], description: "computes Euclidean distance between (x1, y1) and (x2, y2)", details: "", aliases: ["dist"] },
|
||||
"remap": { minArgs: 5, maxArgs: 5, signature: "remap(v, i_min, i_max, o_min, o_max)", forms: [["v", "i_min", "i_max", "o_min", "o_max"]], description: "remaps values from input range to output range", details: "", aliases: [] },
|
||||
"cossim": { minArgs: 2, maxArgs: 2, signature: "cossim(x, y)", forms: [["x", "y"]], description: "computes the cosine similarity between x and y.", details: "", aliases: ["cosine_similarity"] },
|
||||
"cosine_similarity": { minArgs: 2, maxArgs: 2, signature: "cosine_similarity(x, y)", forms: [["x", "y"]], description: "computes the cosine similarity between x and y.", details: "", aliases: ["cossim"] },
|
||||
"count": { minArgs: 1, maxArgs: 1, signature: "count(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", aliases: ["cnt", "length"] },
|
||||
"cnt": { minArgs: 1, maxArgs: 1, signature: "cnt(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", aliases: ["count", "length"] },
|
||||
"length": { minArgs: 1, maxArgs: 1, signature: "length(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", aliases: ["count", "cnt"] },
|
||||
"keys": { minArgs: 1, maxArgs: 1, signature: "keys(x)", forms: [["x"]], description: "returns a list of dictionary keys in insertion order", details: "", aliases: [] },
|
||||
"enable_tracking": { minArgs: 1, maxArgs: 1, signature: "enable_tracking(d)", forms: [["d"]], description: "enables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_on"] },
|
||||
"track_on": { minArgs: 1, maxArgs: 1, signature: "track_on(d)", forms: [["d"]], description: "enables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["enable_tracking"] },
|
||||
"disable_tracking": { minArgs: 1, maxArgs: 1, signature: "disable_tracking(d)", forms: [["d"]], description: "disables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_off"] },
|
||||
"track_off": { minArgs: 1, maxArgs: 1, signature: "track_off(d)", forms: [["d"]], description: "disables change tracking for ChangeTrackingDict d (returns d)", details: "", aliases: ["disable_tracking"] },
|
||||
"reset_tracking": { minArgs: 1, maxArgs: 1, signature: "reset_tracking(d)", forms: [["d"]], description: "resets change tracking state for ChangeTrackingDict d (returns d)", details: "", aliases: ["track_reset"] },
|
||||
"track_reset": { minArgs: 1, maxArgs: 1, signature: "track_reset(d)", forms: [["d"]], description: "resets change tracking state for ChangeTrackingDict d (returns d)", details: "", aliases: ["reset_tracking"] },
|
||||
"get_changed_keys": { minArgs: 1, maxArgs: 1, signature: "get_changed_keys(d)", forms: [["d"]], description: "returns list of keys that were modified or added in ChangeTrackingDict d", details: "", aliases: ["changed_keys"] },
|
||||
"changed_keys": { minArgs: 1, maxArgs: 1, signature: "changed_keys(d)", forms: [["d"]], description: "returns list of keys that were modified or added in ChangeTrackingDict d", details: "", aliases: ["get_changed_keys"] },
|
||||
"get_added_keys": { minArgs: 1, maxArgs: 1, signature: "get_added_keys(d)", forms: [["d"]], description: "returns list of keys that were added (newly created) in ChangeTrackingDict d", details: "", aliases: ["added_keys"] },
|
||||
"added_keys": { minArgs: 1, maxArgs: 1, signature: "added_keys(d)", forms: [["d"]], description: "returns list of keys that were added (newly created) in ChangeTrackingDict d", details: "", aliases: ["get_added_keys"] },
|
||||
"get_removed_keys": { minArgs: 1, maxArgs: 1, signature: "get_removed_keys(d)", forms: [["d"]], description: "returns list of keys that were removed from ChangeTrackingDict d", details: "", aliases: ["removed_keys"] },
|
||||
"removed_keys": { minArgs: 1, maxArgs: 1, signature: "removed_keys(d)", forms: [["d"]], description: "returns list of keys that were removed from ChangeTrackingDict d", details: "", aliases: ["get_removed_keys"] },
|
||||
"get_unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "get_unchanged_keys(d)", forms: [["d"]], description: "returns list of keys that remain unchanged in ChangeTrackingDict d", details: "", aliases: ["unchanged_keys"] },
|
||||
"unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "unchanged_keys(d)", forms: [["d"]], description: "returns list of keys that remain unchanged in ChangeTrackingDict d", details: "", aliases: ["get_unchanged_keys"] },
|
||||
"repeat": { minArgs: 2, maxArgs: 3, signature: "repeat(x, count, [dims])", forms: [["x", "count", "[dims]"]], description: "repeats tensor elements; count may be scalar or per-dim list", details: "", aliases: [] },
|
||||
"flatten": { minArgs: 1, maxArgs: 1, signature: "flatten(x)", forms: [["x"]], description: "flattens tensor into a 1D tensor", details: "", aliases: [] },
|
||||
"append": { minArgs: 2, maxArgs: 2, signature: "append(x, y)", forms: [["x", "y"]], description: "appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)", details: "", aliases: [] },
|
||||
"get_value": { minArgs: 2, maxArgs: 2, signature: "get_value(tensor, position)", forms: [["tensor", "position"]], description: "reads the value at an N-D position of tensor. Superseded by tensor[position] indexing", details: "", aliases: [] },
|
||||
"flow_apply": { minArgs: 2, maxArgs: 2, signature: "flow_apply(image, flow)", forms: [["image", "flow"]], description: "applies optical flow to an image", details: "", aliases: [] },
|
||||
"batch_shuffle": { minArgs: 2, maxArgs: 2, signature: "batch_shuffle(x, indices)", forms: [["x", "indices"]], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["shuffle", "select"] },
|
||||
"shuffle": { minArgs: 2, maxArgs: 2, signature: "shuffle(x, indices)", forms: [["x", "indices"]], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["batch_shuffle", "select"] },
|
||||
"select": { minArgs: 2, maxArgs: 2, signature: "select(x, indices)", forms: [["x", "indices"]], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", aliases: ["batch_shuffle", "shuffle"] },
|
||||
"motion_mask": { minArgs: 1, maxArgs: 1, signature: "motion_mask(x)", forms: [["x"]], description: "generates a motion mask from optical flow", details: "", aliases: [] },
|
||||
"flow_to_image": { minArgs: 1, maxArgs: 1, signature: "flow_to_image(x)", forms: [["x"]], description: "converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta.", details: "", aliases: [] },
|
||||
"flow_mag": { minArgs: 1, maxArgs: 1, signature: "flow_mag(x)", forms: [["x"]], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", aliases: ["flow_magnitude"] },
|
||||
"flow_magnitude": { minArgs: 1, maxArgs: 1, signature: "flow_magnitude(x)", forms: [["x"]], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", aliases: ["flow_mag"] },
|
||||
"flow_ang": { minArgs: 1, maxArgs: 1, signature: "flow_ang(x)", forms: [["x"]], description: "computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)", details: "", aliases: ["flow_angle"] },
|
||||
"flow_angle": { minArgs: 1, maxArgs: 1, signature: "flow_angle(x)", forms: [["x"]], description: "computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)", details: "", aliases: ["flow_ang"] },
|
||||
"where": { minArgs: 3, maxArgs: 3, signature: "where(condition, x, y)", forms: [["condition", "x", "y"]], description: "returns x if condition is true, else y. Runs per element.", details: "", aliases: [] },
|
||||
"histogram": { minArgs: 4, maxArgs: 4, signature: "histogram(x, bins, min, max)", forms: [["x", "bins", "min", "max"]], description: "counts the elements of flatten(x) in bins equal-width bins over [min, max]", details: "", aliases: ["hist"] },
|
||||
"hist": { minArgs: 4, maxArgs: 4, signature: "hist(x, bins, min, max)", forms: [["x", "bins", "min", "max"]], description: "counts the elements of flatten(x) in bins equal-width bins over [min, max]", details: "", aliases: ["histogram"] },
|
||||
"overlay": { minArgs: 3, maxArgs: 4, signature: "overlay(base, overlay, offset, [opacity])", forms: [["base", "overlay", "offset", "[opacity]"]], description: "overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.", details: "", aliases: [] },
|
||||
"pad": { minArgs: 2, maxArgs: 2, signature: "pad(x, padding)", forms: [["x", "padding"]], description: "pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)", details: "", aliases: [] },
|
||||
"cross": { minArgs: 2, maxArgs: 2, signature: "cross(x, y)", forms: [["x", "y"]], description: "computes the cross product of x and y. Last dimension must be 3", details: "", aliases: [] },
|
||||
"matmul": { minArgs: 2, maxArgs: 2, signature: "matmul(x, y)", forms: [["x", "y"]], description: "computes the matrix multiplication of x and y", details: "", aliases: [] },
|
||||
"solve": { minArgs: 2, maxArgs: 2, signature: "solve(A, b)", forms: [["A", "b"]], description: "solves the square linear system A*x=b without explicitly forming A inverse", details: "", aliases: [] },
|
||||
"matrix_rank": { minArgs: 1, maxArgs: 2, signature: "matrix_rank(x, [tol])", forms: [["x", "[tol]"]], description: "computes the numerical rank of each matrix using optional absolute tolerance tol", details: "", aliases: [] },
|
||||
"rife": { minArgs: 2, maxArgs: 5, signature: "rife(image1, image2, [tiling_size], [iterations], [multi_scale])", forms: [["image1", "image2", "[tiling_size]", "[iterations]", "[multi_scale]"]], description: "computes the optical flow field ([H, W, 2]) between image1 and image2 using a RAFT-based model", details: "- tiling_size: splits the image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution\n- iterations: how many times to run the flow model. Default 12\n- multi_scale: also use low resolution of base image for giant movements. Default false", aliases: [] },
|
||||
"bnot": { minArgs: 1, maxArgs: 1, signature: "bnot(x)", forms: [["x"]], description: "computes the bitwise NOT", details: "", aliases: ["bitwise_not"] },
|
||||
"bitwise_not": { minArgs: 1, maxArgs: 1, signature: "bitwise_not(x)", forms: [["x"]], description: "computes the bitwise NOT", details: "", aliases: ["bnot"] },
|
||||
"bitcount": { minArgs: 1, maxArgs: 1, signature: "bitcount(x)", forms: [["x"]], description: "returns the number of set bits", details: "", aliases: ["popcount", "popcnt"] },
|
||||
"popcount": { minArgs: 1, maxArgs: 1, signature: "popcount(x)", forms: [["x"]], description: "returns the number of set bits", details: "", aliases: ["bitcount", "popcnt"] },
|
||||
"popcnt": { minArgs: 1, maxArgs: 1, signature: "popcnt(x)", forms: [["x"]], description: "returns the number of set bits", details: "", aliases: ["bitcount", "popcount"] },
|
||||
"shape": { minArgs: 1, maxArgs: 1, signature: "shape(x)", forms: [["x"]], description: "returns the shape of tensor as a list", details: "", aliases: [] },
|
||||
"band": { minArgs: 2, maxArgs: 2, signature: "band(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise AND of x and y", details: "", aliases: ["bitwise_and"] },
|
||||
"bitwise_and": { minArgs: 2, maxArgs: 2, signature: "bitwise_and(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise AND of x and y", details: "", aliases: ["band"] },
|
||||
"bxor": { minArgs: 2, maxArgs: 2, signature: "bxor(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise XOR of x and y", details: "", aliases: ["bitwise_xor"] },
|
||||
"bitwise_xor": { minArgs: 2, maxArgs: 2, signature: "bitwise_xor(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise XOR of x and y", details: "", aliases: ["bxor"] },
|
||||
"bor": { minArgs: 2, maxArgs: 2, signature: "bor(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise OR of x and y", details: "", aliases: ["bitwise_or"] },
|
||||
"bitwise_or": { minArgs: 2, maxArgs: 2, signature: "bitwise_or(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise OR of x and y", details: "", aliases: ["bor"] },
|
||||
"tensor": { minArgs: 1, maxArgs: 3, signature: "tensor(shape, [value], [dtype_template])", forms: [["shape", "[value]", "[dtype_template]"]], description: "creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32", details: "", aliases: [] },
|
||||
"zeros": { minArgs: 1, maxArgs: 2, signature: "zeros(shape, [dtype_template])", forms: [["shape", "[dtype_template]"]], description: "creates a zero-filled tensor on the current device", details: "", aliases: [] },
|
||||
"ones": { minArgs: 1, maxArgs: 2, signature: "ones(shape, [dtype_template])", forms: [["shape", "[dtype_template]"]], description: "creates a one-filled tensor on the current device", details: "", aliases: [] },
|
||||
"eye": { minArgs: 1, maxArgs: 2, signature: "eye(n, [dtype_template])", forms: [["n", "[dtype_template]"]], description: "creates an n-by-n identity matrix", details: "", aliases: [] },
|
||||
"one_hot": { minArgs: 2, maxArgs: 2, signature: "one_hot(indices, classes)", forms: [["indices", "classes"]], description: "converts integer class indices to float32 one-hot vectors", details: "", aliases: [] },
|
||||
"mse": { minArgs: 2, maxArgs: 3, signature: "mse(a, b, [reduction])", forms: [["a", "b", "[reduction]"]], description: "mean squared error; reduction is mean (default), sum, or none", details: "", aliases: [] },
|
||||
"mae": { minArgs: 2, maxArgs: 3, signature: "mae(a, b, [reduction])", forms: [["a", "b", "[reduction]"]], description: "mean absolute error; reduction is mean (default), sum, or none", details: "", aliases: [] },
|
||||
"psnr": { minArgs: 2, maxArgs: 3, signature: "psnr(a, b, [data_range])", forms: [["a", "b", "[data_range]"]], description: "peak signal-to-noise ratio in dB; data_range defaults to 1", details: "", aliases: [] },
|
||||
"weighted_mean": { minArgs: 2, maxArgs: 3, signature: "weighted_mean(x, weights, [dims])", forms: [["x", "weights", "[dims]"]], description: "computes the weighted mean globally or along one or more dimensions", details: "", aliases: [] },
|
||||
"huber_loss": { minArgs: 2, maxArgs: 4, signature: "huber_loss(prediction, target, [delta], [reduction])", forms: [["prediction", "target", "[delta]", "[reduction]"]], description: "computes Huber loss; delta defaults to 1 and reduction to mean", details: "", aliases: [] },
|
||||
"cross_entropy": { minArgs: 2, maxArgs: 4, signature: "cross_entropy(logits, target, [dim], [reduction])", forms: [["logits", "target", "[dim]", "[reduction]"]], description: "computes cross-entropy from class logits and class indices or target probabilities", details: "", aliases: [] },
|
||||
"add_key": { minArgs: 3, maxArgs: 3, signature: "add_key(dict, key, value)", forms: [["dict", "key", "value"]], description: "adds or replaces a dictionary entry and returns the updated dictionary", details: "", aliases: [] },
|
||||
"remove_key": { minArgs: 2, maxArgs: 2, signature: "remove_key(dict, key)", forms: [["dict", "key"]], description: "removes a dictionary entry and returns the updated dictionary", details: "", aliases: ["rm_key"] },
|
||||
"rm_key": { minArgs: 2, maxArgs: 2, signature: "rm_key(dict, key)", forms: [["dict", "key"]], description: "removes a dictionary entry and returns the updated dictionary", details: "", aliases: ["remove_key"] },
|
||||
"stack_push": { minArgs: 2, maxArgs: 2, signature: "stack_push(slot, val)", forms: [["slot", "val"]], description: "pushes val onto the end of slot stack", details: "", aliases: [] },
|
||||
"stack_pop": { minArgs: 1, maxArgs: 1, signature: "stack_pop(slot)", forms: [["slot"]], description: "removes and returns the last element of slot stack", details: "", aliases: [] },
|
||||
"stack_clear": { minArgs: 1, maxArgs: 1, signature: "stack_clear(slot)", forms: [["slot"]], description: "clears the contents of slot stack", details: "", aliases: [] },
|
||||
"stack_has": { minArgs: 1, maxArgs: 1, signature: "stack_has(slot)", forms: [["slot"]], description: "returns 1.0 if slot exists in stack and is not empty else returns 0.0", details: "", aliases: [] },
|
||||
"stack_get": { minArgs: 1, maxArgs: 1, signature: "stack_get(slot)", forms: [["slot"]], description: "returns the last pushed value in slot without popping it", details: "", aliases: [] },
|
||||
"cat": { minArgs: 2, maxArgs: null, signature: "cat(x, ..., dim)", forms: [["x", "...", "dim"]], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["concat", "concatenate"] },
|
||||
"concat": { minArgs: 2, maxArgs: null, signature: "concat(x, ..., dim)", forms: [["x", "...", "dim"]], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["cat", "concatenate"] },
|
||||
"concatenate": { minArgs: 2, maxArgs: null, signature: "concatenate(x, ..., dim)", forms: [["x", "...", "dim"]], description: "concatenates one or more tensors along the specified dimension", details: "", aliases: ["cat", "concat"] },
|
||||
"stack": { minArgs: 1, maxArgs: 2, signature: "stack(tensors, [dim])", forms: [["tensors", "[dim]"]], description: "stacks a list of tensors along a new dimension", details: "", aliases: [] },
|
||||
"nonzero": { minArgs: 1, maxArgs: 1, signature: "nonzero(x)", forms: [["x"]], description: "returns an N-by-rank tensor of coordinates for nonzero elements", details: "", aliases: [] },
|
||||
"int": { minArgs: 1, maxArgs: 1, signature: "int(x)", forms: [["x"]], description: "casts x to integer", details: "", aliases: [] },
|
||||
"float": { minArgs: 1, maxArgs: 1, signature: "float(x)", forms: [["x"]], description: "casts x to float", details: "", aliases: [] },
|
||||
"upper": { minArgs: 1, maxArgs: 1, signature: "upper(x)", forms: [["x"]], description: "converts string to uppercase", details: "", aliases: [] },
|
||||
"lower": { minArgs: 1, maxArgs: 1, signature: "lower(x)", forms: [["x"]], description: "converts string to lowercase", details: "", aliases: [] },
|
||||
"trim": { minArgs: 1, maxArgs: 1, signature: "trim(x)", forms: [["x"]], description: "removes leading and trailing whitespace from string", details: "", aliases: [] },
|
||||
"split": { minArgs: 1, maxArgs: 2, signature: "split(x, [delimiter])", forms: [["x", "[delimiter]"]], description: "splits string to list of strings based on delimiter. Default is space.", details: "", aliases: [] },
|
||||
"join": { minArgs: 1, maxArgs: 2, signature: "join(x, [separator])", forms: [["x", "[separator]"]], description: "joins the items of list x as text using separator (default \"\"). Use concatenate(...) to join tensors", details: "", aliases: [] },
|
||||
"substring": { minArgs: 2, maxArgs: 3, signature: "substring(s, start, [length])", forms: [["s", "start", "[length]"]], description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string", details: "", aliases: ["substr"] },
|
||||
"substr": { minArgs: 2, maxArgs: 3, signature: "substr(s, start, [length])", forms: [["s", "start", "[length]"]], description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string", details: "", aliases: ["substring"] },
|
||||
"find": { minArgs: 2, maxArgs: 2, signature: "find(s, sub)", forms: [["s", "sub"]], description: "returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings.", details: "", aliases: [] },
|
||||
"replace": { minArgs: 3, maxArgs: 3, signature: "replace(s, old, new)", forms: [["s", "old", "new"]], description: "replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.", details: "", aliases: [] },
|
||||
"dilate": { minArgs: 1, maxArgs: 2, signature: "dilate(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological dilation to x with a square kernel (default size 3).", details: "", aliases: [] },
|
||||
"erode": { minArgs: 1, maxArgs: 2, signature: "erode(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological erosion to x with a square kernel (default size 3).", details: "", aliases: [] },
|
||||
"morph_open": { minArgs: 1, maxArgs: 2, signature: "morph_open(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological opening (erosion then dilation) to x with a square kernel (default size 3).", details: "", aliases: [] },
|
||||
"morph_close": { minArgs: 1, maxArgs: 2, signature: "morph_close(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological closing (dilation then erosion) to x with a square kernel (default size 3).", details: "", aliases: [] },
|
||||
"rgb_to_oklab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_oklab(rgb) / rgb_to_oklab(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "converts 0-1 sRGB to OKLab. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result", details: "", aliases: [] },
|
||||
"rgb_to_cielab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_cielab(rgb) / rgb_to_cielab(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "converts 0-1 sRGB to CIELAB (D65) divided by 100, so L is 0-1. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result", details: "", aliases: [] },
|
||||
"oklab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)", forms: [["oklab"], ["l", "a", "b"]], description: "converts OKLab to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result", details: "", aliases: [] },
|
||||
"cielab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)", forms: [["cielab"], ["l", "a", "b"]], description: "converts CIELAB divided by 100 (as returned by rgb_to_cielab) to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result", details: "", aliases: [] },
|
||||
"rgb_to_hsv": { minArgs: 1, maxArgs: 4, signature: "rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees])", forms: [["rgb", "[degrees]"], ["r", "g", "b", "[degrees]"]], description: "converts RGB to HSV. With one color argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is 0-360 instead of 0-1", details: "", aliases: [] },
|
||||
"hsv_to_rgb": { minArgs: 1, maxArgs: 4, signature: "hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees])", forms: [["hsv", "[degrees]"], ["h", "s", "v", "[degrees]"]], description: "converts HSV to RGB. With one color argument its last dimension holds H, S, V; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is read as 0-360 instead of 0-1", details: "", aliases: [] },
|
||||
"int_to_rgb": { minArgs: 1, maxArgs: 1, signature: "int_to_rgb(val)", forms: [["val"]], description: "unpacks 0xRRGGBB integers into 0-1 RGB colors. Tensors get R, G, B stacked in a new last dimension, lists return a list of colors and a number returns a 3-item list", details: "", aliases: [] },
|
||||
"rgb_to_int": { minArgs: 1, maxArgs: 3, signature: "rgb_to_int(rgb) / rgb_to_int(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "packs 0-1 RGB components into 0xRRGGBB integers. With one argument the last dimension (or a 3-item list) holds R, G, B; with three, each argument is one channel", details: "", aliases: [] },
|
||||
"interpolate_linear": { minArgs: 2, maxArgs: 2, signature: "interpolate_linear(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with (bi/tri)linear interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", aliases: [] },
|
||||
"interpolate_area": { minArgs: 2, maxArgs: 2, signature: "interpolate_area(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with area interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", aliases: [] },
|
||||
"interpolate_nearest": { minArgs: 2, maxArgs: 2, signature: "interpolate_nearest(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", aliases: ["interpolate_nearest_exact"] },
|
||||
"interpolate_nearest_exact": { minArgs: 2, maxArgs: 2, signature: "interpolate_nearest_exact(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", aliases: ["interpolate_nearest"] },
|
||||
"text_image": { minArgs: 3, maxArgs: 9, signature: "text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline])", forms: [["text", "font", "size", "[max_width]", "[weight]", "[rotation_angle]", "[line_spacing]", "[italic]", "[underline]"]], description: "renders text to a 2D tensor with values 0-1", details: "", aliases: [] },
|
||||
"as_nested_tensor": { minArgs: 1, maxArgs: 1, signature: "as_nested_tensor(x)", forms: [["x"]], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", aliases: ["as_nested"] },
|
||||
"as_nested": { minArgs: 1, maxArgs: 1, signature: "as_nested(x)", forms: [["x"]], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", aliases: ["as_nested_tensor"] },
|
||||
"svd": { minArgs: 1, maxArgs: 2, signature: "svd(x, [full_matrices])", forms: [["x", "[full_matrices]"]], description: "computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)", details: "", aliases: ["singular_value_decomposition"] },
|
||||
"singular_value_decomposition": { minArgs: 1, maxArgs: 2, signature: "singular_value_decomposition(x, [full_matrices])", forms: [["x", "[full_matrices]"]], description: "computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)", details: "", aliases: ["svd"] },
|
||||
"diagonal_matrix": { minArgs: 2, maxArgs: 5, signature: "diagonal_matrix(x, shape, [offset], [dim1], [dim2])", forms: [["x", "shape", "[offset]", "[dim1]", "[dim2]"]], description: "creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.", details: "", aliases: ["diag"] },
|
||||
"diag": { minArgs: 2, maxArgs: 5, signature: "diag(x, shape, [offset], [dim1], [dim2])", forms: [["x", "shape", "[offset]", "[dim1]", "[dim2]"]], description: "creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.", details: "", aliases: ["diagonal_matrix"] },
|
||||
"timestamp": { minArgs: 0, maxArgs: 0, signature: "timestamp()", forms: [[]], description: "returns the current system timestamp", details: "", aliases: ["now"] },
|
||||
"now": { minArgs: 0, maxArgs: 0, signature: "now()", forms: [[]], description: "returns the current system timestamp", details: "", aliases: ["timestamp"] },
|
||||
"sort": { minArgs: 1, maxArgs: 3, signature: "sort(x, [descending], [dim])", forms: [["x", "[descending]", "[dim]"]], description: "returns x sorted ascending, or descending when descending is truthy. Tensors are sorted along dim (default: last dimension); lists use Python sorting", details: "", aliases: [] },
|
||||
"argsort": { minArgs: 1, maxArgs: 3, signature: "argsort(x, [descending], [dim])", forms: [["x", "[descending]", "[dim]"]], description: "returns the indices that would sort x. descending defaults to false and dim defaults to the last dimension.", details: "", aliases: [] },
|
||||
"argmin": { minArgs: 1, maxArgs: 3, signature: "argmin(x, [as_position], [dim])", forms: [["x", "[as_position]", "[dim]"]], description: "returns the minimum index globally or along dim; as_position returns global coordinates", details: "", aliases: [] },
|
||||
"argmax": { minArgs: 1, maxArgs: 3, signature: "argmax(x, [as_position], [dim])", forms: [["x", "[as_position]", "[dim]"]], description: "returns the maximum index globally or along dim; as_position returns global coordinates", details: "", aliases: [] },
|
||||
"softmax": { minArgs: 1, maxArgs: 2, signature: "softmax(x, [dim])", forms: [["x", "[dim]"]], description: "applies the softmax function to x (each slice sums to 1.0). dim defaults to the last dimension.", details: "", aliases: [] },
|
||||
"softmin": { minArgs: 1, maxArgs: 2, signature: "softmin(x, [dim])", forms: [["x", "[dim]"]], description: "applies the softmin function to x (same as softmax(-x, [dim])). dim defaults to the last dimension.", details: "", aliases: [] },
|
||||
"unique": { minArgs: 1, maxArgs: 1, signature: "unique(x)", forms: [["x"]], description: "returns the sorted unique elements of x (tensors are flattened first)", details: "", aliases: [] },
|
||||
"flip": { minArgs: 2, maxArgs: 2, signature: "flip(x, dims)", forms: [["x", "dims"]], description: "reverses the order of elements along the specified dimensions. Text is reversed as a whole", details: "", aliases: [] },
|
||||
"startswith": { minArgs: 2, maxArgs: 2, signature: "startswith(text, prefix)", forms: [["text", "prefix"]], description: "returns 1 if text starts with prefix, else 0", details: "", aliases: [] },
|
||||
"endswith": { minArgs: 2, maxArgs: 2, signature: "endswith(text, suffix)", forms: [["text", "suffix"]], description: "returns 1 if text ends with suffix, else 0", details: "", aliases: [] },
|
||||
"squeeze": { minArgs: 1, maxArgs: 2, signature: "squeeze(x, [dim])", forms: [["x", "[dim]"]], description: "removes size-1 dimensions from tensor x, optionally at dim", details: "", aliases: [] },
|
||||
"unsqueeze": { minArgs: 2, maxArgs: 2, signature: "unsqueeze(x, dim)", forms: [["x", "dim"]], description: "inserts a size-1 dimension into tensor x at dim", details: "", aliases: [] },
|
||||
"roll": { minArgs: 2, maxArgs: 3, signature: "roll(x, shifts, [dim])", forms: [["x", "shifts", "[dim]"]], description: "circularly shifts tensor x along dim (default 0)", details: "", aliases: [] },
|
||||
"cov": { minArgs: 2, maxArgs: 2, signature: "cov(x, y)", forms: [["x", "y"]], description: "computes the sample covariance of the flattened x and y (which must have the same number of elements)", details: "", aliases: [] },
|
||||
"corr": { minArgs: 2, maxArgs: 2, signature: "corr(x, y)", forms: [["x", "y"]], description: "computes the Pearson correlation coefficient between x and y", details: "", aliases: ["correlation"] },
|
||||
"correlation": { minArgs: 2, maxArgs: 2, signature: "correlation(x, y)", forms: [["x", "y"]], description: "computes the Pearson correlation coefficient between x and y", details: "", aliases: ["corr"] },
|
||||
"entropy": { minArgs: 1, maxArgs: 1, signature: "entropy(x)", forms: [["x"]], description: "computes the Shannon entropy (in nats) of softmax(x), i.e. x is treated as logits over all of its elements", details: "", aliases: [] },
|
||||
"crop": { minArgs: 3, maxArgs: 3, signature: "crop(x, start, size)", forms: [["x", "start", "size"]], description: "crops the region of x beginning at start (the low corner). The result always has shape size; parts outside x are zero-filled. On text, returns at most size characters", details: "", aliases: [] },
|
||||
"coords": { minArgs: 2, maxArgs: 3, signature: "coords(shape, dim, [dtype_template])", forms: [["shape", "dim", "[dtype_template]"]], description: "generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).", details: "", aliases: ["coordinates"] },
|
||||
"coordinates": { minArgs: 2, maxArgs: 3, signature: "coordinates(shape, dim, [dtype_template])", forms: [["shape", "dim", "[dtype_template]"]], description: "generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).", details: "", aliases: ["coords"] },
|
||||
"gather": { minArgs: 3, maxArgs: 3, signature: "gather(x, dim, idx)", forms: [["x", "dim", "idx"]], description: "gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.", details: "", aliases: [] },
|
||||
"scatter": { minArgs: 4, maxArgs: 4, signature: "scatter(x, dim, idx, src)", forms: [["x", "dim", "idx", "src"]], description: "scatters elements from src into x along dim using the indices specified in idx. The output tensor has the same shape as x.", details: "", aliases: [] },
|
||||
"scatter_add": { minArgs: 4, maxArgs: 4, signature: "scatter_add(x, dim, idx, src)", forms: [["x", "dim", "idx", "src"]], description: "scatters elements from src into x along dim using the indices specified in idx, adding to existing values. The output tensor has the same shape as x.", details: "", aliases: [] },
|
||||
"noise": { minArgs: 1, maxArgs: 2, signature: "noise(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates normally distributed random noise", details: "", aliases: ["randn", "random_normal"] },
|
||||
"randn": { minArgs: 1, maxArgs: 2, signature: "randn(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates normally distributed random noise", details: "", aliases: ["noise", "random_normal"] },
|
||||
"random_normal": { minArgs: 1, maxArgs: 2, signature: "random_normal(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates normally distributed random noise", details: "", aliases: ["noise", "randn"] },
|
||||
"pink_noise": { minArgs: 1, maxArgs: 2, signature: "pink_noise(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic pink noise (approximately 1/f power spectrum) with zero mean and unit variance per row", details: "", aliases: ["pink"] },
|
||||
"pink": { minArgs: 1, maxArgs: 2, signature: "pink(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic pink noise (approximately 1/f power spectrum) with zero mean and unit variance per row", details: "", aliases: ["pink_noise"] },
|
||||
"brown_noise": { minArgs: 1, maxArgs: 2, signature: "brown_noise(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic brown noise (approximately 1/f^2 power spectrum) with zero mean and unit variance per row", details: "", aliases: ["brown"] },
|
||||
"brown": { minArgs: 1, maxArgs: 2, signature: "brown(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic brown noise (approximately 1/f^2 power spectrum) with zero mean and unit variance per row", details: "", aliases: ["brown_noise"] },
|
||||
"rand": { minArgs: 1, maxArgs: 2, signature: "rand(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates uniformly distributed random noise", details: "", aliases: ["randu", "random_uniform"] },
|
||||
"randu": { minArgs: 1, maxArgs: 2, signature: "randu(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates uniformly distributed random noise", details: "", aliases: ["rand", "random_uniform"] },
|
||||
"random_uniform": { minArgs: 1, maxArgs: 2, signature: "random_uniform(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates uniformly distributed random noise", details: "", aliases: ["rand", "randu"] },
|
||||
"randc": { minArgs: 3, maxArgs: 4, signature: "randc(seed, median, sigma, [shape])", forms: [["seed", "median", "sigma", "[shape]"]], description: "generates Cauchy distributed random values.", details: "", aliases: ["random_cauchy"] },
|
||||
"random_cauchy": { minArgs: 3, maxArgs: 4, signature: "random_cauchy(seed, median, sigma, [shape])", forms: [["seed", "median", "sigma", "[shape]"]], description: "generates Cauchy distributed random values.", details: "", aliases: ["randc"] },
|
||||
"rande": { minArgs: 2, maxArgs: 3, signature: "rande(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates exponentially distributed random values", details: "", aliases: ["random_exponential"] },
|
||||
"random_exponential": { minArgs: 2, maxArgs: 3, signature: "random_exponential(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates exponentially distributed random values", details: "", aliases: ["rande"] },
|
||||
"randln": { minArgs: 3, maxArgs: 4, signature: "randln(seed, mean, std, [shape])", forms: [["seed", "mean", "std", "[shape]"]], description: "generates log-normally distributed random values.", details: "", aliases: ["random_log_normal"] },
|
||||
"random_log_normal": { minArgs: 3, maxArgs: 4, signature: "random_log_normal(seed, mean, std, [shape])", forms: [["seed", "mean", "std", "[shape]"]], description: "generates log-normally distributed random values.", details: "", aliases: ["randln"] },
|
||||
"randb": { minArgs: 2, maxArgs: 3, signature: "randb(seed, probability, [shape])", forms: [["seed", "probability", "[shape]"]], description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor", details: "", aliases: ["random_bernoulli"] },
|
||||
"random_bernoulli": { minArgs: 2, maxArgs: 3, signature: "random_bernoulli(seed, probability, [shape])", forms: [["seed", "probability", "[shape]"]], description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor", details: "", aliases: ["randb"] },
|
||||
"randp": { minArgs: 2, maxArgs: 3, signature: "randp(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates Poisson distributed random values.", details: "", aliases: ["random_poisson"] },
|
||||
"random_poisson": { minArgs: 2, maxArgs: 3, signature: "random_poisson(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates Poisson distributed random values.", details: "", aliases: ["randp"] },
|
||||
"randg": { minArgs: 3, maxArgs: 4, signature: "randg(seed, shape_param, scale, [shape])", forms: [["seed", "shape_param", "scale", "[shape]"]], description: "generates Gamma distributed random values.", details: "", aliases: ["random_gamma"] },
|
||||
"random_gamma": { minArgs: 3, maxArgs: 4, signature: "random_gamma(seed, shape_param, scale, [shape])", forms: [["seed", "shape_param", "scale", "[shape]"]], description: "generates Gamma distributed random values.", details: "", aliases: ["randg"] },
|
||||
"randbeta": { minArgs: 3, maxArgs: 4, signature: "randbeta(seed, alpha, beta, [shape])", forms: [["seed", "alpha", "beta", "[shape]"]], description: "generates Beta distributed random values", details: "", aliases: ["random_beta"] },
|
||||
"random_beta": { minArgs: 3, maxArgs: 4, signature: "random_beta(seed, alpha, beta, [shape])", forms: [["seed", "alpha", "beta", "[shape]"]], description: "generates Beta distributed random values", details: "", aliases: ["randbeta"] },
|
||||
"randl": { minArgs: 3, maxArgs: 4, signature: "randl(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Laplace distributed random values", details: "", aliases: ["random_laplace"] },
|
||||
"random_laplace": { minArgs: 3, maxArgs: 4, signature: "random_laplace(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Laplace distributed random values", details: "", aliases: ["randl"] },
|
||||
"randgumbel": { minArgs: 3, maxArgs: 4, signature: "randgumbel(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Gumbel distributed random values", details: "", aliases: ["random_gumbel"] },
|
||||
"random_gumbel": { minArgs: 3, maxArgs: 4, signature: "random_gumbel(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Gumbel distributed random values", details: "", aliases: ["randgumbel"] },
|
||||
"randw": { minArgs: 3, maxArgs: 4, signature: "randw(seed, scale, concentration, [shape])", forms: [["seed", "scale", "concentration", "[shape]"]], description: "generates Weibull distributed random values", details: "", aliases: ["random_weibull"] },
|
||||
"random_weibull": { minArgs: 3, maxArgs: 4, signature: "random_weibull(seed, scale, concentration, [shape])", forms: [["seed", "scale", "concentration", "[shape]"]], description: "generates Weibull distributed random values", details: "", aliases: ["randw"] },
|
||||
"randchi2": { minArgs: 2, maxArgs: 3, signature: "randchi2(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Chi-squared distributed random values", details: "", aliases: ["random_chi2"] },
|
||||
"random_chi2": { minArgs: 2, maxArgs: 3, signature: "random_chi2(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Chi-squared distributed random values", details: "", aliases: ["randchi2"] },
|
||||
"randt": { minArgs: 2, maxArgs: 3, signature: "randt(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Student-t distributed random values", details: "", aliases: ["random_studentt"] },
|
||||
"random_studentt": { minArgs: 2, maxArgs: 3, signature: "random_studentt(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Student-t distributed random values", details: "", aliases: ["randt"] },
|
||||
"perlin": { minArgs: 2, maxArgs: 5, signature: "perlin(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Perlin gradient noise in 0-1 (default 1 octave)", details: "", aliases: ["perlin_noise"] },
|
||||
"perlin_noise": { minArgs: 2, maxArgs: 5, signature: "perlin_noise(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Perlin gradient noise in 0-1 (default 1 octave)", details: "", aliases: ["perlin"] },
|
||||
"cellular": { minArgs: 2, maxArgs: 5, signature: "cellular(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)", details: "", aliases: ["voronoi", "worley", "cellular_noise", "voronoi_noise"] },
|
||||
"voronoi": { minArgs: 2, maxArgs: 5, signature: "voronoi(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)", details: "", aliases: ["cellular", "worley", "cellular_noise", "voronoi_noise"] },
|
||||
"worley": { minArgs: 2, maxArgs: 5, signature: "worley(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)", details: "", aliases: ["cellular", "voronoi", "cellular_noise", "voronoi_noise"] },
|
||||
"cellular_noise": { minArgs: 2, maxArgs: 5, signature: "cellular_noise(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)", details: "", aliases: ["cellular", "voronoi", "worley", "voronoi_noise"] },
|
||||
"voronoi_noise": { minArgs: 2, maxArgs: 5, signature: "voronoi_noise(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)", details: "", aliases: ["cellular", "voronoi", "worley", "cellular_noise"] },
|
||||
"plasma": { minArgs: 2, maxArgs: 5, signature: "plasma(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4", details: "", aliases: ["turbulence", "plasma_noise"] },
|
||||
"turbulence": { minArgs: 2, maxArgs: 5, signature: "turbulence(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4", details: "", aliases: ["plasma", "plasma_noise"] },
|
||||
"plasma_noise": { minArgs: 2, maxArgs: 5, signature: "plasma_noise(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4", details: "", aliases: ["plasma", "turbulence"] },
|
||||
"ridged": { minArgs: 2, maxArgs: 5, signature: "ridged(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates ridged multi-fractal noise in 0-1 (default 4 octaves)", details: "", aliases: ["ridged_noise"] },
|
||||
"ridged_noise": { minArgs: 2, maxArgs: 5, signature: "ridged_noise(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates ridged multi-fractal noise in 0-1 (default 4 octaves)", details: "", aliases: ["ridged"] },
|
||||
"domain_warp": { minArgs: 4, maxArgs: 8, signature: "domain_warp(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])", forms: [["seed", "scale", "warp_scale", "warp_strength", "[octaves]", "[warp_octaves]", "[offset]", "[shape]"]], description: "generates domain warped Perlin noise in 0-1 (defaults: 4 octaves, 2 warp octaves)", details: "", aliases: ["domain_warp_noise"] },
|
||||
"domain_warp_noise": { minArgs: 4, maxArgs: 8, signature: "domain_warp_noise(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])", forms: [["seed", "scale", "warp_scale", "warp_strength", "[octaves]", "[warp_octaves]", "[offset]", "[shape]"]], description: "generates domain warped Perlin noise in 0-1 (defaults: 4 octaves, 2 warp octaves)", details: "", aliases: ["domain_warp"] },
|
||||
"sin": { minArgs: 1, maxArgs: 1, signature: "sin(x)", forms: [["x"]], description: "applies sine function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"cos": { minArgs: 1, maxArgs: 1, signature: "cos(x)", forms: [["x"]], description: "applies cosine function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"tan": { minArgs: 1, maxArgs: 1, signature: "tan(x)", forms: [["x"]], description: "applies tangent function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"asin": { minArgs: 1, maxArgs: 1, signature: "asin(x)", forms: [["x"]], description: "applies arcus sine function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"acos": { minArgs: 1, maxArgs: 1, signature: "acos(x)", forms: [["x"]], description: "applies arcus cosine function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"atan": { minArgs: 1, maxArgs: 1, signature: "atan(x)", forms: [["x"]], description: "applies arcus tangent function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"atan2": { minArgs: 2, maxArgs: 2, signature: "atan2(y, x)", forms: [["y", "x"]], description: "computes the arc tangent of y/x, using the signs of both arguments to determine the quadrant", details: "", params: {"y": "y coordinate (numerator)", "x": "x coordinate (denominator)"}, aliases: [] },
|
||||
"sinh": { minArgs: 1, maxArgs: 1, signature: "sinh(x)", forms: [["x"]], description: "applies hyperbolic sine function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"cosh": { minArgs: 1, maxArgs: 1, signature: "cosh(x)", forms: [["x"]], description: "applies hyperbolic cosine function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"tanh": { minArgs: 1, maxArgs: 1, signature: "tanh(x)", forms: [["x"]], description: "applies hyperbolic tangent function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"asinh": { minArgs: 1, maxArgs: 1, signature: "asinh(x)", forms: [["x"]], description: "applies hyperbolic arcus sine function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"acosh": { minArgs: 1, maxArgs: 1, signature: "acosh(x)", forms: [["x"]], description: "applies hyperbolic arcus cosine function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"atanh": { minArgs: 1, maxArgs: 1, signature: "atanh(x)", forms: [["x"]], description: "applies hyperbolic arcus tangent function to value or each element of value", details: "", params: {}, aliases: [] },
|
||||
"abs": { minArgs: 1, maxArgs: 1, signature: "abs(x)", forms: [["x"]], description: "applies per element absolute value function. Same as |x| for numbers.", details: "", params: {}, aliases: [] },
|
||||
"sqrt": { minArgs: 1, maxArgs: 1, signature: "sqrt(x)", forms: [["x"]], description: "applies square root per element. Negative numbers return NaN (not a number)", details: "", params: {}, aliases: [] },
|
||||
"ln": { minArgs: 1, maxArgs: 1, signature: "ln(x)", forms: [["x"]], description: "applies natural logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", params: {}, aliases: [] },
|
||||
"log": { minArgs: 1, maxArgs: 1, signature: "log(x)", forms: [["x"]], description: "applies base 10 logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", params: {}, aliases: [] },
|
||||
"log2": { minArgs: 1, maxArgs: 1, signature: "log2(x)", forms: [["x"]], description: "applies base 2 logarithm to value (per element). Negative numbers return NaN (not a number)", details: "", params: {}, aliases: [] },
|
||||
"exp": { minArgs: 1, maxArgs: 1, signature: "exp(x)", forms: [["x"]], description: "applies e^x to value (per element)", details: "", params: {}, aliases: [] },
|
||||
"log1p": { minArgs: 1, maxArgs: 1, signature: "log1p(x)", forms: [["x"]], description: "applies ln(1+x) accurately for values near zero", details: "", params: {}, aliases: [] },
|
||||
"expm1": { minArgs: 1, maxArgs: 1, signature: "expm1(x)", forms: [["x"]], description: "applies exp(x)-1 accurately for values near zero", details: "", params: {}, aliases: [] },
|
||||
"sinc": { minArgs: 1, maxArgs: 1, signature: "sinc(x)", forms: [["x"]], description: "computes the normalized sinc function sin(pi*x)/(pi*x), with sinc(0)=1", details: "", params: {}, aliases: [] },
|
||||
"cbrt": { minArgs: 1, maxArgs: 1, signature: "cbrt(x)", forms: [["x"]], description: "computes the real cube root of each value, including negative values", details: "", params: {}, aliases: [] },
|
||||
"reciprocal": { minArgs: 1, maxArgs: 1, signature: "reciprocal(x)", forms: [["x"]], description: "computes 1/x element-wise", details: "", params: {}, aliases: [] },
|
||||
"logaddexp": { minArgs: 2, maxArgs: 2, signature: "logaddexp(x, y)", forms: [["x", "y"]], description: "computes log(exp(x) + exp(y)) element-wise using a numerically stable method", details: "", params: {}, aliases: [] },
|
||||
"logsumexp": { minArgs: 1, maxArgs: 2, signature: "logsumexp(x, [dims])", forms: [["x", "[dims]"]], description: "computes log(sum(exp(x))) stably, optionally reducing along one or more dimensions", details: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
|
||||
"norm": { minArgs: 1, maxArgs: 3, signature: "norm(x, [p], [dims])", forms: [["x", "[p]", "[dims]"]], description: "computes the p-norm globally or along one or more dimensions (default p=2)", details: "", params: {"p": "norm order (default: 2)", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
|
||||
"normalize": { minArgs: 1, maxArgs: 4, signature: "normalize(x, [p], [dim], [eps])", forms: [["x", "[p]", "[dim]", "[eps]"]], description: "normalizes x along dim using the p-norm (defaults: p=2, dim=-1, eps=1e-12)", details: "", params: {"p": "norm order (default: 2)", "dim": "dimension to work along (default: last)", "eps": "smallest allowed divisor (default: 1e-12)"}, aliases: [] },
|
||||
"group_norm": { minArgs: 2, maxArgs: 5, signature: "group_norm(x, groups, [weight], [bias], [eps])", forms: [["x", "groups", "[weight]", "[bias]", "[eps]"]], description: "applies channel-first GroupNorm to [N, C, ...] input", details: "", params: {"groups": "number of channel groups; must divide the channel count", "weight": "per-channel scale, length C (default: none)", "bias": "per-channel shift, length C (default: none)", "eps": "value added to the variance for stability (default: 1e-5)"}, aliases: [] },
|
||||
"outer": { minArgs: 2, maxArgs: 2, signature: "outer(x, y)", forms: [["x", "y"]], description: "computes the outer product of flattened x and y", details: "", params: {}, aliases: [] },
|
||||
"trace": { minArgs: 1, maxArgs: 1, signature: "trace(x)", forms: [["x"]], description: "sums the main diagonal of each square matrix in x", details: "", params: {}, aliases: [] },
|
||||
"det": { minArgs: 1, maxArgs: 1, signature: "det(x)", forms: [["x"]], description: "computes the determinant of each square matrix in x", details: "", params: {}, aliases: [] },
|
||||
"rfft": { minArgs: 1, maxArgs: 2, signature: "rfft(x, [dim])", forms: [["x", "[dim]"]], description: "computes the one-dimensional real-input FFT along dim (default: last dimension)", details: "", params: {"dim": "dimension to transform (default: last)"}, aliases: [] },
|
||||
"irfft": { minArgs: 1, maxArgs: 3, signature: "irfft(x, [n], [dim])", forms: [["x", "[n]", "[dim]"]], description: "computes the inverse one-dimensional real FFT along dim (default: last dimension)", details: "", params: {"n": "length of the output signal (default: 2 * (input length - 1))", "dim": "dimension to transform (default: last)"}, aliases: [] },
|
||||
"isnan": { minArgs: 1, maxArgs: 1, signature: "isnan(x)", forms: [["x"]], description: "returns 1.0 for NaN values and 0.0 otherwise", details: "", params: {}, aliases: [] },
|
||||
"isinf": { minArgs: 1, maxArgs: 1, signature: "isinf(x)", forms: [["x"]], description: "returns 1.0 for infinite values and 0.0 otherwise", details: "", params: {}, aliases: [] },
|
||||
"isfinite": { minArgs: 1, maxArgs: 1, signature: "isfinite(x)", forms: [["x"]], description: "returns 1.0 for finite values and 0.0 otherwise", details: "", params: {}, aliases: [] },
|
||||
"smin": { minArgs: 1, maxArgs: null, signature: "smin(x, ...)", forms: [["x", "..."]], description: "computes the minimum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smin(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.", details: "", params: {}, aliases: [] },
|
||||
"smax": { minArgs: 1, maxArgs: null, signature: "smax(x, ...)", forms: [["x", "..."]], description: "computes the maximum of inputs or elements. Tensors must have the same size or be broadcastable to same size. When called as smax(x, dims) with x a tensor/list, reduces x along dims (a single dim or list of dims) instead.", details: "", params: {}, aliases: [] },
|
||||
"tmin": { minArgs: 2, maxArgs: 2, signature: "tmin(x, y)", forms: [["x", "y"]], description: "elementwise minimum of tensor or list. min(x,y) when inputs are floats", details: "", params: {}, aliases: [] },
|
||||
"tmax": { minArgs: 2, maxArgs: 2, signature: "tmax(x,y)", forms: [["x", "y"]], description: "elementwise maximum of tensor or list. max(x,y) when inputs are floats", details: "", params: {}, aliases: [] },
|
||||
"tnorm": { minArgs: 1, maxArgs: 2, signature: "tnorm(x, [dim])", forms: [["x", "[dim]"]], description: "normalises tensor or list by multiplication such that sum(x^2)==1.0 for each slice. Defaults to the last dimension; dim selects a different slicing dimension.", details: "", params: {"dim": "dimension whose slices are normalised (default: last)"}, aliases: [] },
|
||||
"snorm": { minArgs: 1, maxArgs: 2, signature: "snorm(x,[dim])", forms: [["x", "[dim]"]], description: "frobenius norm of tensor. Along dimension if dimension specified. Dimension can be a list. Defaults to no dimension.", details: "", params: {"dim": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
|
||||
"floor": { minArgs: 1, maxArgs: 1, signature: "floor(x)", forms: [["x"]], description: "returns the largest integer less than or equal to x", details: "", params: {}, aliases: [] },
|
||||
"ceil": { minArgs: 1, maxArgs: 1, signature: "ceil(x)", forms: [["x"]], description: "returns the smallest integer greater than or equal to x", details: "", params: {}, aliases: [] },
|
||||
"round": { minArgs: 1, maxArgs: 1, signature: "round(x)", forms: [["x"]], description: "rounds x to the nearest integer", details: "", params: {}, aliases: [] },
|
||||
"gamma": { minArgs: 1, maxArgs: 1, signature: "gamma(x)", forms: [["x"]], description: "computes the gamma function (per element)", details: "", params: {}, aliases: [] },
|
||||
"pow": { minArgs: 2, maxArgs: 2, signature: "pow(x, y)", forms: [["x", "y"]], description: "computes x raised to the power of y", details: "", params: {"x": "base", "y": "exponent"}, aliases: [] },
|
||||
"sigm": { minArgs: 1, maxArgs: 1, signature: "sigm(x)", forms: [["x"]], description: "applies the sigmoid function: 1 / (1 + exp(-x))", details: "", params: {}, aliases: [] },
|
||||
"clamp": { minArgs: 3, maxArgs: 3, signature: "clamp(x, min, max)", forms: [["x", "min", "max"]], description: "clamps x between min and max per element", details: "", params: {}, aliases: [] },
|
||||
"fft": { minArgs: 1, maxArgs: 1, signature: "fft(x)", forms: [["x"]], description: "computes fast Fourier transform of x", details: "", params: {}, aliases: [] },
|
||||
"ifft": { minArgs: 1, maxArgs: 2, signature: "ifft(x, [shape])", forms: [["x", "[shape]"]], description: "inverse fast Fourier transform of x. shape (defaults to the node's tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.", details: "", params: {"shape": "shape used for the K/Kx/Ky frequency variables (default: the node's input shape)"}, aliases: [] },
|
||||
"angle": { minArgs: 1, maxArgs: 1, signature: "angle(x)", forms: [["x"]], description: "returns the angle of a complex number or vector", details: "", params: {}, aliases: [] },
|
||||
"print": { minArgs: 1, maxArgs: 1, signature: "print(x)", forms: [["x"]], description: "prints the value of x to the console while passing output unchanged", details: "", params: {}, aliases: [] },
|
||||
"print_shape": { minArgs: 1, maxArgs: 1, signature: "print_shape(x)", forms: [["x"]], description: "prints the shape of the tensor x", details: "", params: {}, aliases: ["pshp"] },
|
||||
"pshp": { minArgs: 1, maxArgs: 1, signature: "pshp(x)", forms: [["x"]], description: "prints the shape of the tensor x", details: "", params: {}, aliases: ["print_shape"] },
|
||||
"nvl": { minArgs: 4, maxArgs: 4, signature: "nvl(x, nan, pos_inf, neg_inf)", forms: [["x", "nan", "pos_inf", "neg_inf"]], description: "replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)", details: "", params: {"nan": "replacement for NaN", "pos_inf": "replacement for +infinity", "neg_inf": "replacement for -infinity"}, aliases: ["nan_to_num"] },
|
||||
"nan_to_num": { minArgs: 4, maxArgs: 4, signature: "nan_to_num(x, nan, pos_inf, neg_inf)", forms: [["x", "nan", "pos_inf", "neg_inf"]], description: "replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)", details: "", params: {"nan": "replacement for NaN", "pos_inf": "replacement for +infinity", "neg_inf": "replacement for -infinity"}, aliases: ["nvl"] },
|
||||
"lerp": { minArgs: 3, maxArgs: 3, signature: "lerp(a, b, t)", forms: [["a", "b", "t"]], description: "linear interpolation between a and b by t per element. t can be float or tensor.", details: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: [] },
|
||||
"slerp": { minArgs: 3, maxArgs: 4, signature: "slerp(a, b, t, [dim])", forms: [["a", "b", "t", "[dim]"]], description: "interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.", details: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)", "dim": "dimension holding the vector components (default: all elements form one vector)"}, aliases: [] },
|
||||
"step": { minArgs: 2, maxArgs: 2, signature: "step(x, edge)", forms: [["x", "edge"]], description: "returns 0 if x < edge, else 1", details: "", params: {"edge": "threshold; the result is 1 where x >= edge, otherwise 0"}, aliases: [] },
|
||||
"smoothstep": { minArgs: 3, maxArgs: 3, signature: "smoothstep(x, edge0, edge1)", forms: [["x", "edge0", "edge1"]], description: "smooth interpolation between edge0 and edge1", details: "", params: {"edge0": "value mapped to 0", "edge1": "value mapped to 1"}, aliases: [] },
|
||||
"fract": { minArgs: 1, maxArgs: 1, signature: "fract(x)", forms: [["x"]], description: "returns the fractional part of x: x - floor(x)", details: "", params: {}, aliases: [] },
|
||||
"relu": { minArgs: 1, maxArgs: 1, signature: "relu(x)", forms: [["x"]], description: "applies rectified linear unit function: max(0, x)", details: "", params: {}, aliases: [] },
|
||||
"softsign": { minArgs: 1, maxArgs: 1, signature: "softsign(x)", forms: [["x"]], description: "applies x / (1 + abs(x)) element-wise", details: "", params: {}, aliases: [] },
|
||||
"leaky_relu": { minArgs: 1, maxArgs: 2, signature: "leaky_relu(x, [negative_slope])", forms: [["x", "[negative_slope]"]], description: "applies leaky ReLU element-wise; negative_slope defaults to 0.01", details: "", params: {"negative_slope": "slope used for negative inputs (default: 0.01)"}, aliases: [] },
|
||||
"softplus": { minArgs: 1, maxArgs: 1, signature: "softplus(x)", forms: [["x"]], description: "applies the softplus function: ln(1 + exp(x))", details: "", params: {}, aliases: [] },
|
||||
"gelu": { minArgs: 1, maxArgs: 1, signature: "gelu(x)", forms: [["x"]], description: "applies the Gaussian Error Linear Unit (GELU) activation function", details: "", params: {}, aliases: [] },
|
||||
"silu": { minArgs: 1, maxArgs: 1, signature: "silu(x)", forms: [["x"]], description: "applies the Sigmoid Linear Unit activation element-wise", details: "", params: {}, aliases: [] },
|
||||
"sign": { minArgs: 1, maxArgs: 1, signature: "sign(x)", forms: [["x"]], description: "returns the sign of x: -1, 0, or 1", details: "", params: {}, aliases: [] },
|
||||
"degrees": { minArgs: 1, maxArgs: 1, signature: "degrees(x)", forms: [["x"]], description: "converts radians to degrees (per element)", details: "", params: {}, aliases: [] },
|
||||
"radians": { minArgs: 1, maxArgs: 1, signature: "radians(x)", forms: [["x"]], description: "converts degrees to radians (per element)", details: "", params: {}, aliases: [] },
|
||||
"logical_not": { minArgs: 1, maxArgs: 1, signature: "logical_not(x)", forms: [["x"]], description: "returns 1.0 where x is zero and 0.0 otherwise", details: "", params: {}, aliases: [] },
|
||||
"logical_and": { minArgs: 2, maxArgs: 2, signature: "logical_and(x, y)", forms: [["x", "y"]], description: "returns 1.0 if both values are non-zero, else 0.0", details: "", params: {}, aliases: [] },
|
||||
"logical_or": { minArgs: 2, maxArgs: 2, signature: "logical_or(x, y)", forms: [["x", "y"]], description: "returns 1.0 if either value is non-zero, else 0.0", details: "", params: {}, aliases: [] },
|
||||
"hypot": { minArgs: 2, maxArgs: 2, signature: "hypot(x, y)", forms: [["x", "y"]], description: "computes the element-wise Euclidean distance from the origin", details: "", params: {}, aliases: [] },
|
||||
"map": { minArgs: 2, maxArgs: 4, signature: "map(tensor, coord1, [coord2], [coord3])", forms: [["tensor", "coord1", "[coord2]", "[coord3]"]], description: "samples/remaps input tensor using coordinates", details: "", params: {"coord1": "sample positions (element indices) along the first mapped dimension; mapped dimensions are the last ones of tensor", "coord2": "sample positions along the second mapped dimension", "coord3": "sample positions along the third mapped dimension"}, aliases: [] },
|
||||
"ezconvolution": { minArgs: 3, maxArgs: 5, signature: "ezconvolution(tensor, size_x, kernel) / ezconvolution(tensor, size_x, size_y, kernel) / ezconvolution(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", params: {"tensor": "input, channels first or last", "size_x": "kernel size along the first spatial dimension", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre"}, aliases: ["ezconv"] },
|
||||
"ezconv": { minArgs: 3, maxArgs: 5, signature: "ezconv(tensor, size_x, kernel) / ezconv(tensor, size_x, size_y, kernel) / ezconv(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor with a 1D, 2D or 3D kernel, guessing whether channels come first or last. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", params: {"tensor": "input, channels first or last", "size_x": "kernel size along the first spatial dimension", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre"}, aliases: ["ezconvolution"] },
|
||||
"convolution": { minArgs: 3, maxArgs: 5, signature: "convolution(tensor, size_x, kernel) / convolution(tensor, size_x, size_y, kernel) / convolution(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", params: {"tensor": "input shaped [batch, channel, spatial...]", "size_x": "kernel size along the first spatial dimension", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre"}, aliases: ["conv"] },
|
||||
"conv": { minArgs: 3, maxArgs: 5, signature: "conv(tensor, size_x, kernel) / conv(tensor, size_x, size_y, kernel) / conv(tensor, size_x, size_y, size_z, kernel)", forms: [["tensor", "size_x", "kernel"], ["tensor", "size_x", "size_y", "kernel"], ["tensor", "size_x", "size_y", "size_z", "kernel"]], description: "convolves tensor [batch, channel, spatial...] with a 1D, 2D or 3D kernel. kernel is evaluated over the kernel grid with kx/ky/kz coordinates", details: "", params: {"tensor": "input shaped [batch, channel, spatial...]", "size_x": "kernel size along the first spatial dimension", "size_y": "kernel size along the second spatial dimension", "size_z": "kernel size along the third spatial dimension", "kernel": "expression for the kernel weights, evaluated over the kernel grid with kx/ky/kz offsets from its centre"}, aliases: ["convolution"] },
|
||||
"swap": { minArgs: 4, maxArgs: 4, signature: "swap(x, dim, idx1, idx2)", forms: [["x", "dim", "idx1", "idx2"]], description: "swaps elements along dim between idx1 and idx2", details: "", params: {"dim": "dimension to swap along", "idx1": "first position", "idx2": "second position"}, aliases: [] },
|
||||
"transpose": { minArgs: 3, maxArgs: 3, signature: "transpose(x, dim0, dim1) / transpose(x, dim0, dim1)", forms: [["x", "dim0", "dim1"], ["x", "dim0", "dim1"]], description: "swaps two tensor dimensions", details: "", params: {"dim0": "first dimension to swap", "dim1": "second dimension to swap"}, aliases: ["swapaxes"] },
|
||||
"swapaxes": { minArgs: 3, maxArgs: 3, signature: "swapaxes(x, dim0, dim1) / swapaxes(x, dim0, dim1)", forms: [["x", "dim0", "dim1"], ["x", "dim0", "dim1"]], description: "swaps two tensor dimensions", details: "", params: {"dim0": "first dimension to swap", "dim1": "second dimension to swap"}, aliases: ["transpose"] },
|
||||
"permute": { minArgs: 2, maxArgs: 2, signature: "permute(x, dims)", forms: [["x", "dims"]], description: "permutes the dimensions of tensor x according to dims", details: "", params: {"dims": "new order of the dimensions, e.g. [0, 2, 1]"}, aliases: ["perm"] },
|
||||
"perm": { minArgs: 2, maxArgs: 2, signature: "perm(x, dims)", forms: [["x", "dims"]], description: "permutes the dimensions of tensor x according to dims", details: "", params: {"dims": "new order of the dimensions, e.g. [0, 2, 1]"}, aliases: ["permute"] },
|
||||
"reshape": { minArgs: 2, maxArgs: 2, signature: "reshape(x, shape)", forms: [["x", "shape"]], description: "reshapes tensor x to the specified shape", details: "", params: {"shape": "new shape; the total number of elements must stay the same"}, aliases: ["rshp"] },
|
||||
"rshp": { minArgs: 2, maxArgs: 2, signature: "rshp(x, shape)", forms: [["x", "shape"]], description: "reshapes tensor x to the specified shape", details: "", params: {"shape": "new shape; the total number of elements must stay the same"}, aliases: ["reshape"] },
|
||||
"range": { minArgs: 3, maxArgs: 3, signature: "range(start, stop, step)", forms: [["start", "stop", "step"]], description: "creates a range of values between start (inclusive) and stop (exclusive) using step. Use linspace if you want value count.", details: "", params: {"start": "first value", "stop": "end of the range (not included)", "step": "distance between consecutive values"}, aliases: [] },
|
||||
"linspace": { minArgs: 3, maxArgs: 3, signature: "linspace(start, stop, num)", forms: [["start", "stop", "num"]], description: "creates num linearly spaced values from start to stop (inclusive). Use range if you want to control the step between values.", details: "", params: {"num": "number of values"}, aliases: [] },
|
||||
"logspace": { minArgs: 4, maxArgs: 4, signature: "logspace(start, stop, num, base)", forms: [["start", "stop", "num", "base"]], description: "creates logarithmically spaced values", details: "", params: {"start": "exponent of the first value", "stop": "exponent of the last value", "num": "number of values", "base": "base of the exponent"}, aliases: [] },
|
||||
"topk": { minArgs: 2, maxArgs: 3, signature: "topk(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the k largest elements along dim. For tensors it keeps them in place; dim defaults to the last.", details: "", params: {"k": "number of elements to keep", "dim": "dimension to select along (default: last)"}, aliases: [] },
|
||||
"botk": { minArgs: 2, maxArgs: 3, signature: "botk(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the k smallest elements along dim. For tensors it keeps them in place; dim defaults to the last.", details: "", params: {"k": "number of elements to keep", "dim": "dimension to select along (default: last)"}, aliases: [] },
|
||||
"pinv": { minArgs: 1, maxArgs: 1, signature: "pinv(x)", forms: [["x"]], description: "computes the inverse permutation of x: where x[i] == j the result has result[j] == i. Not the matrix pseudoinverse; use inv(x, 1) for that", details: "", params: {}, aliases: [] },
|
||||
"inv": { minArgs: 1, maxArgs: 2, signature: "inv(x, [pseudo])", forms: [["x", "[pseudo]"]], description: "computes the matrix inverse; when pseudo is truthy, computes the Moore-Penrose pseudoinverse instead", details: "", params: {"pseudo": "truthy to compute the Moore-Penrose pseudoinverse, which also works for singular and non-square matrices (default: false)"}, aliases: [] },
|
||||
"sum": { minArgs: 1, maxArgs: 2, signature: "sum(x, [dims])", forms: [["x", "[dims]"]], description: "computes the sum of elements of x, optionally along one or more dimensions", details: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
|
||||
"mean": { minArgs: 1, maxArgs: 2, signature: "mean(x, [dims])", forms: [["x", "[dims]"]], description: "computes the arithmetic mean of elements of x globally or along one or more dimensions", details: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
|
||||
"std": { minArgs: 1, maxArgs: 2, signature: "std(x, [dims])", forms: [["x", "[dims]"]], description: "computes the sample standard deviation of elements of x globally or along one or more dimensions", details: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
|
||||
"var": { minArgs: 1, maxArgs: 2, signature: "var(x, [dims])", forms: [["x", "[dims]"]], description: "computes the sample variance of elements of x globally or along one or more dimensions", details: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
|
||||
"prod": { minArgs: 1, maxArgs: 2, signature: "prod(x, [dims])", forms: [["x", "[dims]"]], description: "computes the product of elements of x globally or along one or more dimensions", details: "", params: {"dims": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
|
||||
"isclose": { minArgs: 2, maxArgs: 4, signature: "isclose(a, b, [rtol], [atol])", forms: [["a", "b", "[rtol]", "[atol]"]], description: "elementwise approximate equality test", details: "", params: {"rtol": "relative tolerance (default: 1e-5)", "atol": "absolute tolerance (default: 1e-8)"}, aliases: [] },
|
||||
"allclose": { minArgs: 2, maxArgs: 4, signature: "allclose(a, b, [rtol], [atol])", forms: [["a", "b", "[rtol]", "[atol]"]], description: "returns 1.0 if all elements are approximately equal, else 0.0", details: "", params: {"rtol": "relative tolerance (default: 1e-5)", "atol": "absolute tolerance (default: 1e-8)"}, aliases: [] },
|
||||
"quartile": { minArgs: 2, maxArgs: 3, signature: "quartile(x, q, [dim])", forms: [["x", "q", "[dim]"]], description: "computes the q-th quartile globally or along dim", details: "", params: {"q": "quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)", "dim": "dimension to reduce (default: all elements)"}, aliases: ["quartil"] },
|
||||
"quartil": { minArgs: 2, maxArgs: 3, signature: "quartil(x, q, [dim])", forms: [["x", "q", "[dim]"]], description: "computes the q-th quartile globally or along dim", details: "", params: {"q": "quartile number 0-4 (0 = minimum, 2 = median, 4 = maximum)", "dim": "dimension to reduce (default: all elements)"}, aliases: ["quartile"] },
|
||||
"percentile": { minArgs: 2, maxArgs: 3, signature: "percentile(x, p, [dim])", forms: [["x", "p", "[dim]"]], description: "computes the p-th percentile globally or along dim", details: "", params: {"p": "percentile 0-100", "dim": "dimension to reduce (default: all elements)"}, aliases: ["prcnt"] },
|
||||
"prcnt": { minArgs: 2, maxArgs: 3, signature: "prcnt(x, p, [dim])", forms: [["x", "p", "[dim]"]], description: "computes the p-th percentile globally or along dim", details: "", params: {"p": "percentile 0-100", "dim": "dimension to reduce (default: all elements)"}, aliases: ["percentile"] },
|
||||
"quantile": { minArgs: 2, maxArgs: 3, signature: "quantile(x, q, [dim])", forms: [["x", "q", "[dim]"]], description: "computes the q-th quantile globally or along dim", details: "", params: {"q": "quantile 0-1", "dim": "dimension to reduce (default: all elements)"}, aliases: [] },
|
||||
"dot": { minArgs: 2, maxArgs: 2, signature: "dot(x, y)", forms: [["x", "y"]], description: "computes the dot product of x and y after flattening both to 1D. Use cross(x, y) if you need a per-vector product with the last dimension kept.", details: "", params: {}, aliases: [] },
|
||||
"moment": { minArgs: 3, maxArgs: 3, signature: "moment(x, a, k)", forms: [["x", "a", "k"]], description: "computes the k-th moment of x around a", details: "", params: {"a": "centre the moment is taken around", "k": "order of the moment"}, aliases: [] },
|
||||
"erf": { minArgs: 1, maxArgs: 1, signature: "erf(x)", forms: [["x"]], description: "computes the error function (torch.erf)", details: "", params: {}, aliases: [] },
|
||||
"erfc": { minArgs: 1, maxArgs: 1, signature: "erfc(x)", forms: [["x"]], description: "computes the complementary error function (torch.special.erfc)", details: "", params: {}, aliases: [] },
|
||||
"erfinv": { minArgs: 1, maxArgs: 1, signature: "erfinv(x)", forms: [["x"]], description: "computes the inverse error function (torch.erfinv)", details: "", params: {}, aliases: [] },
|
||||
"any": { minArgs: 1, maxArgs: 1, signature: "any(x)", forms: [["x"]], description: "returns 1 if any element of x is non-zero otherwise 0", details: "", params: {}, aliases: [] },
|
||||
"all": { minArgs: 1, maxArgs: 1, signature: "all(x)", forms: [["x"]], description: "returns 1 if all elements of x are non-zero otherwise 0", details: "", params: {}, aliases: [] },
|
||||
"edge": { minArgs: 1, maxArgs: 2, signature: "edge(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "detects edges in x with a Sobel filter. kernel_size must be odd and at least 3 (default 3).", details: "", params: {"kernel_size": "odd Sobel kernel size, at least 3 (default: 3)"}, aliases: [] },
|
||||
"blur": { minArgs: 2, maxArgs: 3, signature: "blur(x, sigma, [reshape])", forms: [["x", "sigma", "[reshape]"]], description: "applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.", details: "", params: {"sigma": "blur strength as the standard deviation in elements; 0 or less returns x unchanged", "reshape": "truthy to find the channel dimension automatically; otherwise channels must be last (default: false)"}, aliases: ["gaussian"] },
|
||||
"gaussian": { minArgs: 2, maxArgs: 3, signature: "gaussian(x, sigma, [reshape])", forms: [["x", "sigma", "[reshape]"]], description: "applies a Gaussian blur to x with specified sigma. if reshape has value of 1.0, then it tries orienting the input such that channel is in the direction of filter. Otherwise it expect color dimension to be the last.", details: "", params: {"sigma": "blur strength as the standard deviation in elements; 0 or less returns x unchanged", "reshape": "truthy to find the channel dimension automatically; otherwise channels must be last (default: false)"}, aliases: ["blur"] },
|
||||
"median": { minArgs: 1, maxArgs: 2, signature: "median(x, [dim])", forms: [["x", "[dim]"]], description: "computes the median globally or along one dimension", details: "", params: {"dim": "dimension to reduce (default: all elements)"}, aliases: [] },
|
||||
"mode": { minArgs: 1, maxArgs: 2, signature: "mode(x, [dim])", forms: [["x", "[dim]"]], description: "computes the mode globally or along one dimension", details: "", params: {"dim": "dimension to reduce (default: all elements)"}, aliases: [] },
|
||||
"cumsum": { minArgs: 1, maxArgs: 2, signature: "cumsum(x, [dim])", forms: [["x", "[dim]"]], description: "computes the cumulative sum, defaulting to the first dimension.", details: "", params: {"dim": "dimension to accumulate along (default: 0)"}, aliases: [] },
|
||||
"cumprod": { minArgs: 1, maxArgs: 1, signature: "cumprod(x)", forms: [["x"]], description: "computes the cumulative product over first dimension.", details: "", params: {}, aliases: [] },
|
||||
"topk_ind": { minArgs: 2, maxArgs: 3, signature: "topk_ind(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)", details: "", params: {"k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, aliases: ["topk_indices"] },
|
||||
"topk_indices": { minArgs: 2, maxArgs: 3, signature: "topk_indices(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k largest elements along dim; without dim, returns indices into flatten(x)", details: "", params: {"k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, aliases: ["topk_ind"] },
|
||||
"botk_ind": { minArgs: 2, maxArgs: 3, signature: "botk_ind(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)", details: "", params: {"k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, aliases: ["botk_indices"] },
|
||||
"botk_indices": { minArgs: 2, maxArgs: 3, signature: "botk_indices(x, k, [dim])", forms: [["x", "k", "[dim]"]], description: "returns the indices of the k smallest elements along dim; without dim, returns indices into flatten(x)", details: "", params: {"k": "number of indices to return", "dim": "dimension to select along (default: indices into flatten(x))"}, aliases: ["botk_ind"] },
|
||||
"cubic_ease": { minArgs: 3, maxArgs: 3, signature: "cubic_ease(a, b, t)", forms: [["a", "b", "t"]], description: "cubic ease between a and b", details: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["cubic"] },
|
||||
"cubic": { minArgs: 3, maxArgs: 3, signature: "cubic(a, b, t)", forms: [["a", "b", "t"]], description: "cubic ease between a and b", details: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["cubic_ease"] },
|
||||
"elastic_ease": { minArgs: 3, maxArgs: 3, signature: "elastic_ease(a, b, t)", forms: [["a", "b", "t"]], description: "elastic ease between a and b", details: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["elastic"] },
|
||||
"elastic": { minArgs: 3, maxArgs: 3, signature: "elastic(a, b, t)", forms: [["a", "b", "t"]], description: "elastic ease between a and b", details: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["elastic_ease"] },
|
||||
"sine_ease": { minArgs: 3, maxArgs: 3, signature: "sine_ease(a, b, t)", forms: [["a", "b", "t"]], description: "sine easing between a and b", details: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["sine"] },
|
||||
"sine": { minArgs: 3, maxArgs: 3, signature: "sine(a, b, t)", forms: [["a", "b", "t"]], description: "sine easing between a and b", details: "", params: {"t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: ["sine_ease"] },
|
||||
"smootherstep": { minArgs: 3, maxArgs: 3, signature: "smootherstep(x, edge0, edge1)", forms: [["x", "edge0", "edge1"]], description: "smoother interpolation between edge0 and edge1", details: "", params: {"edge0": "value mapped to 0", "edge1": "value mapped to 1"}, aliases: [] },
|
||||
"dist": { minArgs: 4, maxArgs: 4, signature: "dist(x1, y1, x2, y2)", forms: [["x1", "y1", "x2", "y2"]], description: "computes Euclidean distance between (x1, y1) and (x2, y2)", details: "", params: {}, aliases: ["distance"] },
|
||||
"distance": { minArgs: 4, maxArgs: 4, signature: "distance(x1, y1, x2, y2)", forms: [["x1", "y1", "x2", "y2"]], description: "computes Euclidean distance between (x1, y1) and (x2, y2)", details: "", params: {}, aliases: ["dist"] },
|
||||
"remap": { minArgs: 5, maxArgs: 5, signature: "remap(v, i_min, i_max, o_min, o_max)", forms: [["v", "i_min", "i_max", "o_min", "o_max"]], description: "remaps values from input range to output range", details: "", params: {"i_min": "start of the input range", "i_max": "end of the input range", "o_min": "value i_min maps to", "o_max": "value i_max maps to"}, aliases: [] },
|
||||
"cossim": { minArgs: 2, maxArgs: 2, signature: "cossim(x, y)", forms: [["x", "y"]], description: "computes the cosine similarity between x and y.", details: "", params: {}, aliases: ["cosine_similarity"] },
|
||||
"cosine_similarity": { minArgs: 2, maxArgs: 2, signature: "cosine_similarity(x, y)", forms: [["x", "y"]], description: "computes the cosine similarity between x and y.", details: "", params: {}, aliases: ["cossim"] },
|
||||
"count": { minArgs: 1, maxArgs: 1, signature: "count(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", params: {}, aliases: ["cnt", "length"] },
|
||||
"cnt": { minArgs: 1, maxArgs: 1, signature: "cnt(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", params: {}, aliases: ["count", "length"] },
|
||||
"length": { minArgs: 1, maxArgs: 1, signature: "length(x)", forms: [["x"]], description: "returns the number of elements in x", details: "", params: {}, aliases: ["count", "cnt"] },
|
||||
"keys": { minArgs: 1, maxArgs: 1, signature: "keys(x)", forms: [["x"]], description: "returns a list of dictionary keys in insertion order", details: "", params: {}, aliases: [] },
|
||||
"enable_tracking": { minArgs: 1, maxArgs: 1, signature: "enable_tracking(d)", forms: [["d"]], description: "enables change tracking for ChangeTrackingDict d (returns d)", details: "", params: {}, aliases: ["track_on"] },
|
||||
"track_on": { minArgs: 1, maxArgs: 1, signature: "track_on(d)", forms: [["d"]], description: "enables change tracking for ChangeTrackingDict d (returns d)", details: "", params: {}, aliases: ["enable_tracking"] },
|
||||
"disable_tracking": { minArgs: 1, maxArgs: 1, signature: "disable_tracking(d)", forms: [["d"]], description: "disables change tracking for ChangeTrackingDict d (returns d)", details: "", params: {}, aliases: ["track_off"] },
|
||||
"track_off": { minArgs: 1, maxArgs: 1, signature: "track_off(d)", forms: [["d"]], description: "disables change tracking for ChangeTrackingDict d (returns d)", details: "", params: {}, aliases: ["disable_tracking"] },
|
||||
"reset_tracking": { minArgs: 1, maxArgs: 1, signature: "reset_tracking(d)", forms: [["d"]], description: "resets change tracking state for ChangeTrackingDict d (returns d)", details: "", params: {}, aliases: ["track_reset"] },
|
||||
"track_reset": { minArgs: 1, maxArgs: 1, signature: "track_reset(d)", forms: [["d"]], description: "resets change tracking state for ChangeTrackingDict d (returns d)", details: "", params: {}, aliases: ["reset_tracking"] },
|
||||
"get_changed_keys": { minArgs: 1, maxArgs: 1, signature: "get_changed_keys(d)", forms: [["d"]], description: "returns list of keys that were modified or added in ChangeTrackingDict d", details: "", params: {}, aliases: ["changed_keys"] },
|
||||
"changed_keys": { minArgs: 1, maxArgs: 1, signature: "changed_keys(d)", forms: [["d"]], description: "returns list of keys that were modified or added in ChangeTrackingDict d", details: "", params: {}, aliases: ["get_changed_keys"] },
|
||||
"get_added_keys": { minArgs: 1, maxArgs: 1, signature: "get_added_keys(d)", forms: [["d"]], description: "returns list of keys that were added (newly created) in ChangeTrackingDict d", details: "", params: {}, aliases: ["added_keys"] },
|
||||
"added_keys": { minArgs: 1, maxArgs: 1, signature: "added_keys(d)", forms: [["d"]], description: "returns list of keys that were added (newly created) in ChangeTrackingDict d", details: "", params: {}, aliases: ["get_added_keys"] },
|
||||
"get_removed_keys": { minArgs: 1, maxArgs: 1, signature: "get_removed_keys(d)", forms: [["d"]], description: "returns list of keys that were removed from ChangeTrackingDict d", details: "", params: {}, aliases: ["removed_keys"] },
|
||||
"removed_keys": { minArgs: 1, maxArgs: 1, signature: "removed_keys(d)", forms: [["d"]], description: "returns list of keys that were removed from ChangeTrackingDict d", details: "", params: {}, aliases: ["get_removed_keys"] },
|
||||
"get_unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "get_unchanged_keys(d)", forms: [["d"]], description: "returns list of keys that remain unchanged in ChangeTrackingDict d", details: "", params: {}, aliases: ["unchanged_keys"] },
|
||||
"unchanged_keys": { minArgs: 1, maxArgs: 1, signature: "unchanged_keys(d)", forms: [["d"]], description: "returns list of keys that remain unchanged in ChangeTrackingDict d", details: "", params: {}, aliases: ["get_unchanged_keys"] },
|
||||
"repeat": { minArgs: 2, maxArgs: 3, signature: "repeat(x, count, [dims])", forms: [["x", "count", "[dims]"]], description: "repeats tensor elements; count may be scalar or per-dim list", details: "", params: {"count": "number of repeats, or a list with one count per dimension", "dims": "dimension or list of dimensions to repeat along; without it a number repeats each element of the flattened input and a list tiles the whole tensor"}, aliases: [] },
|
||||
"flatten": { minArgs: 1, maxArgs: 1, signature: "flatten(x)", forms: [["x"]], description: "flattens tensor into a 1D tensor", details: "", params: {}, aliases: [] },
|
||||
"append": { minArgs: 2, maxArgs: 2, signature: "append(x, y)", forms: [["x", "y"]], description: "appends y to the end of x. If inputs are tensors use concatenate(x,...,dim)", details: "", params: {"y": "item, list or tensor added to the end of x"}, aliases: [] },
|
||||
"get_value": { minArgs: 2, maxArgs: 2, signature: "get_value(tensor, position)", forms: [["tensor", "position"]], description: "reads the value at an N-D position of tensor. Superseded by tensor[position] indexing", details: "", params: {"position": "list with one index per dimension"}, aliases: [] },
|
||||
"flow_apply": { minArgs: 2, maxArgs: 2, signature: "flow_apply(image, flow)", forms: [["image", "flow"]], description: "applies optical flow to an image", details: "", params: {}, aliases: [] },
|
||||
"batch_shuffle": { minArgs: 2, maxArgs: 2, signature: "batch_shuffle(x, indices)", forms: [["x", "indices"]], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", params: {"indices": "batch indices to take, in order; batches may repeat or be skipped"}, aliases: ["shuffle", "select"] },
|
||||
"shuffle": { minArgs: 2, maxArgs: 2, signature: "shuffle(x, indices)", forms: [["x", "indices"]], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", params: {"indices": "batch indices to take, in order; batches may repeat or be skipped"}, aliases: ["batch_shuffle", "select"] },
|
||||
"select": { minArgs: 2, maxArgs: 2, signature: "select(x, indices)", forms: [["x", "indices"]], description: "shuffles and duplicates or skips the batch dimension of x according to indices", details: "", params: {"indices": "batch indices to take, in order; batches may repeat or be skipped"}, aliases: ["batch_shuffle", "shuffle"] },
|
||||
"motion_mask": { minArgs: 1, maxArgs: 1, signature: "motion_mask(x)", forms: [["x"]], description: "generates a motion mask from optical flow", details: "", params: {}, aliases: [] },
|
||||
"flow_to_image": { minArgs: 1, maxArgs: 1, signature: "flow_to_image(x)", forms: [["x"]], description: "converts optical flow x to an RGB image. Up-Down is blue-yellow Left-right green-magenta.", details: "", params: {}, aliases: [] },
|
||||
"flow_mag": { minArgs: 1, maxArgs: 1, signature: "flow_mag(x)", forms: [["x"]], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", params: {}, aliases: ["flow_magnitude"] },
|
||||
"flow_magnitude": { minArgs: 1, maxArgs: 1, signature: "flow_magnitude(x)", forms: [["x"]], description: "computes the magnitude of optical flow (or any other structure with last dimension of 2)", details: "", params: {}, aliases: ["flow_mag"] },
|
||||
"flow_ang": { minArgs: 1, maxArgs: 1, signature: "flow_ang(x)", forms: [["x"]], description: "computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)", details: "", params: {}, aliases: ["flow_angle"] },
|
||||
"flow_angle": { minArgs: 1, maxArgs: 1, signature: "flow_angle(x)", forms: [["x"]], description: "computes the angle atan2(dy, dx) of optical flow x [..., 2] (like angle(), with real and imaginary parts in the last dimension)", details: "", params: {}, aliases: ["flow_ang"] },
|
||||
"where": { minArgs: 3, maxArgs: 3, signature: "where(condition, x, y)", forms: [["condition", "x", "y"]], description: "returns x if condition is true, else y. Runs per element.", details: "", params: {"condition": "non-zero selects x, zero selects y"}, aliases: [] },
|
||||
"histogram": { minArgs: 4, maxArgs: 4, signature: "histogram(x, bins, min, max)", forms: [["x", "bins", "min", "max"]], description: "counts the elements of flatten(x) in bins equal-width bins over [min, max]", details: "", params: {"bins": "number of equal-width bins", "min": "lower edge of the first bin", "max": "upper edge of the last bin"}, aliases: ["hist"] },
|
||||
"hist": { minArgs: 4, maxArgs: 4, signature: "hist(x, bins, min, max)", forms: [["x", "bins", "min", "max"]], description: "counts the elements of flatten(x) in bins equal-width bins over [min, max]", details: "", params: {"bins": "number of equal-width bins", "min": "lower edge of the first bin", "max": "upper edge of the last bin"}, aliases: ["histogram"] },
|
||||
"overlay": { minArgs: 3, maxArgs: 4, signature: "overlay(base, overlay, offset, [opacity])", forms: [["base", "overlay", "offset", "[opacity]"]], description: "overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.", details: "", params: {"offset": "position of the overlay's low corner in base, one value per dimension", "opacity": "0-1 blend amount; a number or a tensor shaped like overlay (default: 1)"}, aliases: [] },
|
||||
"pad": { minArgs: 2, maxArgs: 2, signature: "pad(x, padding)", forms: [["x", "padding"]], description: "pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)", details: "", params: {"padding": "amounts as [dim0_before, dim0_after, dim1_before, dim1_after, ...]"}, aliases: [] },
|
||||
"cross": { minArgs: 2, maxArgs: 2, signature: "cross(x, y)", forms: [["x", "y"]], description: "computes the cross product of x and y. Last dimension must be 3", details: "", params: {}, aliases: [] },
|
||||
"matmul": { minArgs: 2, maxArgs: 2, signature: "matmul(x, y)", forms: [["x", "y"]], description: "computes the matrix multiplication of x and y", details: "", params: {}, aliases: [] },
|
||||
"solve": { minArgs: 2, maxArgs: 2, signature: "solve(A, b)", forms: [["A", "b"]], description: "solves the square linear system A*x=b without explicitly forming A inverse", details: "", params: {"A": "square coefficient matrix", "b": "right-hand side"}, aliases: [] },
|
||||
"matrix_rank": { minArgs: 1, maxArgs: 2, signature: "matrix_rank(x, [tol])", forms: [["x", "[tol]"]], description: "computes the numerical rank of each matrix using optional absolute tolerance tol", details: "", params: {"tol": "absolute tolerance below which singular values count as zero"}, aliases: [] },
|
||||
"rife": { minArgs: 2, maxArgs: 5, signature: "rife(image1, image2, [tiling_size], [iterations], [multi_scale])", forms: [["image1", "image2", "[tiling_size]", "[iterations]", "[multi_scale]"]], description: "computes the optical flow field ([H, W, 2]) between image1 and image2 using a RAFT-based model", details: "", params: {"tiling_size": "splits the image to overlapping tiling_size*tiling_size parts to conserve memory. Default is 0 (auto: enables 1024x1024 tiling when over 2MPx). When tiling_size is between 0 - 1 it takes as a fraction of the resolution", "iterations": "how many times to run the flow model. Default 12", "multi_scale": "also use low resolution of base image for giant movements. Default false"}, aliases: [] },
|
||||
"bnot": { minArgs: 1, maxArgs: 1, signature: "bnot(x)", forms: [["x"]], description: "computes the bitwise NOT", details: "", params: {}, aliases: ["bitwise_not"] },
|
||||
"bitwise_not": { minArgs: 1, maxArgs: 1, signature: "bitwise_not(x)", forms: [["x"]], description: "computes the bitwise NOT", details: "", params: {}, aliases: ["bnot"] },
|
||||
"bitcount": { minArgs: 1, maxArgs: 1, signature: "bitcount(x)", forms: [["x"]], description: "returns the number of set bits", details: "", params: {}, aliases: ["popcount", "popcnt"] },
|
||||
"popcount": { minArgs: 1, maxArgs: 1, signature: "popcount(x)", forms: [["x"]], description: "returns the number of set bits", details: "", params: {}, aliases: ["bitcount", "popcnt"] },
|
||||
"popcnt": { minArgs: 1, maxArgs: 1, signature: "popcnt(x)", forms: [["x"]], description: "returns the number of set bits", details: "", params: {}, aliases: ["bitcount", "popcount"] },
|
||||
"shape": { minArgs: 1, maxArgs: 1, signature: "shape(x)", forms: [["x"]], description: "returns the shape of tensor as a list", details: "", params: {}, aliases: [] },
|
||||
"band": { minArgs: 2, maxArgs: 2, signature: "band(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise AND of x and y", details: "", params: {}, aliases: ["bitwise_and"] },
|
||||
"bitwise_and": { minArgs: 2, maxArgs: 2, signature: "bitwise_and(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise AND of x and y", details: "", params: {}, aliases: ["band"] },
|
||||
"bxor": { minArgs: 2, maxArgs: 2, signature: "bxor(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise XOR of x and y", details: "", params: {}, aliases: ["bitwise_xor"] },
|
||||
"bitwise_xor": { minArgs: 2, maxArgs: 2, signature: "bitwise_xor(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise XOR of x and y", details: "", params: {}, aliases: ["bxor"] },
|
||||
"bor": { minArgs: 2, maxArgs: 2, signature: "bor(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise OR of x and y", details: "", params: {}, aliases: ["bitwise_or"] },
|
||||
"bitwise_or": { minArgs: 2, maxArgs: 2, signature: "bitwise_or(x, y)", forms: [["x", "y"]], description: "computes the element-wise bitwise OR of x and y", details: "", params: {}, aliases: ["bor"] },
|
||||
"tensor": { minArgs: 1, maxArgs: 3, signature: "tensor(shape, [value], [dtype_template])", forms: [["shape", "[value]", "[dtype_template]"]], description: "creates a tensor with specified shape and optional value/type. Default value is 0 and default format FP32", details: "", params: {"shape": "list of dimension sizes", "value": "fill value (default: 0)", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, aliases: [] },
|
||||
"zeros": { minArgs: 1, maxArgs: 2, signature: "zeros(shape, [dtype_template])", forms: [["shape", "[dtype_template]"]], description: "creates a zero-filled tensor on the current device", details: "", params: {"shape": "list of dimension sizes", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, aliases: [] },
|
||||
"ones": { minArgs: 1, maxArgs: 2, signature: "ones(shape, [dtype_template])", forms: [["shape", "[dtype_template]"]], description: "creates a one-filled tensor on the current device", details: "", params: {"shape": "list of dimension sizes", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, aliases: [] },
|
||||
"eye": { minArgs: 1, maxArgs: 2, signature: "eye(n, [dtype_template])", forms: [["n", "[dtype_template]"]], description: "creates an n-by-n identity matrix", details: "", params: {"n": "number of rows and columns", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, aliases: [] },
|
||||
"one_hot": { minArgs: 2, maxArgs: 2, signature: "one_hot(indices, classes)", forms: [["indices", "classes"]], description: "converts integer class indices to float32 one-hot vectors", details: "", params: {"indices": "integer class indices", "classes": "number of classes, i.e. the length of each one-hot vector"}, aliases: [] },
|
||||
"mse": { minArgs: 2, maxArgs: 3, signature: "mse(a, b, [reduction])", forms: [["a", "b", "[reduction]"]], description: "mean squared error; reduction is mean (default), sum, or none", details: "", params: {"reduction": "\"mean\" (default), \"sum\", or \"none\" for element-wise values"}, aliases: [] },
|
||||
"mae": { minArgs: 2, maxArgs: 3, signature: "mae(a, b, [reduction])", forms: [["a", "b", "[reduction]"]], description: "mean absolute error; reduction is mean (default), sum, or none", details: "", params: {"reduction": "\"mean\" (default), \"sum\", or \"none\" for element-wise values"}, aliases: [] },
|
||||
"psnr": { minArgs: 2, maxArgs: 3, signature: "psnr(a, b, [data_range])", forms: [["a", "b", "[data_range]"]], description: "peak signal-to-noise ratio in dB; data_range defaults to 1", details: "", params: {"data_range": "difference between the largest and smallest possible value (default: 1)"}, aliases: [] },
|
||||
"weighted_mean": { minArgs: 2, maxArgs: 3, signature: "weighted_mean(x, weights, [dims])", forms: [["x", "weights", "[dims]"]], description: "computes the weighted mean globally or along one or more dimensions", details: "", params: {"weights": "weight of each element, broadcast against x", "dims": "dimension or list of dimensions to reduce (default: all elements)"}, aliases: [] },
|
||||
"huber_loss": { minArgs: 2, maxArgs: 4, signature: "huber_loss(prediction, target, [delta], [reduction])", forms: [["prediction", "target", "[delta]", "[reduction]"]], description: "computes Huber loss; delta defaults to 1 and reduction to mean", details: "", params: {"delta": "error size where the loss changes from quadratic to linear (default: 1)", "reduction": "\"mean\" (default), \"sum\", or \"none\" for element-wise values"}, aliases: [] },
|
||||
"cross_entropy": { minArgs: 2, maxArgs: 4, signature: "cross_entropy(logits, target, [dim], [reduction])", forms: [["logits", "target", "[dim]", "[reduction]"]], description: "computes cross-entropy from class logits and class indices or target probabilities", details: "", params: {"logits": "unnormalised class scores", "target": "class indices, or class probabilities with the same shape as logits", "dim": "class dimension (default: 1, or 0 for a single vector)", "reduction": "\"mean\" (default), \"sum\", or \"none\" for element-wise values"}, aliases: [] },
|
||||
"add_key": { minArgs: 3, maxArgs: 3, signature: "add_key(dict, key, value)", forms: [["dict", "key", "value"]], description: "adds or replaces a dictionary entry and returns the updated dictionary", details: "", params: {}, aliases: [] },
|
||||
"remove_key": { minArgs: 2, maxArgs: 2, signature: "remove_key(dict, key)", forms: [["dict", "key"]], description: "removes a dictionary entry and returns the updated dictionary", details: "", params: {}, aliases: ["rm_key"] },
|
||||
"rm_key": { minArgs: 2, maxArgs: 2, signature: "rm_key(dict, key)", forms: [["dict", "key"]], description: "removes a dictionary entry and returns the updated dictionary", details: "", params: {}, aliases: ["remove_key"] },
|
||||
"stack_push": { minArgs: 2, maxArgs: 2, signature: "stack_push(slot, val)", forms: [["slot", "val"]], description: "pushes val onto the end of slot stack", details: "", params: {"slot": "stack number (any integer)", "val": "value to push; it is also returned"}, aliases: [] },
|
||||
"stack_pop": { minArgs: 1, maxArgs: 1, signature: "stack_pop(slot)", forms: [["slot"]], description: "removes and returns the last element of slot stack", details: "", params: {}, aliases: [] },
|
||||
"stack_clear": { minArgs: 1, maxArgs: 1, signature: "stack_clear(slot)", forms: [["slot"]], description: "clears the contents of slot stack", details: "", params: {}, aliases: [] },
|
||||
"stack_has": { minArgs: 1, maxArgs: 1, signature: "stack_has(slot)", forms: [["slot"]], description: "returns 1.0 if slot exists in stack and is not empty else returns 0.0", details: "", params: {}, aliases: [] },
|
||||
"stack_get": { minArgs: 1, maxArgs: 1, signature: "stack_get(slot)", forms: [["slot"]], description: "returns the last pushed value in slot without popping it", details: "", params: {}, aliases: [] },
|
||||
"cat": { minArgs: 2, maxArgs: null, signature: "cat(x, ..., dim)", forms: [["x", "...", "dim"]], description: "concatenates one or more tensors along the specified dimension", details: "", params: {"dim": "dimension to join along (the last argument)"}, aliases: ["concat", "concatenate"] },
|
||||
"concat": { minArgs: 2, maxArgs: null, signature: "concat(x, ..., dim)", forms: [["x", "...", "dim"]], description: "concatenates one or more tensors along the specified dimension", details: "", params: {"dim": "dimension to join along (the last argument)"}, aliases: ["cat", "concatenate"] },
|
||||
"concatenate": { minArgs: 2, maxArgs: null, signature: "concatenate(x, ..., dim)", forms: [["x", "...", "dim"]], description: "concatenates one or more tensors along the specified dimension", details: "", params: {"dim": "dimension to join along (the last argument)"}, aliases: ["cat", "concat"] },
|
||||
"stack": { minArgs: 1, maxArgs: 2, signature: "stack(tensors, [dim])", forms: [["tensors", "[dim]"]], description: "stacks a list of tensors along a new dimension", details: "", params: {"tensors": "list of tensors with equal shapes", "dim": "position of the new dimension (default: 0)"}, aliases: [] },
|
||||
"nonzero": { minArgs: 1, maxArgs: 1, signature: "nonzero(x)", forms: [["x"]], description: "returns an N-by-rank tensor of coordinates for nonzero elements", details: "", params: {}, aliases: [] },
|
||||
"int": { minArgs: 1, maxArgs: 1, signature: "int(x)", forms: [["x"]], description: "casts x to integer", details: "", params: {}, aliases: [] },
|
||||
"float": { minArgs: 1, maxArgs: 1, signature: "float(x)", forms: [["x"]], description: "casts x to float", details: "", params: {}, aliases: [] },
|
||||
"upper": { minArgs: 1, maxArgs: 1, signature: "upper(x)", forms: [["x"]], description: "converts string to uppercase", details: "", params: {}, aliases: [] },
|
||||
"lower": { minArgs: 1, maxArgs: 1, signature: "lower(x)", forms: [["x"]], description: "converts string to lowercase", details: "", params: {}, aliases: [] },
|
||||
"trim": { minArgs: 1, maxArgs: 1, signature: "trim(x)", forms: [["x"]], description: "removes leading and trailing whitespace from string", details: "", params: {}, aliases: [] },
|
||||
"split": { minArgs: 1, maxArgs: 2, signature: "split(x, [delimiter])", forms: [["x", "[delimiter]"]], description: "splits string to list of strings based on delimiter. Default is space.", details: "", params: {"delimiter": "text to split on (default: a space)"}, aliases: [] },
|
||||
"join": { minArgs: 1, maxArgs: 2, signature: "join(x, [separator])", forms: [["x", "[separator]"]], description: "joins the items of list x as text using separator (default \"\"). Use concatenate(...) to join tensors", details: "", params: {"separator": "text placed between the items (default: \"\")"}, aliases: [] },
|
||||
"substring": { minArgs: 2, maxArgs: 3, signature: "substring(s, start, [length])", forms: [["s", "start", "[length]"]], description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string", details: "", params: {"start": "index of the first character", "length": "number of characters (default: the rest of the text)"}, aliases: ["substr"] },
|
||||
"substr": { minArgs: 2, maxArgs: 3, signature: "substr(s, start, [length])", forms: [["s", "start", "[length]"]], description: "returns length characters of s starting at start. If length is not supplied, it returns the rest of the string", details: "", params: {"start": "index of the first character", "length": "number of characters (default: the rest of the text)"}, aliases: ["substring"] },
|
||||
"find": { minArgs: 2, maxArgs: 2, signature: "find(s, sub)", forms: [["s", "sub"]], description: "returns the index of the first occurrence of sub in s. -1 if not found. Works only for strings.", details: "", params: {}, aliases: [] },
|
||||
"replace": { minArgs: 3, maxArgs: 3, signature: "replace(s, old, new)", forms: [["s", "old", "new"]], description: "replaces occurrences of old with new in s. Mostly for strings but can work with lists and tensors.", details: "", params: {"old": "text or value to look for", "new": "replacement"}, aliases: [] },
|
||||
"dilate": { minArgs: 1, maxArgs: 2, signature: "dilate(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological dilation to x with a square kernel (default size 3).", details: "", params: {"kernel_size": "size of the square kernel (default: 3)"}, aliases: [] },
|
||||
"erode": { minArgs: 1, maxArgs: 2, signature: "erode(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological erosion to x with a square kernel (default size 3).", details: "", params: {"kernel_size": "size of the square kernel (default: 3)"}, aliases: [] },
|
||||
"morph_open": { minArgs: 1, maxArgs: 2, signature: "morph_open(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological opening (erosion then dilation) to x with a square kernel (default size 3).", details: "", params: {"kernel_size": "size of the square kernel (default: 3)"}, aliases: [] },
|
||||
"morph_close": { minArgs: 1, maxArgs: 2, signature: "morph_close(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological closing (dilation then erosion) to x with a square kernel (default size 3).", details: "", params: {"kernel_size": "size of the square kernel (default: 3)"}, aliases: [] },
|
||||
"rgb_to_oklab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_oklab(rgb) / rgb_to_oklab(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "converts 0-1 sRGB to OKLab. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result", details: "", params: {}, aliases: [] },
|
||||
"rgb_to_cielab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_cielab(rgb) / rgb_to_cielab(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "converts 0-1 sRGB to CIELAB (D65) divided by 100, so L is 0-1. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result", details: "", params: {}, aliases: [] },
|
||||
"oklab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)", forms: [["oklab"], ["l", "a", "b"]], description: "converts OKLab to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result", details: "", params: {}, aliases: [] },
|
||||
"cielab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)", forms: [["cielab"], ["l", "a", "b"]], description: "converts CIELAB divided by 100 (as returned by rgb_to_cielab) to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result", details: "", params: {}, aliases: [] },
|
||||
"rgb_to_hsv": { minArgs: 1, maxArgs: 4, signature: "rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees])", forms: [["rgb", "[degrees]"], ["r", "g", "b", "[degrees]"]], description: "converts RGB to HSV. With one color argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is 0-360 instead of 0-1", details: "", params: {"degrees": "truthy to use hue in 0-360 instead of 0-1"}, aliases: [] },
|
||||
"hsv_to_rgb": { minArgs: 1, maxArgs: 4, signature: "hsv_to_rgb(hsv, [degrees]) / hsv_to_rgb(h, s, v, [degrees])", forms: [["hsv", "[degrees]"], ["h", "s", "v", "[degrees]"]], description: "converts HSV to RGB. With one color argument its last dimension holds H, S, V; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is read as 0-360 instead of 0-1", details: "", params: {"degrees": "truthy to use hue in 0-360 instead of 0-1"}, aliases: [] },
|
||||
"int_to_rgb": { minArgs: 1, maxArgs: 1, signature: "int_to_rgb(val)", forms: [["val"]], description: "unpacks 0xRRGGBB integers into 0-1 RGB colors. Tensors get R, G, B stacked in a new last dimension, lists return a list of colors and a number returns a 3-item list", details: "", params: {}, aliases: [] },
|
||||
"rgb_to_int": { minArgs: 1, maxArgs: 3, signature: "rgb_to_int(rgb) / rgb_to_int(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "packs 0-1 RGB components into 0xRRGGBB integers. With one argument the last dimension (or a 3-item list) holds R, G, B; with three, each argument is one channel", details: "", params: {}, aliases: [] },
|
||||
"interpolate_linear": { minArgs: 2, maxArgs: 2, signature: "interpolate_linear(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with (bi/tri)linear interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", params: {"scale": "a number scales every spatial dimension; a list gives the target spatial size"}, aliases: [] },
|
||||
"interpolate_area": { minArgs: 2, maxArgs: 2, signature: "interpolate_area(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with area interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", params: {"scale": "a number scales every spatial dimension; a list gives the target spatial size"}, aliases: [] },
|
||||
"interpolate_nearest": { minArgs: 2, maxArgs: 2, signature: "interpolate_nearest(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", params: {"scale": "a number scales every spatial dimension; a list gives the target spatial size"}, aliases: ["interpolate_nearest_exact"] },
|
||||
"interpolate_nearest_exact": { minArgs: 2, maxArgs: 2, signature: "interpolate_nearest_exact(x, scale)", forms: [["x", "scale"]], description: "resizes x [N, C, ...] with nearest-neighbour interpolation. A number scales every spatial dimension; a list is the target spatial size", details: "", params: {"scale": "a number scales every spatial dimension; a list gives the target spatial size"}, aliases: ["interpolate_nearest"] },
|
||||
"text_image": { minArgs: 3, maxArgs: 9, signature: "text_image(text, font, size, [max_width], [weight], [rotation_angle], [line_spacing], [italic], [underline])", forms: [["text", "font", "size", "[max_width]", "[weight]", "[rotation_angle]", "[line_spacing]", "[italic]", "[underline]"]], description: "renders text to a 2D tensor with values 0-1", details: "", params: {"font": "font name to look up in the system fonts, or a path to a font file", "size": "font size in pixels", "max_width": "wrap lines wider than this many pixels (default: 0, no wrapping)", "weight": "font weight 100-900 as in CSS (default: 400)", "rotation_angle": "rotation in degrees, counter-clockwise (default: 0)", "line_spacing": "line distance as a multiple of the line height (default: 1)", "italic": "truthy for italic text (default: false)", "underline": "truthy to underline the text (default: false)"}, aliases: [] },
|
||||
"as_nested_tensor": { minArgs: 1, maxArgs: 1, signature: "as_nested_tensor(x)", forms: [["x"]], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", params: {}, aliases: ["as_nested"] },
|
||||
"as_nested": { minArgs: 1, maxArgs: 1, signature: "as_nested(x)", forms: [["x"]], description: "converts a list to a nested tensor (special object containing tensors of different shapes behaving like a tensor)", details: "", params: {}, aliases: ["as_nested_tensor"] },
|
||||
"svd": { minArgs: 1, maxArgs: 2, signature: "svd(x, [full_matrices])", forms: [["x", "[full_matrices]"]], description: "computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)", details: "", params: {"full_matrices": "truthy to return full-size U and Vh (default: false)"}, aliases: ["singular_value_decomposition"] },
|
||||
"singular_value_decomposition": { minArgs: 1, maxArgs: 2, signature: "singular_value_decomposition(x, [full_matrices])", forms: [["x", "[full_matrices]"]], description: "computes the singular value decomposition of x. Returns a list of 3 tensors U, S, Vh such that x = matmul(matmul(U, diagonal_matrix(S, shape(U))), Vh)", details: "", params: {"full_matrices": "truthy to return full-size U and Vh (default: false)"}, aliases: ["svd"] },
|
||||
"diagonal_matrix": { minArgs: 2, maxArgs: 5, signature: "diagonal_matrix(x, shape, [offset], [dim1], [dim2])", forms: [["x", "shape", "[offset]", "[dim1]", "[dim2]"]], description: "creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.", details: "", params: {"shape": "shape of the result", "offset": "diagonal offset: positive above, negative below the main diagonal (default: 0)", "dim1": "first dimension of the matrix (default: -2)", "dim2": "second dimension of the matrix (default: -1)"}, aliases: ["diag"] },
|
||||
"diag": { minArgs: 2, maxArgs: 5, signature: "diag(x, shape, [offset], [dim1], [dim2])", forms: [["x", "shape", "[offset]", "[dim1]", "[dim2]"]], description: "creates a diagonal matrix from x with specified shape. offset is the diagonal offset. dim1 and dim2 are the dimensions to place the diagonal on.", details: "", params: {"shape": "shape of the result", "offset": "diagonal offset: positive above, negative below the main diagonal (default: 0)", "dim1": "first dimension of the matrix (default: -2)", "dim2": "second dimension of the matrix (default: -1)"}, aliases: ["diagonal_matrix"] },
|
||||
"timestamp": { minArgs: 0, maxArgs: 0, signature: "timestamp()", forms: [[]], description: "returns the current system timestamp", details: "", params: {}, aliases: ["now"] },
|
||||
"now": { minArgs: 0, maxArgs: 0, signature: "now()", forms: [[]], description: "returns the current system timestamp", details: "", params: {}, aliases: ["timestamp"] },
|
||||
"sort": { minArgs: 1, maxArgs: 3, signature: "sort(x, [descending], [dim])", forms: [["x", "[descending]", "[dim]"]], description: "returns x sorted ascending, or descending when descending is truthy. Tensors are sorted along dim (default: last dimension); lists use Python sorting", details: "", params: {"descending": "truthy to sort from largest to smallest (default: false)", "dim": "dimension to sort along (default: last)"}, aliases: [] },
|
||||
"argsort": { minArgs: 1, maxArgs: 3, signature: "argsort(x, [descending], [dim])", forms: [["x", "[descending]", "[dim]"]], description: "returns the indices that would sort x. descending defaults to false and dim defaults to the last dimension.", details: "", params: {"descending": "truthy to sort from largest to smallest (default: false)", "dim": "dimension to sort along (default: last)"}, aliases: [] },
|
||||
"argmin": { minArgs: 1, maxArgs: 3, signature: "argmin(x, [as_position], [dim])", forms: [["x", "[as_position]", "[dim]"]], description: "returns the minimum index globally or along dim; as_position returns global coordinates", details: "", params: {"as_position": "truthy to return the coordinates of the minimum instead of a flat index", "dim": "dimension to search along; cannot be combined with as_position"}, aliases: [] },
|
||||
"argmax": { minArgs: 1, maxArgs: 3, signature: "argmax(x, [as_position], [dim])", forms: [["x", "[as_position]", "[dim]"]], description: "returns the maximum index globally or along dim; as_position returns global coordinates", details: "", params: {"as_position": "truthy to return the coordinates of the maximum instead of a flat index", "dim": "dimension to search along; cannot be combined with as_position"}, aliases: [] },
|
||||
"softmax": { minArgs: 1, maxArgs: 2, signature: "softmax(x, [dim])", forms: [["x", "[dim]"]], description: "applies the softmax function to x (each slice sums to 1.0). dim defaults to the last dimension.", details: "", params: {"dim": "dimension whose slices sum to 1 (default: last)"}, aliases: [] },
|
||||
"softmin": { minArgs: 1, maxArgs: 2, signature: "softmin(x, [dim])", forms: [["x", "[dim]"]], description: "applies the softmin function to x (same as softmax(-x, [dim])). dim defaults to the last dimension.", details: "", params: {"dim": "dimension whose slices sum to 1 (default: last)"}, aliases: [] },
|
||||
"unique": { minArgs: 1, maxArgs: 1, signature: "unique(x)", forms: [["x"]], description: "returns the sorted unique elements of x (tensors are flattened first)", details: "", params: {}, aliases: [] },
|
||||
"flip": { minArgs: 2, maxArgs: 2, signature: "flip(x, dims)", forms: [["x", "dims"]], description: "reverses the order of elements along the specified dimensions. Text is reversed as a whole", details: "", params: {"dims": "dimension or list of dimensions to reverse"}, aliases: [] },
|
||||
"startswith": { minArgs: 2, maxArgs: 2, signature: "startswith(text, prefix)", forms: [["text", "prefix"]], description: "returns 1 if text starts with prefix, else 0", details: "", params: {}, aliases: [] },
|
||||
"endswith": { minArgs: 2, maxArgs: 2, signature: "endswith(text, suffix)", forms: [["text", "suffix"]], description: "returns 1 if text ends with suffix, else 0", details: "", params: {}, aliases: [] },
|
||||
"squeeze": { minArgs: 1, maxArgs: 2, signature: "squeeze(x, [dim])", forms: [["x", "[dim]"]], description: "removes size-1 dimensions from tensor x, optionally at dim", details: "", params: {"dim": "only remove this dimension, if it has size 1"}, aliases: [] },
|
||||
"unsqueeze": { minArgs: 2, maxArgs: 2, signature: "unsqueeze(x, dim)", forms: [["x", "dim"]], description: "inserts a size-1 dimension into tensor x at dim", details: "", params: {"dim": "position of the new size-1 dimension"}, aliases: [] },
|
||||
"roll": { minArgs: 2, maxArgs: 3, signature: "roll(x, shifts, [dim])", forms: [["x", "shifts", "[dim]"]], description: "circularly shifts tensor x along dim (default 0)", details: "", params: {"shifts": "number of places to shift; elements pushed off one end come back at the other", "dim": "dimension to shift along (default: 0)"}, aliases: [] },
|
||||
"cov": { minArgs: 2, maxArgs: 2, signature: "cov(x, y)", forms: [["x", "y"]], description: "computes the sample covariance of the flattened x and y (which must have the same number of elements)", details: "", params: {}, aliases: [] },
|
||||
"corr": { minArgs: 2, maxArgs: 2, signature: "corr(x, y)", forms: [["x", "y"]], description: "computes the Pearson correlation coefficient between x and y", details: "", params: {}, aliases: ["correlation"] },
|
||||
"correlation": { minArgs: 2, maxArgs: 2, signature: "correlation(x, y)", forms: [["x", "y"]], description: "computes the Pearson correlation coefficient between x and y", details: "", params: {}, aliases: ["corr"] },
|
||||
"entropy": { minArgs: 1, maxArgs: 1, signature: "entropy(x)", forms: [["x"]], description: "computes the Shannon entropy (in nats) of softmax(x), i.e. x is treated as logits over all of its elements", details: "", params: {}, aliases: [] },
|
||||
"crop": { minArgs: 3, maxArgs: 3, signature: "crop(x, start, size)", forms: [["x", "start", "size"]], description: "crops the region of x beginning at start (the low corner). The result always has shape size; parts outside x are zero-filled. On text, returns at most size characters", details: "", params: {"start": "low corner of the region, one index per dimension", "size": "size of the result, one value per dimension"}, aliases: [] },
|
||||
"coords": { minArgs: 2, maxArgs: 3, signature: "coords(shape, dim, [dtype_template])", forms: [["shape", "dim", "[dtype_template]"]], description: "generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).", details: "", params: {"shape": "list of dimension sizes", "dim": "dimension whose index becomes the value", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, aliases: ["coordinates"] },
|
||||
"coordinates": { minArgs: 2, maxArgs: 3, signature: "coordinates(shape, dim, [dtype_template])", forms: [["shape", "dim", "[dtype_template]"]], description: "generates a tensor with the specified shape whose values are the coordinates of each element along dim. An optional tensor supplies the output dtype (default float32).", details: "", params: {"shape": "list of dimension sizes", "dim": "dimension whose index becomes the value", "dtype_template": "tensor whose dtype the result uses (default: float32)"}, aliases: ["coords"] },
|
||||
"gather": { minArgs: 3, maxArgs: 3, signature: "gather(x, dim, idx)", forms: [["x", "dim", "idx"]], description: "gathers elements along dim using the indices specified in idx. The output tensor has the same shape as idx.", details: "", params: {"dim": "dimension to gather along", "idx": "indices along dim; the result has the shape of idx"}, aliases: [] },
|
||||
"scatter": { minArgs: 4, maxArgs: 4, signature: "scatter(x, dim, idx, src)", forms: [["x", "dim", "idx", "src"]], description: "scatters elements from src into x along dim using the indices specified in idx. The output tensor has the same shape as x.", details: "", params: {"dim": "dimension to scatter along", "idx": "position along dim for each element of src", "src": "values to write"}, aliases: [] },
|
||||
"scatter_add": { minArgs: 4, maxArgs: 4, signature: "scatter_add(x, dim, idx, src)", forms: [["x", "dim", "idx", "src"]], description: "scatters elements from src into x along dim using the indices specified in idx, adding to existing values. The output tensor has the same shape as x.", details: "", params: {"dim": "dimension to scatter along", "idx": "position along dim for each element of src", "src": "values to add"}, aliases: [] },
|
||||
"noise": { minArgs: 1, maxArgs: 2, signature: "noise(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates normally distributed random noise", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randn", "random_normal"] },
|
||||
"randn": { minArgs: 1, maxArgs: 2, signature: "randn(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates normally distributed random noise", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["noise", "random_normal"] },
|
||||
"random_normal": { minArgs: 1, maxArgs: 2, signature: "random_normal(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates normally distributed random noise", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["noise", "randn"] },
|
||||
"pink_noise": { minArgs: 1, maxArgs: 2, signature: "pink_noise(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic pink noise (approximately 1/f power spectrum) with zero mean and unit variance per row", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["pink"] },
|
||||
"pink": { minArgs: 1, maxArgs: 2, signature: "pink(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic pink noise (approximately 1/f power spectrum) with zero mean and unit variance per row", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["pink_noise"] },
|
||||
"brown_noise": { minArgs: 1, maxArgs: 2, signature: "brown_noise(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic brown noise (approximately 1/f^2 power spectrum) with zero mean and unit variance per row", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["brown"] },
|
||||
"brown": { minArgs: 1, maxArgs: 2, signature: "brown(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates deterministic brown noise (approximately 1/f^2 power spectrum) with zero mean and unit variance per row", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["brown_noise"] },
|
||||
"rand": { minArgs: 1, maxArgs: 2, signature: "rand(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates uniformly distributed random noise", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randu", "random_uniform"] },
|
||||
"randu": { minArgs: 1, maxArgs: 2, signature: "randu(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates uniformly distributed random noise", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["rand", "random_uniform"] },
|
||||
"random_uniform": { minArgs: 1, maxArgs: 2, signature: "random_uniform(seed, [shape])", forms: [["seed", "[shape]"]], description: "generates uniformly distributed random noise", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["rand", "randu"] },
|
||||
"randc": { minArgs: 3, maxArgs: 4, signature: "randc(seed, median, sigma, [shape])", forms: [["seed", "median", "sigma", "[shape]"]], description: "generates Cauchy distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "median": "centre of the distribution", "sigma": "half width at half maximum", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_cauchy"] },
|
||||
"random_cauchy": { minArgs: 3, maxArgs: 4, signature: "random_cauchy(seed, median, sigma, [shape])", forms: [["seed", "median", "sigma", "[shape]"]], description: "generates Cauchy distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "median": "centre of the distribution", "sigma": "half width at half maximum", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randc"] },
|
||||
"rande": { minArgs: 2, maxArgs: 3, signature: "rande(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates exponentially distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "lambda": "rate; the mean is 1 / lambda", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_exponential"] },
|
||||
"random_exponential": { minArgs: 2, maxArgs: 3, signature: "random_exponential(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates exponentially distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "lambda": "rate; the mean is 1 / lambda", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["rande"] },
|
||||
"randln": { minArgs: 3, maxArgs: 4, signature: "randln(seed, mean, std, [shape])", forms: [["seed", "mean", "std", "[shape]"]], description: "generates log-normally distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "mean": "mean of the underlying normal distribution", "std": "standard deviation of the underlying normal distribution", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_log_normal"] },
|
||||
"random_log_normal": { minArgs: 3, maxArgs: 4, signature: "random_log_normal(seed, mean, std, [shape])", forms: [["seed", "mean", "std", "[shape]"]], description: "generates log-normally distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "mean": "mean of the underlying normal distribution", "std": "standard deviation of the underlying normal distribution", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randln"] },
|
||||
"randb": { minArgs: 2, maxArgs: 3, signature: "randb(seed, probability, [shape])", forms: [["seed", "probability", "[shape]"]], description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor", details: "", params: {"seed": "random seed; the same seed always gives the same values", "probability": "chance of a 1; a tensor gives one probability per element and sets the shape", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_bernoulli"] },
|
||||
"random_bernoulli": { minArgs: 2, maxArgs: 3, signature: "random_bernoulli(seed, probability, [shape])", forms: [["seed", "probability", "[shape]"]], description: "generates Bernoulli distributed random values (0 or 1). Probability can be a tensor", details: "", params: {"seed": "random seed; the same seed always gives the same values", "probability": "chance of a 1; a tensor gives one probability per element and sets the shape", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randb"] },
|
||||
"randp": { minArgs: 2, maxArgs: 3, signature: "randp(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates Poisson distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "lambda": "expected count; a tensor gives one rate per element and sets the shape", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_poisson"] },
|
||||
"random_poisson": { minArgs: 2, maxArgs: 3, signature: "random_poisson(seed, lambda, [shape])", forms: [["seed", "lambda", "[shape]"]], description: "generates Poisson distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "lambda": "expected count; a tensor gives one rate per element and sets the shape", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randp"] },
|
||||
"randg": { minArgs: 3, maxArgs: 4, signature: "randg(seed, shape_param, scale, [shape])", forms: [["seed", "shape_param", "scale", "[shape]"]], description: "generates Gamma distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape_param": "shape (concentration) k", "scale": "scale theta; the mean is k * theta", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_gamma"] },
|
||||
"random_gamma": { minArgs: 3, maxArgs: 4, signature: "random_gamma(seed, shape_param, scale, [shape])", forms: [["seed", "shape_param", "scale", "[shape]"]], description: "generates Gamma distributed random values.", details: "", params: {"seed": "random seed; the same seed always gives the same values", "shape_param": "shape (concentration) k", "scale": "scale theta; the mean is k * theta", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randg"] },
|
||||
"randbeta": { minArgs: 3, maxArgs: 4, signature: "randbeta(seed, alpha, beta, [shape])", forms: [["seed", "alpha", "beta", "[shape]"]], description: "generates Beta distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "alpha": "first concentration", "beta": "second concentration", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_beta"] },
|
||||
"random_beta": { minArgs: 3, maxArgs: 4, signature: "random_beta(seed, alpha, beta, [shape])", forms: [["seed", "alpha", "beta", "[shape]"]], description: "generates Beta distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "alpha": "first concentration", "beta": "second concentration", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randbeta"] },
|
||||
"randl": { minArgs: 3, maxArgs: 4, signature: "randl(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Laplace distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "loc": "centre of the distribution", "scale": "spread (diversity)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_laplace"] },
|
||||
"random_laplace": { minArgs: 3, maxArgs: 4, signature: "random_laplace(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Laplace distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "loc": "centre of the distribution", "scale": "spread (diversity)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randl"] },
|
||||
"randgumbel": { minArgs: 3, maxArgs: 4, signature: "randgumbel(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Gumbel distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "loc": "mode of the distribution", "scale": "spread", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_gumbel"] },
|
||||
"random_gumbel": { minArgs: 3, maxArgs: 4, signature: "random_gumbel(seed, loc, scale, [shape])", forms: [["seed", "loc", "scale", "[shape]"]], description: "generates Gumbel distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "loc": "mode of the distribution", "scale": "spread", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randgumbel"] },
|
||||
"randw": { minArgs: 3, maxArgs: 4, signature: "randw(seed, scale, concentration, [shape])", forms: [["seed", "scale", "concentration", "[shape]"]], description: "generates Weibull distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "scale lambda", "concentration": "shape k", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_weibull"] },
|
||||
"random_weibull": { minArgs: 3, maxArgs: 4, signature: "random_weibull(seed, scale, concentration, [shape])", forms: [["seed", "scale", "concentration", "[shape]"]], description: "generates Weibull distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "scale lambda", "concentration": "shape k", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randw"] },
|
||||
"randchi2": { minArgs: 2, maxArgs: 3, signature: "randchi2(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Chi-squared distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "df": "degrees of freedom", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_chi2"] },
|
||||
"random_chi2": { minArgs: 2, maxArgs: 3, signature: "random_chi2(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Chi-squared distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "df": "degrees of freedom", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randchi2"] },
|
||||
"randt": { minArgs: 2, maxArgs: 3, signature: "randt(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Student-t distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "df": "degrees of freedom", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["random_studentt"] },
|
||||
"random_studentt": { minArgs: 2, maxArgs: 3, signature: "random_studentt(seed, df, [shape])", forms: [["seed", "df", "[shape]"]], description: "generates Student-t distributed random values", details: "", params: {"seed": "random seed; the same seed always gives the same values", "df": "degrees of freedom", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["randt"] },
|
||||
"perlin": { minArgs: 2, maxArgs: 5, signature: "perlin(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Perlin gradient noise in 0-1 (default 1 octave)", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "feature size in elements; larger values give smoother noise", "octaves": "number of detail layers, each half the size of the previous (default: 1)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["perlin_noise"] },
|
||||
"perlin_noise": { minArgs: 2, maxArgs: 5, signature: "perlin_noise(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Perlin gradient noise in 0-1 (default 1 octave)", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "feature size in elements; larger values give smoother noise", "octaves": "number of detail layers, each half the size of the previous (default: 1)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["perlin"] },
|
||||
"cellular": { minArgs: 2, maxArgs: 5, signature: "cellular(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "cell size in elements", "jitter": "0-1 randomness of the cell points (default: 0.5)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["voronoi", "worley", "cellular_noise", "voronoi_noise"] },
|
||||
"voronoi": { minArgs: 2, maxArgs: 5, signature: "voronoi(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "cell size in elements", "jitter": "0-1 randomness of the cell points (default: 0.5)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["cellular", "worley", "cellular_noise", "voronoi_noise"] },
|
||||
"worley": { minArgs: 2, maxArgs: 5, signature: "worley(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "cell size in elements", "jitter": "0-1 randomness of the cell points (default: 0.5)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["cellular", "voronoi", "cellular_noise", "voronoi_noise"] },
|
||||
"cellular_noise": { minArgs: 2, maxArgs: 5, signature: "cellular_noise(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "cell size in elements", "jitter": "0-1 randomness of the cell points (default: 0.5)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["cellular", "voronoi", "worley", "voronoi_noise"] },
|
||||
"voronoi_noise": { minArgs: 2, maxArgs: 5, signature: "voronoi_noise(seed, scale, [jitter], [offset], [shape])", forms: [["seed", "scale", "[jitter]", "[offset]", "[shape]"]], description: "generates Cellular/Voronoi noise in 0-1: distance to the nearest feature point (jitter 0-1, default 0.5)", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "cell size in elements", "jitter": "0-1 randomness of the cell points (default: 0.5)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["cellular", "voronoi", "worley", "cellular_noise"] },
|
||||
"plasma": { minArgs: 2, maxArgs: 5, signature: "plasma(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "feature size in elements; larger values give smoother noise", "octaves": "number of detail layers, each half the size of the previous (default: 4)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["turbulence", "plasma_noise"] },
|
||||
"turbulence": { minArgs: 2, maxArgs: 5, signature: "turbulence(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "feature size in elements; larger values give smoother noise", "octaves": "number of detail layers, each half the size of the previous (default: 4)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["plasma", "plasma_noise"] },
|
||||
"plasma_noise": { minArgs: 2, maxArgs: 5, signature: "plasma_noise(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates Plasma/Turbulence noise in 0-1 - same as perlin but default octaves 4", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "feature size in elements; larger values give smoother noise", "octaves": "number of detail layers, each half the size of the previous (default: 4)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["plasma", "turbulence"] },
|
||||
"ridged": { minArgs: 2, maxArgs: 5, signature: "ridged(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates ridged multi-fractal noise in 0-1 (default 4 octaves)", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "feature size in elements; larger values give smoother noise", "octaves": "number of detail layers, each half the size of the previous (default: 4)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["ridged_noise"] },
|
||||
"ridged_noise": { minArgs: 2, maxArgs: 5, signature: "ridged_noise(seed, scale, [octaves], [offset], [shape])", forms: [["seed", "scale", "[octaves]", "[offset]", "[shape]"]], description: "generates ridged multi-fractal noise in 0-1 (default 4 octaves)", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "feature size in elements; larger values give smoother noise", "octaves": "number of detail layers, each half the size of the previous (default: 4)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["ridged"] },
|
||||
"domain_warp": { minArgs: 4, maxArgs: 8, signature: "domain_warp(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])", forms: [["seed", "scale", "warp_scale", "warp_strength", "[octaves]", "[warp_octaves]", "[offset]", "[shape]"]], description: "generates domain warped Perlin noise in 0-1 (defaults: 4 octaves, 2 warp octaves)", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "feature size in elements; larger values give smoother noise", "warp_scale": "feature size of the warp field in elements", "warp_strength": "how far the warp field displaces the coordinates", "octaves": "detail layers of the base noise (default: 4)", "warp_octaves": "detail layers of the warp field (default: 2)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["domain_warp_noise"] },
|
||||
"domain_warp_noise": { minArgs: 4, maxArgs: 8, signature: "domain_warp_noise(seed, scale, warp_scale, warp_strength, [octaves], [warp_octaves], [offset], [shape])", forms: [["seed", "scale", "warp_scale", "warp_strength", "[octaves]", "[warp_octaves]", "[offset]", "[shape]"]], description: "generates domain warped Perlin noise in 0-1 (defaults: 4 octaves, 2 warp octaves)", details: "", params: {"seed": "random seed; the same seed always gives the same values", "scale": "feature size in elements; larger values give smoother noise", "warp_scale": "feature size of the warp field in elements", "warp_strength": "how far the warp field displaces the coordinates", "octaves": "detail layers of the base noise (default: 4)", "warp_octaves": "detail layers of the warp field (default: 2)", "offset": "shift of the sampling grid, one value per dimension (default: 0)", "shape": "output shape as a list (default: the shape of the node's input)"}, aliases: ["domain_warp"] },
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { app } from "/scripts/app.js";
|
||||
import { attachAutocomplete, escapeHtml, handleEditingKey, renderHighlight } from "./autocomplete.js";
|
||||
import { attachAutocomplete, escapeHtml, handleEditingKey, renderHighlight, EDITOR_SETTINGS } from "./autocomplete.js";
|
||||
|
||||
const STYLE_ID = "mrmth-script-line-numbers-unified";
|
||||
|
||||
@@ -242,7 +242,7 @@ if (!window.__mrmthScriptInputUnifiedInit) {
|
||||
textarea.autocorrect = "off";
|
||||
|
||||
// Autocomplete first: its keydown handler must run before the editing keys.
|
||||
const autocomplete = attachAutocomplete(textarea);
|
||||
const autocomplete = attachAutocomplete(textarea, (id) => app.extensionManager?.setting?.get(id));
|
||||
textarea.addEventListener("keydown", (e) => {
|
||||
if (handleEditingKey(textarea, e)) e.preventDefault();
|
||||
});
|
||||
@@ -306,6 +306,7 @@ if (!window.__mrmthScriptInputUnifiedInit) {
|
||||
|
||||
app.registerExtension({
|
||||
name: "mrmth.ScriptTextInput.Unified",
|
||||
settings: EDITOR_SETTINGS,
|
||||
nodeCreated(node) {
|
||||
if (node.comfyClass !== "mrmth_ScriptInput" && node.type !== "mrmth_ScriptInput") return;
|
||||
const widget = node.widgets?.find(w => w.name === "script");
|
||||
|
||||
Reference in New Issue
Block a user