ops
158 memberslucid.opsFunctions
neg→ TensorElement-wise negation.
abs→ Tensorsign→ TensorElement-wise sign function.
exp→ TensorElement-wise natural exponential.
log→ TensorElement-wise natural logarithm.
log2→ TensorElement-wise base-2 logarithm.
sqrt→ TensorElement-wise square root.
square→ TensorElement-wise square.
reciprocal→ TensorElement-wise multiplicative inverse.
floor→ TensorElement-wise floor (round toward $-\infty$).
ceil→ TensorElement-wise ceiling (round toward $+\infty$).
round→ Tensorsin→ TensorElement-wise sine (input in radians).
cos→ TensorElement-wise cosine (input in radians).
tan→ TensorElement-wise tangent (input in radians).
arcsin→ TensorElement-wise inverse sine in radians.
arccos→ TensorElement-wise inverse cosine in radians.
arctan→ TensorElement-wise inverse tangent in radians.
sinh→ TensorElement-wise hyperbolic sine.
cosh→ TensorElement-wise hyperbolic cosine.
tanh→ TensorElement-wise hyperbolic tangent.
relu→ TensorElement-wise rectified linear unit.
sigmoid→ TensorElement-wise logistic sigmoid.
ravel→ Tensorcontiguous→ TensorReturn a tensor with C-contiguous (row-major) memory layout.
add→ TensorElement-wise addition with broadcasting and dtype promotion.
sub→ TensorElement-wise subtraction with broadcasting and dtype promotion.
mul→ TensorElement-wise multiplication (Hadamard product) with broadcasting.
div→ TensorElement-wise true division with broadcasting and dtype promotion.
pow→ Tensormaximum→ TensorElement-wise maximum with broadcasting.
minimum→ TensorElement-wise minimum with broadcasting.
matmul→ TensorMatrix product with full broadcasting semantics.
cumsum→ TensorReturn the cumulative sum of elements along `dim`.
cumprod→ TensorReturn the cumulative product of elements along `dim`.
cummax→ Tensorcummin→ Tensorerf→ Tensorerfinv→ Tensortrace→ TensorReturn the sum of the diagonal entries of a 2-D tensor.
reshape→ TensorReshape a tensor to `shape`, returning a view when possible.
unsqueeze→ TensorInsert a new size-1 dimension at position `dim`.
flatten→ TensorCollapse a contiguous range of dimensions into a single dim.
permute→ TensorReturn a view with dimensions rearranged.
transpose→ TensorSwap the last two dimensions of `input`.
broadcast_to→ TensorBroadcast a tensor to a target shape as a *view*.
expand→ TensorReturn a view with singleton dimensions broadcast to new sizes.
tile→ TensorConstruct a tensor by repeating `input` `reps` times per axis.
flip→ TensorReverse the order of elements along the specified `dims`.
fliplr→ TensorFlip a 2-D-or-higher tensor left-to-right (along axis 1).
flipud→ TensorFlip a 1-D-or-higher tensor upside-down (along axis 0).
roll→ TensorCyclically shift the elements of `input` along `dims`.
tril→ TensorReturn the lower-triangular part of a 2-D-or-higher tensor.
triu→ TensorReturn the upper-triangular part of a 2-D-or-higher tensor.
pad→ TensorPad a tensor with the specified border widths.
gather→ TensorGather values along `dim` according to `indices`.
sort→ tuple of (Tensor, Tensor)Sort `input` along `dim` in ascending order and return values + indices.
argsort→ TensorReturn the indices that would sort `input` along `dim`.
nonzero→ TensorReturn the indices of all non-zero (or True) elements.
unique→ TensorReturn the sorted unique elements of `input`.
topk→ tuple of (Tensor, Tensor)Return the `k` largest values along `dim` and their indices.
diagonal→ TensorExtract a (off-)diagonal from each matrix in a batched input.
equal→ TensorElement-wise equality predicate.
not_equal→ TensorElement-wise inequality predicate.
greater→ TensorElement-wise strict greater-than predicate.
greater_equal→ TensorElement-wise greater-than-or-equal predicate.
less→ TensorElement-wise strict less-than predicate.
less_equal→ TensorElement-wise less-than-or-equal predicate.
where→ TensorElementwise selection between `x` and `y` based on `cond`.
masked_fill→ TensorReturn `input` with positions where `mask` is True set to `value`.
cat→ TensorConcatenate tensors along an existing dimension.
stack→ TensorStack tensors along a new dimension.
hstack→ TensorStack tensors horizontally (column-wise).
vstack→ TensorStack tensors vertically (row-wise).
chunk→ list of TensorSplit a tensor into `chunks` roughly equal pieces along `dim`.
unbind→ tuple of TensorRemove `dim` and return a tuple of views along it.
rsqrt→ TensorElement-wise reciprocal square root.
any→ Tensorall→ Tensorclip→ TensorElement-wise clamping to a closed interval.
isinf→ TensorElement-wise IEEE 754 infinity check.
isnan→ TensorElement-wise NaN check.
isfinite→ TensorElement-wise IEEE 754 finiteness check.
nan_to_num→ TensorReplace NaN, positive and negative infinity entries with finite values.
detach→ TensorReturn a tensor that shares data but is detached from the autograd graph.
clone→ TensorReturn a deep copy of `input` with its own storage.
clamp→ TensorElement-wise clamping to a closed interval.
scatter_add→ TensorAccumulate `src` into `input` along `dim` at positions `index`.
log10→ TensorElement-wise base-10 logarithm.
log1p→ TensorElement-wise natural logarithm of `1 + x`.
exp2→ TensorElement-wise base-2 exponential.
trunc→ TensorElement-wise truncation toward zero.
frac→ TensorElement-wise fractional part.
atan2→ TensorElement-wise quadrant-aware inverse tangent.
fmod→ TensorElement-wise C-style floating-point remainder.
remainder→ TensorElement-wise Python-style modulo.
hypot→ TensorElement-wise Euclidean norm of two operands, computed in a numerically stable way.
logaddexp→ TensorElement-wise log-sum-exp of two operands.
nextafter→ TensorElement-wise IEEE 754 next representable floating-point value.
logsumexp→ TensorCompute the numerically stable log-sum-exp along `dim`.
mm→ TensorStrict 2-D matrix multiplication.
bmm→ TensorBatched matrix multiplication.
kron→ TensorKronecker product of two tensors.
logical_and→ TensorElement-wise logical AND.
logical_or→ TensorElement-wise logical OR.
logical_xor→ TensorElement-wise logical exclusive-OR.
logical_not→ TensorElement-wise logical NOT.
take→ TensorReturn elements of `input` at the given flat `indices`.
index_select→ TensorSelect slices of `input` along `dim` given `index`.
narrow→ TensorReturn a contiguous slice of `input` along `dim`.
scatter→ TensorWrite `src` into `base_impl` along `dim` at positions `index`.
kthvalue→ tuple of (Tensor, Tensor)Return the `k`-th smallest value along `dim` and its index.
movedim→ TensorMove one or more dimensions to new positions.
unflatten→ TensorInverse of `flatten` — split a single dim into a tuple of dims.
histc→ TensorCompute a histogram of `input` with `bins` equally-spaced bins.
cartesian_prod→ TensorReturn the Cartesian product of the given 1-D tensors.
searchsorted→ TensorFind insertion points to maintain order in a sorted sequence.
bucketize→ TensorReturn the bucket index of each element of `values` in `boundaries`.
eq→ TensorElement-wise equality predicate.
ne→ TensorElement-wise inequality predicate.
lt→ TensorElement-wise strict less-than predicate.
le→ TensorElement-wise less-than-or-equal predicate.
gt→ TensorElement-wise strict greater-than predicate.
ge→ TensorElement-wise greater-than-or-equal predicate.
asin→ TensorElement-wise inverse sine in radians.
acos→ TensorElement-wise inverse cosine in radians.
atan→ TensorElement-wise inverse tangent in radians.
bitwise_not→ TensorElement-wise bitwise NOT.
bitwise_and→ TensorElement-wise bitwise AND.
bitwise_or→ TensorElement-wise bitwise OR.
bitwise_xor→ TensorElement-wise bitwise XOR.
bitwise_left_shift→ TensorElement-wise bitwise left shift.
bitwise_right_shift→ TensorElement-wise bitwise right shift.
masked_select→ TensorReturn a 1-D tensor of elements where `mask` is True.
isclose→ TensorElement-wise approximate equality with absolute and relative tolerance.
view→ TensorReturn a view of `input` with a different shape.
concat→ TensorAlias for `cat`.
real→ TensorReal part of a complex tensor.
imag→ TensorImaginary part of a complex tensor.
complex→ Tensorconj→ TensorElement-wise complex conjugate.
sum→ Tensormean→ TensorCompute the arithmetic mean along `dim`.
prod→ TensorCompute the product of elements along `dim`.
max→ Tensormin→ Tensorvar→ TensorCompute the sample variance along `dim`.
std→ TensorCompute the sample standard deviation along `dim`.
argmax→ TensorReturn the indices of the maximum values along `dim`.
argmin→ TensorReturn the indices of the minimum values along `dim`.
squeeze→ TensorRemove dimensions of size 1.
repeat→ TensorTile a tensor along an existing dimension.
repeat_interleave→ TensorRepeat each element of `x` `repeats` times along `dim`.
split→ list of TensorSplit a tensor into pieces of explicit sizes along `dim`.
tensordot→ TensorGeneralized tensor contraction over arbitrary axes.
meshgrid→ list of TensorConstruct coordinate grids from 1-D coordinate vectors.
diff→ TensorCompute the `n`-th order finite difference along an axis.
lerp→ TensorLinearly interpolate between `input` and an endpoint with a weight.