Uses of Class
ai.beestream.jitnn.Tensor

Packages that use Tensor
Package
Description
The jitNN API: Tensor (n-dimensional arrays, lazy on TornadoVM devices), reverse-mode differentiation (Tensor.backward(), Grad), the functional operators of F, linear algebra (Linalg), Fourier transforms (Fft), sparse matrices (SparseMatrix), mixed precision (Autocast) and user-defined operators (CustomOp).
Datasets: MNIST and CIFAR-10 readers, a byte-level text corpus, and synthetic data, held in memory as a Dataset.
Several devices: collectives (all-reduce, broadcast, reduce-scatter, all-gather) among ranks, staged through the host (HostCollective) or run by NCCL on NVIDIA GPUs (NcclCollective), and ProcessGroup, which runs one rank per device.
A Deep Java Library engine named jitNN: DJL's NDArrays, blocks, Trainer and Predictor run on jitNN (JitnnEngine).
The execution engine, which records operators in a per-thread trace and, at a sync point, compiles the trace into one TornadoVM task graph, cached by structure and replayed, or runs it on the host with the double-precision reference.
The GGUF reader (llama.cpp's model format): GgufFile gives a file's metadata and its tensors, memory-mapped without a copy, in their quantised blocks or as F32, F16 and BF16.
Checkpoints: named tensors and values (StateDict) saved and loaded in Hugging Face's safetensors format (SafeTensors).
Classical machine learning after scikit-learn, run on the device: k-means, k-nearest neighbours, PCA, linear and logistic regression, linear SVM, naive Bayes, decision trees, random forests, gradient boosting and t-SNE.
Neural-network modules after PyTorch's torch.nn: Module and Sequential, linear and convolution layers, pooling, normalisation, attention, embeddings, recurrent layers (LSTM, GRU), graph convolution, activations, and data-parallel training (DataParallel).
Complete models: ResNet, MobileNetV2, GPT-2, a Llama-style decoder, BERT, a VAE, DCGAN, U-Net and character RNNs, and the embedding models word2vec, doc2vec and GloVe.
Optimisers with PyTorch's semantics (SGD, Adam and AdamW, AdaGrad, RMSProp, AdaDelta, AdaMax, NAdam, LAMB, LARS), learning-rate schedules (LRScheduler) and dynamic loss scaling for FP16 training (GradScaler).
Vocabularies and training examples for the embedding models in ai.beestream.jitnn.nn.models.
The ONNX importer: OnnxSession loads an ONNX file and runs it on jitNN's operators.
The TensorFlow importer: TfModel loads SavedModels and frozen GraphDefs, translating them into ONNX graphs that the ONNX importer runs on jitNN.
  • Uses of Tensor in ai.beestream.jitnn

    Methods in ai.beestream.jitnn that return Tensor
    Modifier and Type
    Method
    Description
    Tensor.abs()
    |x|, element-wise.
    Tensor.acos()
    Element-wise arccosine.
    Tensor.acosh()
    Element-wise inverse hyperbolic cosine.
    static Tensor
    F.adaptiveAvgPool(Tensor x, int... out)
    Adaptive average pooling of x [N, C, ...] (1 to 3 spatial axes) to the given output sizes (PyTorch's bins).
    static Tensor
    F.adaptiveMaxPool(Tensor x, int... out)
    Adaptive max pooling of x [N, C, ...] (1 to 3 spatial axes) to the given output sizes.
    Tensor.add(float c)
    this + c.
    Tensor.add(Tensor o)
    this + o, element-wise with broadcasting.
    static Tensor
    Tensor.alias(Tensor base, Shape shape)
    A tensor that shares base's storage under another shape.
    CustomOp.apply(int[] iattr, float[] fattr, Tensor... inputs)
    Applies the operator with integer and float attributes (part of the plan's cache key); returns its first output.
    CustomOp.apply(Tensor... inputs)
    Applies the operator; returns its first output.
    CustomOp.Backward.apply(Node node, Tensor gradOut)
    The gradient of each input of node (null where none is needed), from the gradient gradOut of its first output.
    CustomOp.BinaryGradient.apply(Tensor a, Tensor b, Tensor y, Tensor gradY)
    [dL/da, dL/db], from the inputs a and b, the output y and dL/dy.
    CustomOp.UnaryGradient.apply(Tensor x, Tensor y, Tensor gradY)
    dL/dx, from the input x, the output y and dL/dy.
    CustomOp.applyAll(int[] iattr, float[] fattr, Tensor... inputs)
    Applies the operator; returns all its outputs.
    static Tensor
    Tensor.arange(float start, float end, float step)
    start, start + step, ... below end (above end for a negative step): torch.arange, ONNX Range.
    Tensor.argmax(int axis)
    Index of the maximum along axis, as an INT32 tensor (no gradient).
    Tensor.argmin(int axis)
    INT32 index of the first minimum along axis.
    Tensor.argsort(int axis, boolean descending)
    INT32 indices that sort along axis (stable).
    Tensor.asin()
    Element-wise arcsine.
    Tensor.asinh()
    Element-wise inverse hyperbolic sine.
    Tensor.atan()
    Element-wise arctangent.
    Tensor.atan2(Tensor o)
    atan2(this, o), the angle of the point (o, this), with broadcasting.
    Tensor.atanh()
    Element-wise inverse hyperbolic tangent.
    static Tensor
    F.attentionSoftmax(Tensor scores, float scale, boolean causal)
    softmax(scores * scale) over the last axis of attention scores [..., T, S], in one kernel; causal: query t sees keys 0 .. t, as PyTorch's is_causal.
    static Tensor
    F.avgPool1d(Tensor x, int kernel, int stride, int padding)
    Average pooling of x [N, C, L], PyTorch's avg_pool1d; padding counts in the divisor, as PyTorch's default.
    static Tensor
    F.avgPool2d(Tensor x, int kernel, int stride, int padding)
    Average pooling of x [N, C, H, W] over square windows, PyTorch's avg_pool2d; padding counts in the divisor, as PyTorch's default.
    static Tensor
    F.avgPool3d(Tensor x, int kernel, int stride, int padding)
    Average pooling of x [N, C, D, H, W] over cubic windows, PyTorch's avg_pool3d; padding counts in the divisor.
    static Tensor
    F.batchNorm(Tensor x, Tensor runningMean, Tensor runningVar, Tensor weight, Tensor bias, boolean training, float momentum, float eps)
    Batch normalisation of an NCHW (or NC) tensor.
    static Tensor
    F.batchNormRelu(Tensor x, Tensor runningMean, Tensor runningVar, Tensor weight, Tensor bias, boolean training, float momentum, float eps)
    relu(batchNorm(...)), fused.
    Tensor.bfloat16()
    This tensor converted to BF16 (to(DType.BF16)).
    static Tensor
    Binary cross-entropy of probabilities p in [0, 1] against target, PyTorch semantics: the logs are clamped at -100, so p = 0 or 1 gives finite values and gradients.
    static Tensor
    F.binaryCrossEntropy(Tensor p, Tensor target, F.Reduction reduction)
    F.binaryCrossEntropy(Tensor, Tensor) reduced as reduction says.
    static Tensor
    Binary cross-entropy on logits, sigmoid folded in without overflow (PyTorch's BCEWithLogits).
    static Tensor
    F.binaryCrossEntropyWithLogits(Tensor logits, Tensor target, F.Reduction reduction)
    Tensor.bitwiseAnd(Tensor o)
    Bitwise and of INT32 tensors, with broadcasting.
    Tensor.bitwiseNot()
    Bitwise complement of an INT32 tensor.
    Tensor.bitwiseOr(Tensor o)
    Bitwise or of INT32 tensors, with broadcasting.
    Tensor.bitwiseXor(Tensor o)
    Bitwise exclusive or of INT32 tensors, with broadcasting.
    static Tensor
    Tensor.cat(int axis, Tensor... parts)
    Joins tensors along an existing axis.
    Tensor.ceil()
    Element-wise ceiling.
    Tensor.celu(float alpha)
    CELU: max(0, x) + min(0, alpha (exp(x / alpha) - 1)).
    static Tensor
    F.centerCrop(Tensor x, int height, int width)
    The central height x width window of images [..., H, W] (torchvision's center_crop, top-left rounding down).
    static Tensor
    Grad.checkpoint(Function<Tensor[],Tensor> segment, Tensor... inputs)
    Activation checkpointing, as PyTorch's torch.utils.checkpoint: runs segment on inputs and keeps none of its activations for the backward pass, which runs the segment again to get them.
    static Tensor
    Linalg.cholesky(Tensor a)
    Lower Cholesky factor L, A = L L^T, of symmetric positive-definite matrices (only the lower triangle is read).
    Tensor.chunk(int chunks, int axis)
    Splits axis into chunks equal pieces.
    Tensor.clamp(float lo, float hi)
    x clamped to [lo, hi].
    static Tensor
    Grad.clipNorm(List<Tensor> params, float maxNorm)
    Rescales the gradients of params so that their global L2 norm is at most maxNorm, as PyTorch's clip_grad_norm_: every gradient is multiplied by min(1, maxNorm / (norm + 1e-6)).
    static Tensor
    F.contrastiveLoss(Tensor a, Tensor b, Tensor similar, float margin, F.Reduction reduction)
    Contrastive loss (Hadsell et al., 2006) with similar 1 for similar pairs and 0 for dissimilar ones: similar d^2 + (1 - similar) max(margin - d, 0)^2.
    static Tensor
    F.conv(Tensor x, Tensor weight, Tensor bias, int[] stride, int[] pads, int[] dilation, int groups)
    Convolution over 1 to 3 spatial axes with a size per axis: pads holds the padding before every axis, then after every axis (ONNX's order), so it may be asymmetric.
    static Tensor
    F.conv1d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation)
    1-D convolution of x [N, C, L] with weight [Cout, C, K]; bias may be null.
    static Tensor
    F.conv1d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation, int groups)
    Grouped 1-D convolution: weight [Cout, C / groups, K]; groups = C is depthwise.
    static Tensor
    F.conv2d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation, int groups)
    2-D convolution (NCHW), square kernel; bias may be null.
    static Tensor
    F.conv2dRelu(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation, int groups)
    relu(conv2d(...)) with the bias and ReLU fused into the convolution's output.
    static Tensor
    F.conv3d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation)
    3-D convolution of x [N, C, D, H, W] with weight [Cout, C, KD, KH, KW]; bias may be null.
    static Tensor
    F.conv3d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation, int groups)
    Grouped 3-D convolution: weight [Cout, C / groups, KD, KH, KW].
    static Tensor
    F.convTranspose2d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int outputPadding, int dilation, int groups)
    Transposed 2-D convolution (NCHW), PyTorch's conv_transpose2d: weight [Cin, Cout/groups, K, K], square kernel; bias may be null.
    Tensor.cos()
    Element-wise cosine.
    Tensor.cosh()
    Element-wise hyperbolic cosine.
    static Tensor
    F.cosineEmbeddingLoss(Tensor a, Tensor b, Tensor target, float margin, F.Reduction reduction)
    Cosine embedding loss: 1 - cos(a, b) for target 1, max(0, cos(a, b) - margin) for -1.
    static Tensor
    F.cosineProximityLoss(Tensor input, Tensor target, F.Reduction reduction)
    Cosine proximity loss (DL4J, Keras): minus the cosine similarity along the last axis, reduced.
    static Tensor
    F.cosineSimilarity(Tensor a, Tensor b, int axis, float eps)
    Cosine similarity along axis: a . b / (max(|a|, eps) max(|b|, eps)), PyTorch's cosine_similarity.
    static Tensor
    F.crossEntropy(Tensor logits, Tensor labels)
    Mean cross-entropy between logits [N, C] and INT32 class labels [N] (fused kernels).
    static Tensor
    F.ctcLoss(Tensor logProbs, Tensor targets, int[] inputLengths, int[] targetLengths, int blank, F.Reduction reduction)
    CTC loss, PyTorch's ctc_loss: log-probabilities [T, B, C] (log_softmax over C), INT32 targets [B, L] padded, input and target lengths; blank index blank.
    Tensor.cube()
    x^3 (DL4J's Cube activation).
    Tensor.cumprod(int axis)
    Inclusive cumulative product along axis; its gradient is exact with zeros.
    Tensor.cumsum(int axis)
    Inclusive cumulative sum along axis.
    static Tensor
    Buckets.cut(Tensor t, int axis, int length)
    The first length entries of dimension axis of t, copied on the host (a device result is read back first).
    static Tensor
    F.depthToSpace(Tensor x, int block, String mode)
    Moves blocks of channels into space: x [N, C, H, W] to [N, C / b^2, H b, W b].
    static Tensor
    A Q8_0 tensor back to FP32.
    static Tensor
    Linalg.det(Tensor a)
    Determinants [...] of square matrices.
    Tensor.detach()
    The same data without gradient history.
    Tensor.div(Tensor o)
    this / o, element-wise with broadcasting.
    static Tensor
    F.dropout(Tensor x, float p, Tensor seed, int stream)
    Inverted dropout with a fresh mask per step: seed is an INT32 [2] host tensor.
    static Tensor[]
    Linalg.eigh(Tensor a)
    Eigenvalues (ascending) [..., n] and eigenvectors (columns) [..., n, n] of symmetric matrices, torch.linalg.eigh.
    static Tensor
    Linalg.eigvalsh(Tensor a)
    Eigenvalues (ascending) of symmetric matrices, torch.linalg.eigvalsh.
    Tensor.elu(float alpha)
    ELU: x for x > 0, else alpha (exp(x) - 1).
    static Tensor
    F.embedding(Tensor index, Tensor weight)
    Rows of weight [V, D] picked by the INT32 index: shape index.shape + [D].
    static Tensor
    F.embedding(Tensor index, Tensor weight, int paddingIdx)
    As F.embedding(Tensor, Tensor); row paddingIdx receives no gradient.
    static Tensor
    F.embeddingBag(Tensor indices, int[] offsets, Tensor weight, F.BagMode mode)
    EmbeddingBag (PyTorch's, 1-D input with offsets): the rows of weight picked by the INT32 indices, combined per bag by mode.
    Tensor.eq(Tensor o)
    1 where this == o, else 0, with broadcasting.
    Tensor.erf()
    Element-wise error function.
    Tensor.erfc()
    Element-wise complementary error function.
    Tensor.exp()
    e^x, element-wise.
    Tensor.expand(Shape target)
    Broadcast copy to target shape.
    Tensor.expm1()
    Element-wise exp(x) - 1, accurate near 0.
    static Tensor
    Tensor.eye(int n, int m, int k)
    The n x m matrix with ones on diagonal k (0 main, positive above, negative below), zeros elsewhere.
    static Tensor
    Tensor.eyeLike(Tensor like, int k)
    Tensor.eye(int, int, int) with the shape of the rank-2 tensor like (ONNX EyeLike).
    static Tensor
    F.fakeQuantize(Tensor x, float scale, float lowest, int bits)
    Quantises x to bits (8 or 16) bits and back: clamp(round_half_even(x / scale), lowest, lowest + 2^bits - 1) * scale, lowest being the lowest code minus the zero point (ONNX QuantizeLinear followed by DequantizeLinear).
    static Tensor
    Fft.fft(Tensor x)
    torch.fft.fft of complex x along the last axis, full length, BACKWARD scaling.
    static Tensor
    Fft.fft(Tensor x, int n, int dim, Fft.Norm norm)
    torch.fft.fft of complex x [..., 2]; n > 0 crops or zero-pads axis dim to n.
    static Tensor
    Fft.fft2(Tensor x)
    torch.fft.fft2: the transform over the last two complex axes.
    static Tensor
    F.flip(Tensor x, int... axes)
    x reversed along each of axes (torch.flip).
    Tensor.floor()
    Element-wise floor.
    Tensor.fmax(Tensor o)
    Element-wise maximum ignoring a NaN operand (torch.fmax).
    Tensor.fmin(Tensor o)
    Element-wise minimum ignoring a NaN operand (torch.fmin).
    Tensor.fmod(Tensor o)
    this - trunc(this / o) o, with broadcasting: the remainder with the sign of the dividend (torch.fmod).
    static Tensor
    F.fold(Tensor cols, int[] outputSize, int[] kernel, int[] stride, int[] pad, int[] dil)
    Folds columns back into an image, summing overlaps (torch fold, ONNX Col2Im); see Spatial.fold.
    static Tensor
    Tensor.full(float value, int... dims)
    An FP32 tensor of the given shape with every element value.
    Tensor.gather(int axis, Tensor index)
    torch.gather along axis with an INT32 index of this shape except along the axis.
    static Tensor
    F.gatherND(Tensor data, Tensor indices)
    Slices of data picked by INT32 index rows indices [..., k] (ONNX GatherND, batch_dims 0); differentiable in data.
    static Tensor
    F.gaussianKl(Tensor mu, Tensor logvar)
    KL divergence of N(mu, exp(logvar)) from N(0, 1), summed over every element: -0.5 * sum(1 + logvar - mu^2 - exp(logvar)), the VAE regulariser.
    Tensor.ge(Tensor o)
    1 where this >= o, else 0, with broadcasting.
    Tensor.gelu()
    GELU, exact form x * Phi(x) (PyTorch's default, approximate='none').
    Tensor.geluTanh()
    GELU with the tanh approximation (GPT-2's form, PyTorch's approximate='tanh').
    static Tensor
    Mean over the spatial dimensions: [N, C, H, W] to [N, C].
    static Tensor
    F.gloveLoss(Tensor wi, Tensor wj, Tensor bi, Tensor bj, Tensor logX, Tensor weight)
    GloVe's weighted least squares (Pennington et al., 2014) over a batch of co-occurrences: mean of weight (wi . wj + bi + bj - logX)^2, with wi, wj [B, D] and the rest [B].
    Tensor.grad()
    The accumulated gradient of a leaf tensor after Tensor.backward(), or null.
    static Tensor
    F.groupNorm(Tensor x, int groups, Tensor weight, Tensor bias, float eps)
    GroupNorm (Wu and He) of x [N, C, ...] in groups groups of channels: each (sample, group) normalised over its channels and positions, then a per-channel affine (weight and bias may be null, as PyTorch with affine=False).
    static Tensor[]
    F.gru(Tensor x, Tensor wih, Tensor whh, Tensor bih, Tensor bhh, Tensor h0)
    One GRU layer over x [T, B, I] (time first), PyTorch's equations and gate order (r, z, n): wih [3H, I], whh [3H, H], biases [3H], h0 [B, H].
    static Tensor[]
    F.gru(Tensor x, Tensor wih, Tensor whh, Tensor bih, Tensor bhh, Tensor h0, int[] lengths)
    Tensor.gt(Tensor o)
    1 where this > o, else 0, with broadcasting.
    Tensor.half()
    This tensor converted to FP16 (to(DType.F16)).
    Tensor.hardSigmoid()
    HardSigmoid, PyTorch's form: clamp(x / 6 + 1/2, 0, 1).
    Tensor.hardSwish()
    HardSwish: x hardSigmoid(x).
    Tensor.hardTanh(float lo, float hi)
    HardTanh: x clamped to [lo, hi] (PyTorch's default -1, 1).
    static Tensor
    F.hingeLoss(Tensor input, Tensor target, F.Reduction reduction)
    Hinge loss with targets in {-1, 1}: max(0, 1 - target * input), Keras's hinge (mean).
    static Tensor
    F.huberLoss(Tensor input, Tensor target, float delta, F.Reduction reduction)
    Huber loss with threshold delta: 0.5 d^2 where |d| < delta, else delta (|d| - delta / 2), d = input - target (PyTorch's huber_loss).
    static Tensor
    Fft.ifft(Tensor x)
    torch.fft.ifft of complex x along the last axis, full length, BACKWARD scaling (1/n).
    static Tensor
    Fft.ifft(Tensor x, int n, int dim, Fft.Norm norm)
    torch.fft.ifft.
    static Tensor
    Fft.ifft2(Tensor x)
    torch.fft.ifft2.
    Tensor.indexSelect(int axis, Tensor idx)
    Elements idx[0 .. m-1] (INT32 [m]) of axis, torch.index_select.
    static Tensor
    Grad.inference(Supplier<Tensor> forward)
    Runs a forward pass for inference: no gradient recording, and every tensor created inside except the returned one is internal, so its buffer is reused as soon as the computation no longer needs it.
    static Tensor
    F.instanceNorm(Tensor x, Tensor weight, Tensor bias, float eps)
    InstanceNorm: GroupNorm with one channel per group (affine when weight and bias are given).
    static Tensor
    F.interpolate(Tensor x, int height, int width, boolean bilinear, boolean alignCorners)
    Resizes x [N, C, H, W] to [N, C, height, width], nearest or bilinear (PyTorch's interpolate with size).
    static Tensor
    Linalg.inv(Tensor a)
    Inverse of square matrices.
    static Tensor
    Fft.irfft(Tensor x)
    torch.fft.irfft along the last axis: a real signal of length 2 (m - 1), BACKWARD scaling (1/n).
    static Tensor
    Fft.irfft(Tensor x, int n, int dim, Fft.Norm norm)
    torch.fft.irfft: the real signal of length n (default 2 (m - 1)) whose spectrum's non-negative half is x [..., m, 2]; the imaginary parts at frequency 0 and n / 2 are ignored.
    Tensor.isFiniteMask()
    1 where finite, else 0.
    Tensor.isInf()
    1 where +inf or -inf, else 0.
    Tensor.isNaN()
    1 where NaN, else 0 (tested by bit pattern).
    static Tensor
    Fft.istft(Tensor x, int nFft, int hop, Tensor window, boolean center, boolean normalized, int length)
    torch.istft(x, nFft, hop, window=window, center, normalized, onesided=True, length): x [(B,) nFft / 2 + 1, frames, 2] back to [(B,) length] (length <= 0: as long as the frames reach, less the centre padding), by overlap-add divided by the summed squared window.
    static Tensor
    Grad.keep(Tensor t)
    Marks t as read by the caller: its buffer is never reused.
    static Tensor
    F.l1Loss(Tensor input, Tensor target, F.Reduction reduction)
    Mean absolute error (L1), PyTorch's l1_loss.
    static Tensor
    F.layerNorm(Tensor x, Tensor weight, Tensor bias, float eps)
    LayerNorm over the last axis: (x - mean) / sqrt(var + eps) * weight + bias (bias may be null).
    Tensor.le(Tensor o)
    1 where this <= o, else 0, with broadcasting.
    Tensor.leakyRelu(float slope)
    LeakyReLU: x for x > 0, else slope * x (PyTorch's default slope is 0.01).
    static Tensor
    F.linear(Tensor x, Tensor weight, Tensor bias)
    y = x W^T + b, with W stored [out, in] and b of shape [out] (b may be null); one fused GEMM. x may have any leading dimensions: [..., in] gives [..., out].
    static Tensor
    F.linearQ8(Tensor x, Tensor weight, Tensor bias)
    y = x W^T + b with Q8_0 weights W [out, in]; the gradient reaches x, not W.
    static Tensor
    F.linearRelu(Tensor x, Tensor weight, Tensor bias)
    relu(x W^T + b), with the bias and ReLU fused into the GEMM epilogue.
    static Tensor
    F.localResponseNorm(Tensor x, int size, float alpha, float beta, float k)
    Local response normalisation across channels, PyTorch's local_response_norm (k 1, alpha 1e-4, beta 0.75 by default).
    Tensor.log()
    The natural logarithm, element-wise.
    Tensor.log1p()
    Element-wise log(1 + x), accurate near 0.
    Tensor.logicalAnd(Tensor o)
    1 where both are non-zero, with broadcasting.
    Tensor.logicalNot()
    Element-wise logical not: 1 where x is 0, else 0.
    Tensor.logicalOr(Tensor o)
    1 where either is non-zero, with broadcasting.
    Tensor.logicalXor(Tensor o)
    1 where exactly one is non-zero, with broadcasting.
    static Tensor
    log sigmoid(x) = -softplus(-x), without overflow.
    Tensor.logSoftmax()
    Log-softmax along the last axis.
    static Tensor
    F.lpNormalize(Tensor x, int p, int axis, float eps)
    x / max(||x||_p, eps) along axis, p = 1 or 2 (torch.nn.functional.normalize; ONNX LpNormalization with eps 0).
    static Tensor[]
    F.lstm(Tensor x, Tensor wih, Tensor whh, Tensor bih, Tensor bhh, Tensor h0, Tensor c0)
    One LSTM layer over x [T, B, I] (time first), PyTorch's equations and gate order (i, f, g, o): wih [4H, I], whh [4H, H], biases [4H], h0 and c0 [B, H].
    static Tensor[]
    F.lstm(Tensor x, Tensor wih, Tensor whh, Tensor bih, Tensor bhh, Tensor h0, Tensor c0, int[] lengths)
    As F.lstm(Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor) for padded batches: INT32 lengths [B] (null: all T); outputs past a sequence's length are 0 and h_n, c_n are each sequence's last valid state.
    Tensor.lt(Tensor o)
    1 where this < o, else 0, with broadcasting.
    static Tensor[]
    Linalg.lu(Tensor a)
    P, L, U with A = P L U, torch.linalg.lu for square matrices.
    static Tensor[]
    Linalg.luFactor(Tensor a)
    LU factorisation with partial pivoting, torch.linalg.lu_factor: the packed factors (L unit lower below the diagonal, U on and above) and INT32 row indices perm, with row i of P^T A being row perm[i] of A (0-based, unlike LAPACK's swap list).
    static Tensor
    F.mapeLoss(Tensor input, Tensor target, F.Reduction reduction)
    Mean absolute percentage error: 100 |target - input| / max(|target|, eps) (Keras's MAPE, eps 1e-7).
    static Tensor
    F.marginRankingLoss(Tensor x1, Tensor x2, Tensor target, float margin, F.Reduction reduction)
    Margin ranking loss: max(0, -target (x1 - x2) + margin), target 1 or -1.
    Tensor.maskedSelect(Tensor mask)
    The elements where mask (broadcast) is not zero, as a vector (torch.masked_select); reads the count back to the host.
    Tensor.matmul(Tensor b)
    The matrix product this b: [M, K] x [K, N] to [M, N], or batched over leading axes, which must match unless one side is a plain matrix shared by every batch.
    Tensor.matmul(Tensor b, boolean transposeThis, boolean transposeB)
    op(this) * op(b), where op transposes when the flag is set, without materialising the transpose.
    Tensor.max(int axis, boolean keepDim)
    The maximum along axis, which is kept with size 1 when keepDim is set; Tensor.argmax(int) gives its index.
    Tensor.maximum(Tensor o)
    The element-wise maximum of this and o, with broadcasting (Tensor.maximumNaN(Tensor) propagates NaN).
    Tensor.maximumNaN(Tensor o)
    Element-wise maximum propagating NaN (torch.maximum).
    static Tensor
    F.maxPool1d(Tensor x, int kernel, int stride, int padding)
    Max pooling of x [N, C, L] over windows of kernel with the given stride and padding (padding never wins), PyTorch's max_pool1d.
    static Tensor
    F.maxPool2d(Tensor x, int kernel, int stride, int padding)
    Max pooling of x [N, C, H, W] over square windows of kernel with the given stride and padding, PyTorch's max_pool2d.
    static Tensor
    F.maxPool3d(Tensor x, int kernel, int stride, int padding)
    Max pooling of x [N, C, D, H, W] over cubic windows of kernel (padding never wins), PyTorch's max_pool3d.
    Tensor.mean()
    The mean of all elements, as a scalar.
    Tensor.mean(int axis, boolean keepDim)
    The mean along axis, which is kept with size 1 when keepDim is set.
    Tensor.min(int axis, boolean keepDim)
    The minimum along axis, which is kept with size 1 when keepDim is set; Tensor.argmin(int) gives its index.
    Tensor.minimum(Tensor o)
    The element-wise minimum of this and o, with broadcasting (Tensor.minimumNaN(Tensor) propagates NaN).
    Tensor.minimumNaN(Tensor o)
    Element-wise minimum propagating NaN (torch.minimum).
    Tensor.mish()
    Mish: x tanh(softplus(x)).
    SparseMatrix.mm(Tensor values, Tensor dense)
    A dense with A's stored values values [nnz] (coordinate order); dense [cols, feat] gives [rows, feat].
    SparseMatrix.Valued.mm(Tensor dense)
    This matrix times dense [cols, feat].
    static Tensor
    F.mseLoss(Tensor input, Tensor target)
    Mean squared error between input and target (same shape).
    static Tensor
    F.mseLoss(Tensor input, Tensor target, F.Reduction reduction)
    Squared error between input and target (same shape), reduced as reduction says.
    static Tensor
    F.msleLoss(Tensor input, Tensor target, F.Reduction reduction)
    Mean squared logarithmic error: (log1p(input) - log1p(target))^2 (Keras's MSLE).
    Tensor.mul(float c)
    this * c.
    Tensor.mul(Tensor o)
    this * o, element-wise with broadcasting.
    static Tensor
    F.multiHeadAttention(Tensor x, Tensor wqkv, Tensor bqkv, Tensor wout, Tensor bout, int heads, Tensor mask, boolean causal)
    Multi-head self-attention on x [B, T, D], as PyTorch's nn.MultiheadAttention with batch_first: q, k, v = split(x Wqkv^T + bqkv), heads heads, then the output projection.
    static Tensor
    F.multinomial(Tensor weights, Tensor seed, int stream)
    One INT32 index per row of non-negative weights [..., V] (probabilities, or any unnormalised weights), drawn in proportion to the weight.
    Tensor.nanToNum(float nan, float posInf)
    NaN to nan, +inf to posInf and -inf to -posInf (torch.nan_to_num with a symmetric infinity).
    Tensor.narrow(int axis, int start, int length)
    Elements start .. start + length - 1 along axis, as a new tensor.
    Tensor.ne(Tensor o)
    1 where this !
    Tensor.neg()
    -this.
    static Tensor
    F.negativeSamplingLoss(Tensor hidden, Tensor target, Tensor negatives)
    Negative-sampling loss of word2vec (Mikolov et al., 2013): hidden [B, D] (the centre word, or the averaged context), target [B, D] (the output vector of the true word) and negatives [B, K, D] (output vectors of sampled words); mean over B of -log sigmoid(h . t) - sum_k log sigmoid(-h . n_k).
    static Tensor
    F.nll(Tensor logp, Tensor labels)
    Per-sample negative log-likelihood of INT32 labels under log-probabilities logp.
    static Tensor
    F.nllLoss(Tensor logp, Tensor labels, F.Reduction reduction)
    Negative log-likelihood of INT32 labels under log-probabilities [N, C], reduced.
    static Tensor
    F.nonzero(Tensor x, int size, int fill)
    torch.nonzero_static: INT32 coordinates [size, rank] of the first size non-zero elements, the rest of the rows fill.
    Tensor.nonzero()
    INT32 coordinates [count, rank] of the non-zero elements (torch.nonzero); reads the count back to the host.
    Tensor.norm(int p, int axis, boolean keepDim)
    The p-norm (p = 1 or 2) along axis: sum |x| or sqrt(sum x^2).
    static Tensor
    Tensor.normal(long seed, float mean, float std, int... dims)
    Normal with the given mean and standard deviation, counter-based like Tensor.uniform(long, float, float, int...).
    static Tensor
    Tensor.normal(Tensor seed, float mean, float std, int... dims)
    As Tensor.normal(long, float, float, int...) with the seed in an INT32 [2] tensor.
    static Tensor
    F.normalizeImage(Tensor x, float[] mean, float[] std)
    Normalises images x [N, C, H, W] per channel: (x - mean[c]) / std[c], as torchvision's Normalize.
    static Tensor
    Tensor.of(float[] data, int... dims)
    An FP32 tensor with a copy of data in the shape dims (a vector of all the values when no dims are given).
    static Tensor
    Tensor.of(int[] data, int... dims)
    An INT32 tensor (labels, indices) with a copy of data; Tensor.of(float[], int...) for int data.
    static Tensor
    Tensor.of(uk.ac.manchester.tornado.api.types.arrays.HalfFloatArray data, int... dims)
    An FP16 input over data, held without a copy (an FP16 image batch for half-precision inference, say): plans read it as they read any host input.
    static Tensor
    F.oneHot(Tensor labels, int classes)
    INT32 labels [...] to a one-hot [..., classes].
    static Tensor
    Tensor.ones(int... dims)
    An FP32 tensor of ones.
    static Tensor
    Buckets.pad(Tensor t, int axis, int size, float value)
    t with dimension axis grown to size, the new elements set to value; built on the host (a device result is read back first).
    static Tensor
    F.pad(Tensor x, int[] before, int[] after, F.PadMode mode, float value)
    Pads the spatial axes of x [N, C, ...]: before[k] and after[k] elements on spatial axis k, PyTorch's F.pad for constant, reflect and replicate modes.
    static Tensor
    Euclidean distance of each row pair (last axis), PyTorch's pairwise_distance with eps 1e-6.
    static Tensor
    Tensor.parameter(Tensor init)
    A trainable parameter: persistent storage (it stays on the device across steps), gradient tracking on, initialised with the values of init.
    Tensor.permute(int... order)
    The axes reordered: axis i of the result is axis order[i] of this tensor.
    static Tensor
    Tensor.persistent(Tensor init)
    Persistent storage without gradient tracking (optimiser state, running statistics).
    static Tensor
    Tensor.persistent(uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray array, DType dtype, int... dims)
    A persistent tensor (a weight that stays on the device) over an existing native array, without copying it: for example an array that wraps a memory-mapped file.
    static Tensor
    Tensor.persistentHalf(float[] values, int... dims)
    Persistent FP16 storage (weights kept in half precision on the device), from FP32 values rounded to nearest.
    static Tensor
    F.poissonNllLoss(Tensor input, Tensor target, boolean logInput, float eps, F.Reduction reduction)
    Poisson negative log-likelihood, PyTorch's poisson_nll_loss without the Stirling term: exp(input) - target input with logInput, else input - target log(input + eps).
    static Tensor
    F.pool(Tensor x, F.PoolMode mode, int[] kernel, int[] stride, int[] pads, int[] dilation, boolean ceil, boolean countIncludePad, float p)
    Pooling over 1 to 3 spatial axes of x [N, C, ...] with a size per axis, as ONNX's MaxPool, AveragePool and LpPool and PyTorch's pooling layers: pads holds the padding before every axis, then after every axis; ceil rounds the output size up (a window must still start inside the input or its leading padding); average pooling counts the padding when countIncludePad (never the positions added by ceil); LP pooling computes (sum |x|^p)^(1/p).
    Tensor.pow(float exponent)
    x^exponent, element-wise.
    Tensor.pow(Tensor exponent)
    x^exponent, element-wise, with broadcasting.
    static Tensor
    F.prelu(Tensor x, Tensor weight)
    PReLU: x where x > 0, else a x, with a learnable slope weight of one element or one per channel (axis 1 of x, as PyTorch).
    Tensor.prod()
    Product of all elements.
    Tensor.prod(int axis, boolean keepDim)
    Product along axis.
    static Tensor[]
    Linalg.qr(Tensor a)
    Reduced QR, torch.linalg.qr: Q [..., m, k] and R [..., k, n], k = min(m, n).
    static Tensor
    Tensor.quantized(DType type, byte[] blocks, int... dims)
    A weight in one of GGUF's block-quantised formats (Q8_0, Q4_0, Q4_1, Q4_K, Q5_K, Q6_K, Q5_0, Q5_1, Q2_K, Q3_K) from its raw blocks, as a GGUF file stores them: persistent, so it stays on the device.
    static Tensor
    FP32 x (last axis a multiple of 32) quantised to Q8_0, GGUF's 8-bit block format.
    Tensor.reciprocal()
    1 / x, element-wise.
    Tensor.relu()
    max(x, 0), element-wise.
    Tensor.relu6()
    min(max(x, 0), 6).
    Tensor.remainder(Tensor o)
    this - floor(this / o) o, with broadcasting: the remainder with the sign of the divisor (torch.remainder).
    Tensor.requiresGrad(boolean on)
    Turns gradient tracking on or off for a leaf tensor.
    Tensor.reshape(int... dims)
    Same data, new shape; one dimension may be -1.
    static Tensor
    Tensor.result(Shape shape, DType dtype)
    An output tensor for an operator; its storage is allocated when the operator runs.
    static Tensor
    F.reverseSequences(Tensor x, int[] lengths)
    x [T, B, ...] with each sequence reversed within its length (padding left in place), as a bidirectional layer reads it; lengths null reverses the whole time axis.
    static Tensor
    Fft.rfft(Tensor x)
    torch.fft.rfft of real x along the last axis, full length, BACKWARD scaling.
    static Tensor
    Fft.rfft(Tensor x, int n, int dim, Fft.Norm norm)
    torch.fft.rfft of real x: the n / 2 + 1 non-negative frequencies, complex [..., n / 2 + 1, 2].
    static Tensor
    Fft.rfft2(Tensor x)
    torch.fft.rfft2: rfft over the last axis, then fft over the one before.
    static Tensor
    RGB images [N, 3, H, W] to luminance [N, 1, H, W] with torchvision's weights (0.2989, 0.587, 0.114).
    static Tensor
    F.rmsNorm(Tensor x, Tensor weight, float eps)
    RMSNorm over the last axis: x / sqrt(mean(x^2) + eps) * weight.
    static Tensor
    F.rope(Tensor x, float base, int offset, boolean interleaved)
    Rotary position embedding of x [..., T, D] at positions offset .. offset + T - 1, frequency base^(-2i / D) for pair i.
    static Tensor
    F.ropeHeads(Tensor x, float base, int offset, boolean interleaved)
    Rotary position embedding of x [..., T, H, D] (the heads of a token share its position); see F.rope(Tensor, float, int, boolean).
    static Tensor
    F.ropeHeads(Tensor x, float base, RopeScaling scaling, int offset, boolean interleaved)
    F.ropeHeads(Tensor, float, int, boolean) with the frequencies rescaled for longer contexts (Llama 3.1's rope_scaling; null for none).
    Tensor.round()
    Element-wise rounding to the nearest integer, halves to even (PyTorch's round).
    static Tensor
    F.rrelu(Tensor x, float lower, float upper, boolean training, Tensor seed)
    RReLU (Xu et al., 2015): in training, a slope drawn uniformly from [lower, upper) for every element, seeded by the INT32 [2] seed tensor (see Tensor.seed(long)); in evaluation the mean slope (lower + upper) / 2.
    static Tensor
    Tensor.scalar(float value)
    A rank-0 FP32 tensor holding value.
    static Tensor
    F.scaledDotProductAttention(Tensor q, Tensor k, Tensor v, Tensor mask, boolean causal, float scale)
    Scaled dot-product attention, PyTorch semantics: softmax(q k^T * scale + mask) v, for q [..., T, E], k [..., S, E], v [..., S, Ev].
    static Tensor
    F.scaledDotProductAttentionBTHD(Tensor q, Tensor k, Tensor v, Tensor mask, boolean causal, float scale)
    Scaled dot-product attention on q [B, T, H, E], k and v [B, S, H, E] (heads after tokens, as the projections produce them), returning [B, T, H, E]; otherwise as F.scaledDotProductAttention(Tensor, Tensor, Tensor, Tensor, boolean, float).
    Tensor.scatter(int axis, Tensor index, Tensor src)
    torch.scatter: this with src written at index (duplicates: the last wins); no gradient.
    Tensor.scatterAdd(int axis, Tensor index, Tensor src)
    torch.scatter_add: this with src added at index along axis.
    static Tensor
    F.scatterND(Tensor data, Tensor indices, Tensor updates, String reduction)
    A copy of data with the update slices written ("none"), added ("add") or multiplied ("mul") at the INT32 index rows indices [..., k] (ONNX ScatterND); differentiable for none and add.
    static Tensor
    Tensor.seed(long seed)
    A 64-bit seed as the INT32 [2] host tensor [lo, hi] that the seeded random operators take.
    static Tensor
    F.segmentReduce(Tensor x, int[] offsets, F.BagMode mode)
    Sum, mean or max of the row segments of x [rows, D]: segment b covers rows offsets[b] .. offsets[b + 1] - 1, the last to the end; an empty segment gives zeros.
    Tensor.selu()
    SELU with PyTorch's constants (alpha 1.6732632, scale 1.0507010).
    Tensor.shiftLeft(Tensor o)
    this << o for INT32 tensors, with broadcasting.
    Tensor.shiftRight(Tensor o)
    this >> o (arithmetic: the sign is kept) for INT32 tensors, with broadcasting.
    Tensor.sigmoid()
    The logistic sigmoid 1 / (1 + exp(-x)), element-wise.
    Tensor.sign()
    Element-wise sign: -1, 0 or 1.
    Tensor.silu()
    SiLU (swish): x * sigmoid(x).
    Tensor.sin()
    Element-wise sine.
    Tensor.sinh()
    Element-wise hyperbolic sine.
    Tensor.slice(int axis, int start, int end)
    Elements start .. end - 1 along axis; negative indices count from the end.
    static Tensor[]
    Linalg.slogdet(Tensor a)
    torch.linalg.slogdet: [sign, log |det|], each [...]; only the logarithm carries a gradient.
    static Tensor
    F.smoothL1Loss(Tensor input, Tensor target, float beta, F.Reduction reduction)
    Smooth L1 loss, PyTorch's smooth_l1_loss: Huber with delta = beta, divided by beta.
    Tensor.softmax()
    Softmax along the last axis.
    Tensor.softplus()
    Softplus, log(1 + exp(x)) (beta 1), computed without overflow.
    Tensor.softsign()
    Softsign: x / (1 + |x|).
    static Tensor
    Linalg.solve(Tensor a, Tensor b)
    Solves A X = B for square A [..., n, n] and B [..., n, k] through LU with partial pivoting.
    static Tensor
    Linalg.solveTriangular(Tensor t, Tensor b, boolean upper, boolean unitDiagonal)
    Solves T X = B for triangular T, torch.linalg.solve_triangular (left side): only T's upper or lower triangle is read, and with unitDiagonal not its diagonal either.
    Tensor.sort(int axis, boolean descending)
    Stable sort along axis: {values, INT32 original indices}; values carry the gradient.
    static Tensor
    F.spaceToDepth(Tensor x, int block)
    Moves blocks of space into channels: x [N, C, H, W] to [N, C b^2, H / b, W / b] (ONNX SpaceToDepth; inverse of DCR depthToSpace).
    static Tensor
    Sparsemax (Martins and Astudillo, 2016) along the last axis: the Euclidean projection onto the probability simplex, max(x - tau, 0) with tau set by the sorted support.
    Tensor.split(int axis, int... sizes)
    Splits axis into consecutive pieces of the given sizes.
    Tensor.sqrt()
    The square root, element-wise.
    Tensor.square()
    x^2, element-wise.
    static Tensor
    F.squaredHingeLoss(Tensor input, Tensor target, F.Reduction reduction)
    Squared hinge loss: max(0, 1 - target * input)^2.
    Tensor.squeeze(int axis)
    A view without the size-1 axis axis.
    static Tensor
    Tensor.stack(int axis, Tensor... parts)
    Joins same-shape tensors along a new axis.
    static Tensor
    Fft.stft(Tensor x, int nFft, int hop, Tensor window, boolean center, boolean normalized)
    torch.stft(x, nFft, hop, window=window, center, pad_mode="reflect", normalized, onesided=True, return_complex=True) as real pairs: x [L] or [B, L] gives [(B,) nFft / 2 + 1, frames, 2].
    Tensor.sub(Tensor o)
    this - o, element-wise with broadcasting.
    Tensor.sum()
    The sum of all elements, as a scalar.
    Tensor.sum(int axis, boolean keepDim)
    The sum along axis, which is kept with size 1 when keepDim is set.
    Tensor.sumTo(Shape target)
    Sums broadcast dimensions away so the result has target shape (gradient of broadcasting).
    static Tensor[]
    Linalg.svd(Tensor a)
    Reduced SVD, torch.linalg.svd(full_matrices=False): U [..., m, k], S [..., k] descending and V [..., n, k] (V, not V^T), k = min(m, n).
    static Tensor
    Linalg.svdvals(Tensor a)
    Singular values (descending), torch.linalg.svdvals.
    static Tensor
    F.swiglu(Tensor gate, Tensor up)
    SwiGLU gating, silu(gate) * up, as in the Llama feed-forward block.
    Tensor.t()
    Transpose of a matrix.
    Tensor.tan()
    Element-wise tangent.
    Tensor.tanh()
    The hyperbolic tangent, element-wise.
    Tensor.thresholdedRelu(float theta)
    ThresholdedReLU (Keras): x where x > theta, else 0.
    Tensor.tile(int... reps)
    This tensor repeated reps[i] times along each axis (torch.Tensor.repeat, numpy.tile, ONNX Tile); reps longer than the rank adds leading axes.
    Tensor.to(DType dtype)
    This tensor converted to dtype: between FP32, FP16 and BF16 (round to nearest even; differentiable), or between FP32 and INT32 (truncating toward zero; no gradient).
    Tensor.toFloat()
    This tensor converted to FP32 (to(DType.F32)).
    Tensor.topk(int k)
    The k largest values along the last axis and their INT32 indices (descending; ties: lower index first).
    Tensor.transpose(int a, int b)
    Axes a and b swapped (negative axes count from the end); a copy, as Tensor.permute(int...).
    static Tensor
    F.tripletMarginLoss(Tensor anchor, Tensor positive, Tensor negative, float margin, F.Reduction reduction)
    Triplet margin loss: max(d(anchor, positive) - d(anchor, negative) + margin, 0).
    Tensor.trunc()
    Element-wise rounding towards zero.
    static Tensor
    Tensor.uniform(long seed, float lo, float hi, int... dims)
    Uniform in [lo, hi), from a counter-based generator: the same seed gives the same values everywhere.
    static Tensor
    Tensor.uniform(Tensor seed, float lo, float hi, int... dims)
    As Tensor.uniform(long, float, float, int...) with the seed in an INT32 [2] tensor (see Tensor.seed(long)): a plan replayed with a new seed draws new values without recompiling, so use this for noise drawn every step.
    static Tensor[]
    F.unique(Tensor x, boolean returnInverse, boolean returnCounts)
    torch.unique (sorted): the distinct values of x, then (when asked for, else null) the INT32 index of each element's value among them, shaped like x, and the INT32 count of each value.
    Tensor.unsqueeze(int axis)
    A view with a new size-1 axis at axis (negative counts from the end of the result).
    static Tensor
    F.upsampleBilinear(Tensor x, float scale, boolean alignCorners)
    Bilinear upsampling of x [N, C, H, W] by scale.
    static Tensor
    F.upsampleNearest(Tensor x, float scale)
    Nearest-neighbour upsampling of x [N, C, H, W] by scale (PyTorch's mode='nearest').
    SparseMatrix.Valued.values()
    Returns the value of the values record component.
    static Tensor
    Weight normalisation (Salimans and Kingma): w = g v / ||v|| with the norm over every axis but 0, g of shape [out] (PyTorch's weight_norm with dim 0).
    static Tensor
    F.where(Tensor cond, Tensor a, Tensor b)
    cond !
    static Tensor
    Tensor.wrap(float[] data, int... dims)
    A tensor over data itself, without a copy, as PyTorch's from_numpy: the array is read when the operators that use it run (at the next sync), so it must not change until then, and later reads of the tensor see later changes.
    static Tensor
    Tensor.wrap(int[] data, int... dims)
    static Tensor
    Tensor.zeros(int... dims)
    An FP32 tensor of zeros.
    Methods in ai.beestream.jitnn with parameters of type Tensor
    Modifier and Type
    Method
    Description
    static float
    F.accuracy(Tensor logits, Tensor labels)
    Fraction of rows whose argmax equals the label; runs now and returns a host value.
    static Tensor
    F.adaptiveAvgPool(Tensor x, int... out)
    Adaptive average pooling of x [N, C, ...] (1 to 3 spatial axes) to the given output sizes (PyTorch's bins).
    static Tensor
    F.adaptiveMaxPool(Tensor x, int... out)
    Adaptive max pooling of x [N, C, ...] (1 to 3 spatial axes) to the given output sizes.
    Tensor.add(Tensor o)
    this + o, element-wise with broadcasting.
    static Tensor
    Tensor.alias(Tensor base, Shape shape)
    A tensor that shares base's storage under another shape.
    CustomOp.apply(int[] iattr, float[] fattr, Tensor... inputs)
    Applies the operator with integer and float attributes (part of the plan's cache key); returns its first output.
    CustomOp.apply(Tensor... inputs)
    Applies the operator; returns its first output.
    CustomOp.Backward.apply(Node node, Tensor gradOut)
    The gradient of each input of node (null where none is needed), from the gradient gradOut of its first output.
    CustomOp.BinaryGradient.apply(Tensor a, Tensor b, Tensor y, Tensor gradY)
    [dL/da, dL/db], from the inputs a and b, the output y and dL/dy.
    CustomOp.UnaryGradient.apply(Tensor x, Tensor y, Tensor gradY)
    dL/dx, from the input x, the output y and dL/dy.
    CustomOp.applyAll(int[] iattr, float[] fattr, Tensor... inputs)
    Applies the operator; returns all its outputs.
    void
    Tensor.assign(Tensor src)
    Records a copy of src into this persistent FP32 tensor of the same size (a running statistic, an optimiser buffer): later operators see the new values.
    Tensor.atan2(Tensor o)
    atan2(this, o), the angle of the point (o, this), with broadcasting.
    static Tensor
    F.attentionSoftmax(Tensor scores, float scale, boolean causal)
    softmax(scores * scale) over the last axis of attention scores [..., T, S], in one kernel; causal: query t sees keys 0 .. t, as PyTorch's is_causal.
    static Tensor
    F.avgPool1d(Tensor x, int kernel, int stride, int padding)
    Average pooling of x [N, C, L], PyTorch's avg_pool1d; padding counts in the divisor, as PyTorch's default.
    static Tensor
    F.avgPool2d(Tensor x, int kernel, int stride, int padding)
    Average pooling of x [N, C, H, W] over square windows, PyTorch's avg_pool2d; padding counts in the divisor, as PyTorch's default.
    static Tensor
    F.avgPool3d(Tensor x, int kernel, int stride, int padding)
    Average pooling of x [N, C, D, H, W] over cubic windows, PyTorch's avg_pool3d; padding counts in the divisor.
    void
    Tensor.backward(Tensor gradient)
    Back-propagates from this tensor with gradient (its shape) as the gradient of the result.
    static Tensor
    F.batchNorm(Tensor x, Tensor runningMean, Tensor runningVar, Tensor weight, Tensor bias, boolean training, float momentum, float eps)
    Batch normalisation of an NCHW (or NC) tensor.
    static Tensor
    F.batchNormRelu(Tensor x, Tensor runningMean, Tensor runningVar, Tensor weight, Tensor bias, boolean training, float momentum, float eps)
    relu(batchNorm(...)), fused.
    static Tensor
    Binary cross-entropy of probabilities p in [0, 1] against target, PyTorch semantics: the logs are clamped at -100, so p = 0 or 1 gives finite values and gradients.
    static Tensor
    F.binaryCrossEntropy(Tensor p, Tensor target, F.Reduction reduction)
    F.binaryCrossEntropy(Tensor, Tensor) reduced as reduction says.
    static Tensor
    Binary cross-entropy on logits, sigmoid folded in without overflow (PyTorch's BCEWithLogits).
    static Tensor
    F.binaryCrossEntropyWithLogits(Tensor logits, Tensor target, F.Reduction reduction)
    Tensor.bitwiseAnd(Tensor o)
    Bitwise and of INT32 tensors, with broadcasting.
    Tensor.bitwiseOr(Tensor o)
    Bitwise or of INT32 tensors, with broadcasting.
    Tensor.bitwiseXor(Tensor o)
    Bitwise exclusive or of INT32 tensors, with broadcasting.
    static Tensor
    Tensor.cat(int axis, Tensor... parts)
    Joins tensors along an existing axis.
    static Tensor
    F.centerCrop(Tensor x, int height, int width)
    The central height x width window of images [..., H, W] (torchvision's center_crop, top-left rounding down).
    static Tensor
    Grad.checkpoint(Function<Tensor[],Tensor> segment, Tensor... inputs)
    Activation checkpointing, as PyTorch's torch.utils.checkpoint: runs segment on inputs and keeps none of its activations for the backward pass, which runs the segment again to get them.
    static Tensor
    Linalg.cholesky(Tensor a)
    Lower Cholesky factor L, A = L L^T, of symmetric positive-definite matrices (only the lower triangle is read).
    static Tensor
    F.contrastiveLoss(Tensor a, Tensor b, Tensor similar, float margin, F.Reduction reduction)
    Contrastive loss (Hadsell et al., 2006) with similar 1 for similar pairs and 0 for dissimilar ones: similar d^2 + (1 - similar) max(margin - d, 0)^2.
    static Tensor
    F.conv(Tensor x, Tensor weight, Tensor bias, int[] stride, int[] pads, int[] dilation, int groups)
    Convolution over 1 to 3 spatial axes with a size per axis: pads holds the padding before every axis, then after every axis (ONNX's order), so it may be asymmetric.
    static Tensor
    F.conv1d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation)
    1-D convolution of x [N, C, L] with weight [Cout, C, K]; bias may be null.
    static Tensor
    F.conv1d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation, int groups)
    Grouped 1-D convolution: weight [Cout, C / groups, K]; groups = C is depthwise.
    static Tensor
    F.conv2d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation, int groups)
    2-D convolution (NCHW), square kernel; bias may be null.
    static Tensor
    F.conv2dRelu(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation, int groups)
    relu(conv2d(...)) with the bias and ReLU fused into the convolution's output.
    static Tensor
    F.conv3d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation)
    3-D convolution of x [N, C, D, H, W] with weight [Cout, C, KD, KH, KW]; bias may be null.
    static Tensor
    F.conv3d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int dilation, int groups)
    Grouped 3-D convolution: weight [Cout, C / groups, KD, KH, KW].
    static Tensor
    F.convTranspose2d(Tensor x, Tensor weight, Tensor bias, int stride, int padding, int outputPadding, int dilation, int groups)
    Transposed 2-D convolution (NCHW), PyTorch's conv_transpose2d: weight [Cin, Cout/groups, K, K], square kernel; bias may be null.
    static Tensor
    F.cosineEmbeddingLoss(Tensor a, Tensor b, Tensor target, float margin, F.Reduction reduction)
    Cosine embedding loss: 1 - cos(a, b) for target 1, max(0, cos(a, b) - margin) for -1.
    static Tensor
    F.cosineProximityLoss(Tensor input, Tensor target, F.Reduction reduction)
    Cosine proximity loss (DL4J, Keras): minus the cosine similarity along the last axis, reduced.
    static Tensor
    F.cosineSimilarity(Tensor a, Tensor b, int axis, float eps)
    Cosine similarity along axis: a . b / (max(|a|, eps) max(|b|, eps)), PyTorch's cosine_similarity.
    static Tensor
    F.crossEntropy(Tensor logits, Tensor labels)
    Mean cross-entropy between logits [N, C] and INT32 class labels [N] (fused kernels).
    static Tensor
    F.ctcLoss(Tensor logProbs, Tensor targets, int[] inputLengths, int[] targetLengths, int blank, F.Reduction reduction)
    CTC loss, PyTorch's ctc_loss: log-probabilities [T, B, C] (log_softmax over C), INT32 targets [B, L] padded, input and target lengths; blank index blank.
    static Tensor
    Buckets.cut(Tensor t, int axis, int length)
    The first length entries of dimension axis of t, copied on the host (a device result is read back first).
    static Tensor
    F.depthToSpace(Tensor x, int block, String mode)
    Moves blocks of channels into space: x [N, C, H, W] to [N, C / b^2, H b, W b].
    static Tensor
    A Q8_0 tensor back to FP32.
    static Tensor
    Linalg.det(Tensor a)
    Determinants [...] of square matrices.
    Tensor.div(Tensor o)
    this / o, element-wise with broadcasting.
    static Tensor
    F.dropout(Tensor x, float p, Tensor seed, int stream)
    Inverted dropout with a fresh mask per step: seed is an INT32 [2] host tensor.
    static Tensor[]
    Linalg.eigh(Tensor a)
    Eigenvalues (ascending) [..., n] and eigenvectors (columns) [..., n, n] of symmetric matrices, torch.linalg.eigh.
    static Tensor
    Linalg.eigvalsh(Tensor a)
    Eigenvalues (ascending) of symmetric matrices, torch.linalg.eigvalsh.
    static Tensor
    F.embedding(Tensor index, Tensor weight)
    Rows of weight [V, D] picked by the INT32 index: shape index.shape + [D].
    static Tensor
    F.embedding(Tensor index, Tensor weight, int paddingIdx)
    As F.embedding(Tensor, Tensor); row paddingIdx receives no gradient.
    static Tensor
    F.embeddingBag(Tensor indices, int[] offsets, Tensor weight, F.BagMode mode)
    EmbeddingBag (PyTorch's, 1-D input with offsets): the rows of weight picked by the INT32 indices, combined per bag by mode.
    Tensor.eq(Tensor o)
    1 where this == o, else 0, with broadcasting.
    static Tensor
    Tensor.eyeLike(Tensor like, int k)
    Tensor.eye(int, int, int) with the shape of the rank-2 tensor like (ONNX EyeLike).
    static Tensor
    F.fakeQuantize(Tensor x, float scale, float lowest, int bits)
    Quantises x to bits (8 or 16) bits and back: clamp(round_half_even(x / scale), lowest, lowest + 2^bits - 1) * scale, lowest being the lowest code minus the zero point (ONNX QuantizeLinear followed by DequantizeLinear).
    static Tensor
    Fft.fft(Tensor x)
    torch.fft.fft of complex x along the last axis, full length, BACKWARD scaling.
    static Tensor
    Fft.fft(Tensor x, int n, int dim, Fft.Norm norm)
    torch.fft.fft of complex x [..., 2]; n > 0 crops or zero-pads axis dim to n.
    static Tensor
    Fft.fft2(Tensor x)
    torch.fft.fft2: the transform over the last two complex axes.
    static Tensor
    F.flip(Tensor x, int... axes)
    x reversed along each of axes (torch.flip).
    Tensor.fmax(Tensor o)
    Element-wise maximum ignoring a NaN operand (torch.fmax).
    Tensor.fmin(Tensor o)
    Element-wise minimum ignoring a NaN operand (torch.fmin).
    Tensor.fmod(Tensor o)
    this - trunc(this / o) o, with broadcasting: the remainder with the sign of the dividend (torch.fmod).
    static Tensor
    F.fold(Tensor cols, int[] outputSize, int[] kernel, int[] stride, int[] pad, int[] dil)
    Folds columns back into an image, summing overlaps (torch fold, ONNX Col2Im); see Spatial.fold.
    Tensor.gather(int axis, Tensor index)
    torch.gather along axis with an INT32 index of this shape except along the axis.
    static Tensor
    F.gatherND(Tensor data, Tensor indices)
    Slices of data picked by INT32 index rows indices [..., k] (ONNX GatherND, batch_dims 0); differentiable in data.
    static Tensor
    F.gaussianKl(Tensor mu, Tensor logvar)
    KL divergence of N(mu, exp(logvar)) from N(0, 1), summed over every element: -0.5 * sum(1 + logvar - mu^2 - exp(logvar)), the VAE regulariser.
    Tensor.ge(Tensor o)
    1 where this >= o, else 0, with broadcasting.
    static Tensor
    Mean over the spatial dimensions: [N, C, H, W] to [N, C].
    static Tensor
    F.gloveLoss(Tensor wi, Tensor wj, Tensor bi, Tensor bj, Tensor logX, Tensor weight)
    GloVe's weighted least squares (Pennington et al., 2014) over a batch of co-occurrences: mean of weight (wi . wj + bi + bj - logX)^2, with wi, wj [B, D] and the rest [B].
    static Tensor
    F.groupNorm(Tensor x, int groups, Tensor weight, Tensor bias, float eps)
    GroupNorm (Wu and He) of x [N, C, ...] in groups groups of channels: each (sample, group) normalised over its channels and positions, then a per-channel affine (weight and bias may be null, as PyTorch with affine=False).
    static Tensor[]
    F.gru(Tensor x, Tensor wih, Tensor whh, Tensor bih, Tensor bhh, Tensor h0)
    One GRU layer over x [T, B, I] (time first), PyTorch's equations and gate order (r, z, n): wih [3H, I], whh [3H, H], biases [3H], h0 [B, H].
    static Tensor[]
    F.gru(Tensor x, Tensor wih, Tensor whh, Tensor bih, Tensor bhh, Tensor h0, int[] lengths)
    Tensor.gt(Tensor o)
    1 where this > o, else 0, with broadcasting.
    static Tensor
    F.hingeLoss(Tensor input, Tensor target, F.Reduction reduction)
    Hinge loss with targets in {-1, 1}: max(0, 1 - target * input), Keras's hinge (mean).
    static Tensor
    F.huberLoss(Tensor input, Tensor target, float delta, F.Reduction reduction)
    Huber loss with threshold delta: 0.5 d^2 where |d| < delta, else delta (|d| - delta / 2), d = input - target (PyTorch's huber_loss).
    static Tensor
    Fft.ifft(Tensor x)
    torch.fft.ifft of complex x along the last axis, full length, BACKWARD scaling (1/n).
    static Tensor
    Fft.ifft(Tensor x, int n, int dim, Fft.Norm norm)
    torch.fft.ifft.
    static Tensor
    Fft.ifft2(Tensor x)
    torch.fft.ifft2.
    Tensor.indexSelect(int axis, Tensor idx)
    Elements idx[0 .. m-1] (INT32 [m]) of axis, torch.index_select.
    static Tensor
    F.instanceNorm(Tensor x, Tensor weight, Tensor bias, float eps)
    InstanceNorm: GroupNorm with one channel per group (affine when weight and bias are given).
    static Tensor
    F.interpolate(Tensor x, int height, int width, boolean bilinear, boolean alignCorners)
    Resizes x [N, C, H, W] to [N, C, height, width], nearest or bilinear (PyTorch's interpolate with size).
    static Tensor
    Linalg.inv(Tensor a)
    Inverse of square matrices.
    static Tensor
    Fft.irfft(Tensor x)
    torch.fft.irfft along the last axis: a real signal of length 2 (m - 1), BACKWARD scaling (1/n).
    static Tensor
    Fft.irfft(Tensor x, int n, int dim, Fft.Norm norm)
    torch.fft.irfft: the real signal of length n (default 2 (m - 1)) whose spectrum's non-negative half is x [..., m, 2]; the imaginary parts at frequency 0 and n / 2 are ignored.
    static Tensor
    Fft.istft(Tensor x, int nFft, int hop, Tensor window, boolean center, boolean normalized, int length)
    torch.istft(x, nFft, hop, window=window, center, normalized, onesided=True, length): x [(B,) nFft / 2 + 1, frames, 2] back to [(B,) length] (length <= 0: as long as the frames reach, less the centre padding), by overlap-add divided by the summed squared window.
    static Tensor
    Grad.keep(Tensor t)
    Marks t as read by the caller: its buffer is never reused.
    static Tensor
    F.l1Loss(Tensor input, Tensor target, F.Reduction reduction)
    Mean absolute error (L1), PyTorch's l1_loss.
    static Tensor
    F.layerNorm(Tensor x, Tensor weight, Tensor bias, float eps)
    LayerNorm over the last axis: (x - mean) / sqrt(var + eps) * weight + bias (bias may be null).
    Tensor.le(Tensor o)
    1 where this <= o, else 0, with broadcasting.
    static Tensor
    F.linear(Tensor x, Tensor weight, Tensor bias)
    y = x W^T + b, with W stored [out, in] and b of shape [out] (b may be null); one fused GEMM. x may have any leading dimensions: [..., in] gives [..., out].
    static Tensor
    F.linearQ8(Tensor x, Tensor weight, Tensor bias)
    y = x W^T + b with Q8_0 weights W [out, in]; the gradient reaches x, not W.
    static Tensor
    F.linearRelu(Tensor x, Tensor weight, Tensor bias)
    relu(x W^T + b), with the bias and ReLU fused into the GEMM epilogue.
    static Tensor
    F.localResponseNorm(Tensor x, int size, float alpha, float beta, float k)
    Local response normalisation across channels, PyTorch's local_response_norm (k 1, alpha 1e-4, beta 0.75 by default).
    Tensor.logicalAnd(Tensor o)
    1 where both are non-zero, with broadcasting.
    Tensor.logicalOr(Tensor o)
    1 where either is non-zero, with broadcasting.
    Tensor.logicalXor(Tensor o)
    1 where exactly one is non-zero, with broadcasting.
    static Tensor
    log sigmoid(x) = -softplus(-x), without overflow.
    static Tensor
    F.lpNormalize(Tensor x, int p, int axis, float eps)
    x / max(||x||_p, eps) along axis, p = 1 or 2 (torch.nn.functional.normalize; ONNX LpNormalization with eps 0).
    static Tensor[]
    F.lstm(Tensor x, Tensor wih, Tensor whh, Tensor bih, Tensor bhh, Tensor h0, Tensor c0)
    One LSTM layer over x [T, B, I] (time first), PyTorch's equations and gate order (i, f, g, o): wih [4H, I], whh [4H, H], biases [4H], h0 and c0 [B, H].
    static Tensor[]
    F.lstm(Tensor x, Tensor wih, Tensor whh, Tensor bih, Tensor bhh, Tensor h0, Tensor c0, int[] lengths)
    As F.lstm(Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor) for padded batches: INT32 lengths [B] (null: all T); outputs past a sequence's length are 0 and h_n, c_n are each sequence's last valid state.
    Tensor.lt(Tensor o)
    1 where this < o, else 0, with broadcasting.
    static Tensor[]
    Linalg.lu(Tensor a)
    P, L, U with A = P L U, torch.linalg.lu for square matrices.
    static Tensor[]
    Linalg.luFactor(Tensor a)
    LU factorisation with partial pivoting, torch.linalg.lu_factor: the packed factors (L unit lower below the diagonal, U on and above) and INT32 row indices perm, with row i of P^T A being row perm[i] of A (0-based, unlike LAPACK's swap list).
    static Tensor
    F.mapeLoss(Tensor input, Tensor target, F.Reduction reduction)
    Mean absolute percentage error: 100 |target - input| / max(|target|, eps) (Keras's MAPE, eps 1e-7).
    static Tensor
    F.marginRankingLoss(Tensor x1, Tensor x2, Tensor target, float margin, F.Reduction reduction)
    Margin ranking loss: max(0, -target (x1 - x2) + margin), target 1 or -1.
    Tensor.maskedSelect(Tensor mask)
    The elements where mask (broadcast) is not zero, as a vector (torch.masked_select); reads the count back to the host.
    Tensor.matmul(Tensor b)
    The matrix product this b: [M, K] x [K, N] to [M, N], or batched over leading axes, which must match unless one side is a plain matrix shared by every batch.
    Tensor.matmul(Tensor b, boolean transposeThis, boolean transposeB)
    op(this) * op(b), where op transposes when the flag is set, without materialising the transpose.
    Tensor.maximum(Tensor o)
    The element-wise maximum of this and o, with broadcasting (Tensor.maximumNaN(Tensor) propagates NaN).
    Tensor.maximumNaN(Tensor o)
    Element-wise maximum propagating NaN (torch.maximum).
    static Tensor
    F.maxPool1d(Tensor x, int kernel, int stride, int padding)
    Max pooling of x [N, C, L] over windows of kernel with the given stride and padding (padding never wins), PyTorch's max_pool1d.
    static Tensor
    F.maxPool2d(Tensor x, int kernel, int stride, int padding)
    Max pooling of x [N, C, H, W] over square windows of kernel with the given stride and padding, PyTorch's max_pool2d.
    static Tensor
    F.maxPool3d(Tensor x, int kernel, int stride, int padding)
    Max pooling of x [N, C, D, H, W] over cubic windows of kernel (padding never wins), PyTorch's max_pool3d.
    Tensor.minimum(Tensor o)
    The element-wise minimum of this and o, with broadcasting (Tensor.minimumNaN(Tensor) propagates NaN).
    Tensor.minimumNaN(Tensor o)
    Element-wise minimum propagating NaN (torch.minimum).
    SparseMatrix.mm(Tensor values, Tensor dense)
    A dense with A's stored values values [nnz] (coordinate order); dense [cols, feat] gives [rows, feat].
    SparseMatrix.Valued.mm(Tensor dense)
    This matrix times dense [cols, feat].
    static Tensor
    F.mseLoss(Tensor input, Tensor target)
    Mean squared error between input and target (same shape).
    static Tensor
    F.mseLoss(Tensor input, Tensor target, F.Reduction reduction)
    Squared error between input and target (same shape), reduced as reduction says.
    static Tensor
    F.msleLoss(Tensor input, Tensor target, F.Reduction reduction)
    Mean squared logarithmic error: (log1p(input) - log1p(target))^2 (Keras's MSLE).
    Tensor.mul(Tensor o)
    this * o, element-wise with broadcasting.
    static Tensor
    F.multiHeadAttention(Tensor x, Tensor wqkv, Tensor bqkv, Tensor wout, Tensor bout, int heads, Tensor mask, boolean causal)
    Multi-head self-attention on x [B, T, D], as PyTorch's nn.MultiheadAttention with batch_first: q, k, v = split(x Wqkv^T + bqkv), heads heads, then the output projection.
    static Tensor
    F.multinomial(Tensor weights, Tensor seed, int stream)
    One INT32 index per row of non-negative weights [..., V] (probabilities, or any unnormalised weights), drawn in proportion to the weight.
    Tensor.ne(Tensor o)
    1 where this !
    static Tensor
    F.negativeSamplingLoss(Tensor hidden, Tensor target, Tensor negatives)
    Negative-sampling loss of word2vec (Mikolov et al., 2013): hidden [B, D] (the centre word, or the averaged context), target [B, D] (the output vector of the true word) and negatives [B, K, D] (output vectors of sampled words); mean over B of -log sigmoid(h . t) - sum_k log sigmoid(-h . n_k).
    static Tensor
    F.nll(Tensor logp, Tensor labels)
    Per-sample negative log-likelihood of INT32 labels under log-probabilities logp.
    static Tensor
    F.nllLoss(Tensor logp, Tensor labels, F.Reduction reduction)
    Negative log-likelihood of INT32 labels under log-probabilities [N, C], reduced.
    static Tensor
    F.nonzero(Tensor x, int size, int fill)
    torch.nonzero_static: INT32 coordinates [size, rank] of the first size non-zero elements, the rest of the rows fill.
    static Tensor
    Tensor.normal(Tensor seed, float mean, float std, int... dims)
    As Tensor.normal(long, float, float, int...) with the seed in an INT32 [2] tensor.
    static Tensor
    F.normalizeImage(Tensor x, float[] mean, float[] std)
    Normalises images x [N, C, H, W] per channel: (x - mean[c]) / std[c], as torchvision's Normalize.
    CustomOp.OutputShape.of(Tensor[] inputs, int[] iattr)
    The output's shape for these inputs and integer attributes.
    static Tensor
    F.oneHot(Tensor labels, int classes)
    INT32 labels [...] to a one-hot [..., classes].
    static Tensor
    Buckets.pad(Tensor t, int axis, int size, float value)
    t with dimension axis grown to size, the new elements set to value; built on the host (a device result is read back first).
    static Tensor
    F.pad(Tensor x, int[] before, int[] after, F.PadMode mode, float value)
    Pads the spatial axes of x [N, C, ...]: before[k] and after[k] elements on spatial axis k, PyTorch's F.pad for constant, reflect and replicate modes.
    static Tensor
    Euclidean distance of each row pair (last axis), PyTorch's pairwise_distance with eps 1e-6.
    static Tensor
    Tensor.parameter(Tensor init)
    A trainable parameter: persistent storage (it stays on the device across steps), gradient tracking on, initialised with the values of init.
    static Tensor
    Tensor.persistent(Tensor init)
    Persistent storage without gradient tracking (optimiser state, running statistics).
    static Tensor
    F.poissonNllLoss(Tensor input, Tensor target, boolean logInput, float eps, F.Reduction reduction)
    Poisson negative log-likelihood, PyTorch's poisson_nll_loss without the Stirling term: exp(input) - target input with logInput, else input - target log(input + eps).
    static Tensor
    F.pool(Tensor x, F.PoolMode mode, int[] kernel, int[] stride, int[] pads, int[] dilation, boolean ceil, boolean countIncludePad, float p)
    Pooling over 1 to 3 spatial axes of x [N, C, ...] with a size per axis, as ONNX's MaxPool, AveragePool and LpPool and PyTorch's pooling layers: pads holds the padding before every axis, then after every axis; ceil rounds the output size up (a window must still start inside the input or its leading padding); average pooling counts the padding when countIncludePad (never the positions added by ceil); LP pooling computes (sum |x|^p)^(1/p).
    Tensor.pow(Tensor exponent)
    x^exponent, element-wise, with broadcasting.
    static Tensor
    F.prelu(Tensor x, Tensor weight)
    PReLU: x where x > 0, else a x, with a learnable slope weight of one element or one per channel (axis 1 of x, as PyTorch).
    static Tensor[]
    Linalg.qr(Tensor a)
    Reduced QR, torch.linalg.qr: Q [..., m, k] and R [..., k, n], k = min(m, n).
    static Tensor
    FP32 x (last axis a multiple of 32) quantised to Q8_0, GGUF's 8-bit block format.
    static void
    Tensor.record(ai.beestream.jitnn.engine.Op op, Tensor[] inputs, Tensor[] outputs, int[] iattr, float[] fattr, boolean traced)
    Records an operator application.
    Tensor.remainder(Tensor o)
    this - floor(this / o) o, with broadcasting: the remainder with the sign of the divisor (torch.remainder).
    static Tensor
    F.reverseSequences(Tensor x, int[] lengths)
    x [T, B, ...] with each sequence reversed within its length (padding left in place), as a bidirectional layer reads it; lengths null reverses the whole time axis.
    static Tensor
    Fft.rfft(Tensor x)
    torch.fft.rfft of real x along the last axis, full length, BACKWARD scaling.
    static Tensor
    Fft.rfft(Tensor x, int n, int dim, Fft.Norm norm)
    torch.fft.rfft of real x: the n / 2 + 1 non-negative frequencies, complex [..., n / 2 + 1, 2].
    static Tensor
    Fft.rfft2(Tensor x)
    torch.fft.rfft2: rfft over the last axis, then fft over the one before.
    static Tensor
    RGB images [N, 3, H, W] to luminance [N, 1, H, W] with torchvision's weights (0.2989, 0.587, 0.114).
    static Tensor
    F.rmsNorm(Tensor x, Tensor weight, float eps)
    RMSNorm over the last axis: x / sqrt(mean(x^2) + eps) * weight.
    static Tensor
    F.rope(Tensor x, float base, int offset, boolean interleaved)
    Rotary position embedding of x [..., T, D] at positions offset .. offset + T - 1, frequency base^(-2i / D) for pair i.
    static Tensor
    F.ropeHeads(Tensor x, float base, int offset, boolean interleaved)
    Rotary position embedding of x [..., T, H, D] (the heads of a token share its position); see F.rope(Tensor, float, int, boolean).
    static Tensor
    F.ropeHeads(Tensor x, float base, RopeScaling scaling, int offset, boolean interleaved)
    F.ropeHeads(Tensor, float, int, boolean) with the frequencies rescaled for longer contexts (Llama 3.1's rope_scaling; null for none).
    static Tensor
    F.rrelu(Tensor x, float lower, float upper, boolean training, Tensor seed)
    RReLU (Xu et al., 2015): in training, a slope drawn uniformly from [lower, upper) for every element, seeded by the INT32 [2] seed tensor (see Tensor.seed(long)); in evaluation the mean slope (lower + upper) / 2.
    static Tensor
    F.scaledDotProductAttention(Tensor q, Tensor k, Tensor v, Tensor mask, boolean causal, float scale)
    Scaled dot-product attention, PyTorch semantics: softmax(q k^T * scale + mask) v, for q [..., T, E], k [..., S, E], v [..., S, Ev].
    static Tensor
    F.scaledDotProductAttentionBTHD(Tensor q, Tensor k, Tensor v, Tensor mask, boolean causal, float scale)
    Scaled dot-product attention on q [B, T, H, E], k and v [B, S, H, E] (heads after tokens, as the projections produce them), returning [B, T, H, E]; otherwise as F.scaledDotProductAttention(Tensor, Tensor, Tensor, Tensor, boolean, float).
    Tensor.scatter(int axis, Tensor index, Tensor src)
    torch.scatter: this with src written at index (duplicates: the last wins); no gradient.
    Tensor.scatterAdd(int axis, Tensor index, Tensor src)
    torch.scatter_add: this with src added at index along axis.
    static Tensor
    F.scatterND(Tensor data, Tensor indices, Tensor updates, String reduction)
    A copy of data with the update slices written ("none"), added ("add") or multiplied ("mul") at the INT32 index rows indices [..., k] (ONNX ScatterND); differentiable for none and add.
    static Tensor
    F.segmentReduce(Tensor x, int[] offsets, F.BagMode mode)
    Sum, mean or max of the row segments of x [rows, D]: segment b covers rows offsets[b] .. offsets[b + 1] - 1, the last to the end; an empty segment gives zeros.
    void
    Tensor.setGrad(Tensor g)
    Replaces the gradient of this leaf tensor (same shape), for example by its average over data-parallel ranks before the optimiser step.
    Tensor.shiftLeft(Tensor o)
    this << o for INT32 tensors, with broadcasting.
    Tensor.shiftRight(Tensor o)
    this >> o (arithmetic: the sign is kept) for INT32 tensors, with broadcasting.
    static Tensor[]
    Linalg.slogdet(Tensor a)
    torch.linalg.slogdet: [sign, log |det|], each [...]; only the logarithm carries a gradient.
    static Tensor
    F.smoothL1Loss(Tensor input, Tensor target, float beta, F.Reduction reduction)
    Smooth L1 loss, PyTorch's smooth_l1_loss: Huber with delta = beta, divided by beta.
    static Tensor
    Linalg.solve(Tensor a, Tensor b)
    Solves A X = B for square A [..., n, n] and B [..., n, k] through LU with partial pivoting.
    static Tensor
    Linalg.solveTriangular(Tensor t, Tensor b, boolean upper, boolean unitDiagonal)
    Solves T X = B for triangular T, torch.linalg.solve_triangular (left side): only T's upper or lower triangle is read, and with unitDiagonal not its diagonal either.
    static Tensor
    F.spaceToDepth(Tensor x, int block)
    Moves blocks of space into channels: x [N, C, H, W] to [N, C b^2, H / b, W / b] (ONNX SpaceToDepth; inverse of DCR depthToSpace).
    static Tensor
    Sparsemax (Martins and Astudillo, 2016) along the last axis: the Euclidean projection onto the probability simplex, max(x - tau, 0) with tau set by the sorted support.
    static Tensor
    F.squaredHingeLoss(Tensor input, Tensor target, F.Reduction reduction)
    Squared hinge loss: max(0, 1 - target * input)^2.
    static Tensor
    Tensor.stack(int axis, Tensor... parts)
    Joins same-shape tensors along a new axis.
    static Tensor
    Fft.stft(Tensor x, int nFft, int hop, Tensor window, boolean center, boolean normalized)
    torch.stft(x, nFft, hop, window=window, center, pad_mode="reflect", normalized, onesided=True, return_complex=True) as real pairs: x [L] or [B, L] gives [(B,) nFft / 2 + 1, frames, 2].
    Tensor.sub(Tensor o)
    this - o, element-wise with broadcasting.
    static Tensor[]
    Linalg.svd(Tensor a)
    Reduced SVD, torch.linalg.svd(full_matrices=False): U [..., m, k], S [..., k] descending and V [..., n, k] (V, not V^T), k = min(m, n).
    static Tensor
    Linalg.svdvals(Tensor a)
    Singular values (descending), torch.linalg.svdvals.
    static Tensor
    F.swiglu(Tensor gate, Tensor up)
    SwiGLU gating, silu(gate) * up, as in the Llama feed-forward block.
    static void
    JitnnRuntime.sync(Tensor... wanted)
    Runs everything recorded on this thread, fetching wanted to the host.
    static Tensor
    F.tripletMarginLoss(Tensor anchor, Tensor positive, Tensor negative, float margin, F.Reduction reduction)
    Triplet margin loss: max(d(anchor, positive) - d(anchor, negative) + margin, 0).
    static Tensor
    Tensor.uniform(Tensor seed, float lo, float hi, int... dims)
    As Tensor.uniform(long, float, float, int...) with the seed in an INT32 [2] tensor (see Tensor.seed(long)): a plan replayed with a new seed draws new values without recompiling, so use this for noise drawn every step.
    static Tensor[]
    F.unique(Tensor x, boolean returnInverse, boolean returnCounts)
    torch.unique (sorted): the distinct values of x, then (when asked for, else null) the INT32 index of each element's value among them, shaped like x, and the INT32 count of each value.
    static Tensor
    F.upsampleBilinear(Tensor x, float scale, boolean alignCorners)
    Bilinear upsampling of x [N, C, H, W] by scale.
    static Tensor
    F.upsampleNearest(Tensor x, float scale)
    Nearest-neighbour upsampling of x [N, C, H, W] by scale (PyTorch's mode='nearest').
    static Tensor
    Weight normalisation (Salimans and Kingma): w = g v / ||v|| with the norm over every axis but 0, g of shape [out] (PyTorch's weight_norm with dim 0).
    static Tensor
    F.where(Tensor cond, Tensor a, Tensor b)
    cond !
    Method parameters in ai.beestream.jitnn with type arguments of type Tensor
    Modifier and Type
    Method
    Description
    static Tensor
    Grad.checkpoint(Function<Tensor[],Tensor> segment, Tensor... inputs)
    Activation checkpointing, as PyTorch's torch.utils.checkpoint: runs segment on inputs and keeps none of its activations for the backward pass, which runs the segment again to get them.
    static Tensor
    Grad.clipNorm(List<Tensor> params, float maxNorm)
    Rescales the gradients of params so that their global L2 norm is at most maxNorm, as PyTorch's clip_grad_norm_: every gradient is multiplied by min(1, maxNorm / (norm + 1e-6)).
    static Tensor
    Grad.inference(Supplier<Tensor> forward)
    Runs a forward pass for inference: no gradient recording, and every tensor created inside except the returned one is internal, so its buffer is reused as soon as the computation no longer needs it.
    void
    Tensor.onGradReady(Consumer<Tensor> hook)
    Calls hook with this leaf tensor (a parameter) during each backward pass, as soon as its gradient is final: after the last operator that contributes to it, while the rest of the backward pass is still being recorded.
    Constructors in ai.beestream.jitnn with parameters of type Tensor
    Modifier
    Constructor
    Description
     
    Valued(SparseMatrix matrix, Tensor values)
    Creates an instance of a Valued record class.
  • Uses of Tensor in ai.beestream.jitnn.data

    Methods in ai.beestream.jitnn.data that return Tensor
    Modifier and Type
    Method
    Description
    DataLoader.Batch.x()
    Returns the value of the x record component.
    DataLoader.Batch.y()
    Returns the value of the y record component.
    Constructors in ai.beestream.jitnn.data with parameters of type Tensor
    Modifier
    Constructor
    Description
     
    Batch(Tensor x, Tensor y, int size, int index)
    Creates an instance of a Batch record class.
  • Uses of Tensor in ai.beestream.jitnn.dist

    Methods in ai.beestream.jitnn.dist that return Tensor
    Modifier and Type
    Method
    Description
    default Tensor[]
    Collective.allReduced(int rank, Tensor[] tensors, Collective.ReduceOp op)
    The reduction over all ranks of each tensor.
    NcclCollective.allReduced(int rank, Tensor[] tensors, Collective.ReduceOp op)
    The reduction over the ranks of each tensor, as new tensors: one NCCL call for all of them.
    default Tensor[]
    Collective.finishAllReduce(int rank, Tensor[] tensors, Tensor buffer, Collective.ReduceOp op, int tag)
    NcclCollective.finishAllReduce(int rank, Tensor[] tensors, Tensor buffer, Collective.ReduceOp op, int tag)
    Waits for the all-reduce started with tag and unpacks it into new tensors.
    Methods in ai.beestream.jitnn.dist with parameters of type Tensor
    Modifier and Type
    Method
    Description
    void
    Collective.allGather(int rank, Tensor input, Tensor output)
    input [n, ...] on every rank; output [worldSize * n, ...] receives every rank's input, in rank order.
    void
    HostCollective.allGather(int rank, Tensor input, Tensor output)
     
    void
    NcclCollective.allGather(int rank, Tensor input, Tensor output)
    Persistent output [world * n, ...] receives every rank's input [n, ...], in rank order.
    void
    Collective.allReduce(int rank, Tensor tensor, Collective.ReduceOp op)
    Every rank's tensor replaced, in place, by the reduction over all ranks.
    void
    HostCollective.allReduce(int rank, Tensor tensor, Collective.ReduceOp op)
     
    void
    NcclCollective.allReduce(int rank, Tensor tensor, Collective.ReduceOp op)
    Persistent tensor replaced, on every rank, by the reduction over the ranks.
    default Tensor[]
    Collective.allReduced(int rank, Tensor[] tensors, Collective.ReduceOp op)
    The reduction over all ranks of each tensor.
    NcclCollective.allReduced(int rank, Tensor[] tensors, Collective.ReduceOp op)
    The reduction over the ranks of each tensor, as new tensors: one NCCL call for all of them.
    void
    Collective.broadcast(int rank, Tensor tensor, int root)
    Every rank's tensor replaced, in place, by rank root's.
    void
    HostCollective.broadcast(int rank, Tensor tensor, int root)
     
    void
    NcclCollective.broadcast(int rank, Tensor tensor, int root)
    Persistent tensor replaced, on every rank, by rank root's.
    default Tensor[]
    Collective.finishAllReduce(int rank, Tensor[] tensors, Tensor buffer, Collective.ReduceOp op, int tag)
    NcclCollective.finishAllReduce(int rank, Tensor[] tensors, Tensor buffer, Collective.ReduceOp op, int tag)
    Waits for the all-reduce started with tag and unpacks it into new tensors.
    void
    Collective.reduceScatter(int rank, Tensor input, Tensor output, Collective.ReduceOp op)
    input [worldSize * n, ...] on every rank; output [n, ...] receives on rank r the reduction of every rank's r-th slice.
    void
    HostCollective.reduceScatter(int rank, Tensor input, Tensor output, Collective.ReduceOp op)
     
    void
    NcclCollective.reduceScatter(int rank, Tensor input, Tensor output, Collective.ReduceOp op)
    Persistent output [n, ...] receives the reduction of every rank's slice r of input [world * n, ...].
    default void
    Collective.startAllReduce(int rank, Tensor[] tensors, Tensor buffer, Collective.ReduceOp op, int tag)
    Starts the reduction over all ranks of tensors, packed into the persistent buffer (exactly their total size), so that it runs while the operators recorded after it do: NCCL runs it on a stream of its own.
    void
    NcclCollective.startAllReduce(int rank, Tensor[] tensors, Tensor buffer, Collective.ReduceOp op, int tag)
    Packs tensors into persistent buffer and starts its all-reduce on NCCL's side stream (see Collective.startAllReduce(int, Tensor[], Tensor, Collective.ReduceOp, int)).
  • Uses of Tensor in ai.beestream.jitnn.djl

    Methods in ai.beestream.jitnn.djl that return Tensor
    Modifier and Type
    Method
    Description
    JitnnNDArray.tensor()
    The jitNN tensor behind this array (FP32).
    Methods in ai.beestream.jitnn.djl with parameters of type Tensor
    Modifier and Type
    Method
    Description
    JitnnNDManager.wrap(Tensor tensor, ai.djl.ndarray.types.DataType dataType)
    Wraps a jitNN tensor as an array of this manager.
  • Uses of Tensor in ai.beestream.jitnn.engine

    Fields in ai.beestream.jitnn.engine declared as Tensor
    Modifier and Type
    Field
    Description
    final Tensor[]
    Node.inputs
    The operator's inputs.
    final Tensor[]
    Node.outputs
    The operator's outputs.
    Methods in ai.beestream.jitnn.engine that return Tensor
    Modifier and Type
    Method
    Description
    Node.in(int i)
    Input i.
    Node.out(int i)
    Output i.
    Methods in ai.beestream.jitnn.engine with parameters of type Tensor
    Modifier and Type
    Method
    Description
    uk.ac.manchester.tornado.api.types.arrays.ShortArray
    Emitter.bf16(Tensor t)
    bfloat16 tensors are stored as their raw 16-bit patterns.
    uk.ac.manchester.tornado.api.types.arrays.ByteArray
    Emitter.blocks(Tensor t)
    GGUF block-quantised tensors: their raw blocks.
    uk.ac.manchester.tornado.api.types.arrays.HalfFloatArray
    Emitter.f16(Tensor t)
    The device array of FP16 tensor t.
    uk.ac.manchester.tornado.api.types.arrays.FloatArray
    Emitter.f32(Tensor t)
    The device array of FP32 tensor t, to pass to a kernel.
    uk.ac.manchester.tornado.api.types.arrays.ByteArray
    Emitter.fp8(Tensor t)
    FP8 tensors: one byte per value.
    uk.ac.manchester.tornado.api.types.arrays.IntArray
    Emitter.i32(Tensor t)
    The device array of INT32 tensor t.
    uk.ac.manchester.tornado.api.types.arrays.ByteArray
    Emitter.q8(Tensor t)
    Q8_0 tensors: GGUF's 34-byte blocks of 32 values.
    boolean
    Emitter.unread(Tensor t)
    True when nothing reads t after this plan: an internal output (no user code holds it) that no later operator of the trace consumes and that was not requested.
    Constructors in ai.beestream.jitnn.engine with parameters of type Tensor
    Modifier
    Constructor
    Description
     
    Node(ai.beestream.jitnn.engine.Op op, Tensor[] inputs, Tensor[] outputs, int[] iattr, float[] fattr, boolean traced)
    An application of op; a null attribute array becomes an empty one.
  • Uses of Tensor in ai.beestream.jitnn.gguf

    Methods in ai.beestream.jitnn.gguf that return Tensor
    Modifier and Type
    Method
    Description
    GgufFile.tensor(String name)
    Tensor name as a persistent jitNN tensor, memory-mapped where possible (see the class comment).
    GgufFile.tensor(String name, boolean copy)
    Tensor name; copy reads it into memory instead of mapping it.
    Methods in ai.beestream.jitnn.gguf that return types with arguments of type Tensor
    Modifier and Type
    Method
    Description
    GgufFile.tensors()
    Every tensor in the file (all must be of a type jitNN loads), by name, in file order.
  • Uses of Tensor in ai.beestream.jitnn.io

    Methods in ai.beestream.jitnn.io that return Tensor
    Modifier and Type
    Method
    Description
    StateDict.tensor(String name)
    Tensor name as a new persistent tensor (a weight that stays on the device).
    Methods in ai.beestream.jitnn.io with parameters of type Tensor
    Modifier and Type
    Method
    Description
    void
    StateDict.check(String name, Tensor target)
    Throws unless tensor name can be copied into target (see StateDict.copyInto(String, Tensor)).
    void
    StateDict.copyInto(String name, Tensor target)
    Overwrites the persistent tensor target (a parameter, a buffer, optimiser state) with tensor name, in place, so plans compiled with target keep using it.
    StateDict.put(String name, Tensor t)
    Adds a tensor; its contents are read when the dictionary is saved.
  • Uses of Tensor in ai.beestream.jitnn.ml

    Methods in ai.beestream.jitnn.ml that return Tensor
    Modifier and Type
    Method
    Description
    KMeans.centres()
    The cluster centres [k, features].
    LinearRegression.coef()
    Coefficients [d] (one target) or [t, d].
    LinearSvc.coef()
    The weights: [1, features] for two classes, else [classes, features].
    LogisticRegression.coef()
    Coefficients [1, d] for two classes, [c, d] otherwise.
    The components [k, d].
    GradientBoosting.decisionFunction(Tensor x)
    Raw scores [m, outputs]: the baseline plus every tree.
    LinearSvc.decisionFunction(Tensor x)
    The decision values x w^T + b of each sample.
    LogisticRegression.decisionFunction(Tensor x)
    The decision values x W^T + b of each sample.
    NaiveBayes.featureLogProb()
    Multinomial: the per-class log probabilities of the features [classes, features].
    The embedding [n, components] of samples x [n, features], starting from their PCA projection.
    LinearRegression.intercept()
    The fitted intercept (zero without one).
    LinearSvc.intercept()
    The intercepts, one per row of LinearSvc.coef().
    LogisticRegression.intercept()
    The intercepts, one per row of the weights.
    Back from the projection to the feature space.
    NaiveBayes.jointLogLikelihood(Tensor x)
    Joint log-likelihood [m, c].
    KNeighbors.kneighbors(Tensor q)
    INT32 indices [m, k] of the k nearest training rows of each query row.
    LinearRegression.predict(Tensor x)
    Predictions x w + b for samples x [n, features].
    GradientBoosting.predictProba(Tensor x)
    Class probabilities [n, classes] for samples x.
    KNeighbors.predictProba(Tensor q)
    Class probabilities [m, c]: the fraction of neighbours per class.
    LogisticRegression.predictProba(Tensor x)
    Class probabilities [m, c].
    NaiveBayes.predictProba(Tensor x)
    Class probabilities [n, classes] for samples x.
    GradientBoosting.predictValues(Tensor x)
    Regression predictions [m].
    KNeighbors.predictValues(Tensor q)
    Regression predictions [m, t].
    RandomForest.predictValues(Tensor x)
    Mean of the trees' leaf values: class probabilities [m, c] or predictions [m, 1].
    NaiveBayes.theta()
    Gaussian: the per-class feature means [classes, features].
    Projection [n, k] of x onto the components.
    NaiveBayes.var()
    Gaussian: the per-class feature variances [classes, features], smoothed.
    Methods in ai.beestream.jitnn.ml with parameters of type Tensor
    Modifier and Type
    Method
    Description
    GradientBoosting.decisionFunction(Tensor x)
    Raw scores [m, outputs]: the baseline plus every tree.
    LinearSvc.decisionFunction(Tensor x)
    The decision values x w^T + b of each sample.
    LogisticRegression.decisionFunction(Tensor x)
    The decision values x W^T + b of each sample.
    GradientBoosting.fit(Tensor x, int[] y)
    Fits a classifier to samples x [n, features] and labels y.
    GradientBoosting.fit(Tensor x, Tensor y)
    Regression targets [n].
    KMeans.fit(Tensor x)
    Fits from k-means++ seeds.
    KMeans.fit(Tensor x, Tensor init)
    Fits from the given initial centres [k, d].
    KNeighbors.fit(Tensor x, int[] y)
    Classification: integer labels.
    KNeighbors.fit(Tensor x, Tensor y)
    Regression: targets [n] or [n, t].
    LinearRegression.fit(Tensor x, Tensor y)
    y [n] or [n, t].
    LinearSvc.fit(Tensor x, int[] y)
    Fits samples x [n, features] and labels y.
    LogisticRegression.fit(Tensor x, int[] y)
    Fits samples x [n, features] and labels y.
    NaiveBayes.fit(Tensor x, int[] y)
    Fits samples x [n, features] (counts for the multinomial kind) and labels y.
    Pca.fit(Tensor x)
    Fits samples x [n, features].
    RandomForest.fit(Tensor x, int[] y)
    Fits a classifier to samples x [n, features] and labels y.
    RandomForest.fit(Tensor x, Tensor y)
    Regression targets [n].
    The embedding [n, components] of samples x [n, features], starting from their PCA projection.
    Back from the projection to the feature space.
    NaiveBayes.jointLogLikelihood(Tensor x)
    Joint log-likelihood [m, c].
    KNeighbors.kneighbors(Tensor q)
    INT32 indices [m, k] of the k nearest training rows of each query row.
    int[]
    GradientBoosting.predict(Tensor x)
    The most probable label of each sample.
    int[]
    KMeans.predict(Tensor x)
    Index of the nearest centre of each row.
    int[]
    KNeighbors.predict(Tensor q)
    The majority label of each query's neighbours (a classifier's fit only).
    LinearRegression.predict(Tensor x)
    Predictions x w + b for samples x [n, features].
    int[]
    LinearSvc.predict(Tensor x)
    The predicted label of each sample.
    int[]
    LogisticRegression.predict(Tensor x)
    The most probable label of each sample.
    int[]
    NaiveBayes.predict(Tensor x)
    The most probable label of each sample.
    int[]
    RandomForest.predict(Tensor x)
    The label with the highest averaged probability, for each sample.
    GradientBoosting.predictProba(Tensor x)
    Class probabilities [n, classes] for samples x.
    KNeighbors.predictProba(Tensor q)
    Class probabilities [m, c]: the fraction of neighbours per class.
    LogisticRegression.predictProba(Tensor x)
    Class probabilities [m, c].
    NaiveBayes.predictProba(Tensor x)
    Class probabilities [n, classes] for samples x.
    GradientBoosting.predictValues(Tensor x)
    Regression predictions [m].
    KNeighbors.predictValues(Tensor q)
    Regression predictions [m, t].
    RandomForest.predictValues(Tensor x)
    Mean of the trees' leaf values: class probabilities [m, c] or predictions [m, 1].
    Projection [n, k] of x onto the components.
  • Uses of Tensor in ai.beestream.jitnn.nn

    Methods in ai.beestream.jitnn.nn that return Tensor
    Modifier and Type
    Method
    Description
    Conv2d.bias()
    The bias [out], or null without one.
    ConvTranspose2d.bias()
    The bias [out], or null without one.
    LayerNorm.bias()
    The shift [features], or null without one.
    Linear.bias()
    The bias [out], or null without one.
    protected Tensor
    Module.buffer(Tensor init)
    Registers persistent state that is not trained (running statistics).
    LSTM.Output.c()
    Returns the value of the c record component.
    static Tensor
    Bucketing.causal(Buckets batch, Buckets seq, Tensor idx, int padToken, UnaryOperator<Tensor> model)
    A causal token model (GPT-2, Llama) over INT32 tokens [B, T]: rows padded to a batch size, positions padded at the end to a seq size with padToken, which the real positions never attend to; the result [B, T, ...] for the real rows and positions.
    static Tensor
    Bucketing.crossEntropy(Tensor logits, Tensor labels)
    Mean cross-entropy of the first N rows of logits [B, C] (B a padded batch) against INT32 labels [N]: each real row weighs 1/N and each padded row 0, through a weight tensor, so every N in the bucket runs the same plan.
    AdaptiveAvgPool.forward(Tensor x)
     
    AdaptiveMaxPool.forward(Tensor x)
     
    Add.forward(Tensor x)
     
    AvgPool1d.forward(Tensor x)
     
    AvgPool2d.forward(Tensor x)
     
    AvgPool3d.forward(Tensor x)
     
    BatchNorm2d.forward(Tensor x)
     
    CELU.forward(Tensor x)
     
    Conv1d.forward(Tensor x)
     
    Conv2d.forward(Tensor x)
     
    Conv3d.forward(Tensor x)
     
    ConvTranspose2d.forward(Tensor x)
     
    Cube.forward(Tensor x)
     
    Dropout.forward(Tensor x)
     
    ELU.forward(Tensor x)
     
    Embedding.forward(Tensor index)
     
    EmbeddingBag.forward(Tensor indices)
    Every index its own bag.
    EmbeddingBag.forward(Tensor indices, int[] offsets)
    One row per bag: bag b covers indices offsets[b] .. offsets[b + 1] - 1.
    Flatten.forward(Tensor x)
     
    GlobalAvgPool2d.forward(Tensor x)
     
    GraphConv.forward(Tensor x)
     
    GraphConv.forward(Tensor x, SparseMatrix.Valued adjacency)
    Applies the layer to node features x [nodes, in] over the graph's normalised adjacency (see SparseMatrix.gcn(int, int[], int[])).
    GroupNorm.forward(Tensor x)
     
    GRU.forward(Tensor x)
    Output sequence of the last layer, from zero initial states.
    HardSigmoid.forward(Tensor x)
     
    HardSwish.forward(Tensor x)
     
    HardTanh.forward(Tensor x)
     
    InstanceNorm.forward(Tensor x)
     
    LayerNorm.forward(Tensor x)
     
    LeakyReLU.forward(Tensor x)
     
    Linear.forward(Tensor x)
     
    LocalResponseNorm.forward(Tensor x)
     
    LSTM.forward(Tensor x)
    Output sequence of the last layer, from zero initial states.
    MaxPool1d.forward(Tensor x)
     
    MaxPool2d.forward(Tensor x)
     
    MaxPool3d.forward(Tensor x)
     
    Mish.forward(Tensor x)
     
    abstract Tensor
    Module.forward(Tensor x)
    Applies the module to x.
    MultiheadAttention.forward(Tensor x)
     
    MultiheadAttention.forward(Tensor x, Tensor mask, boolean causal)
    Attention over x [B, T, D] with an optional additive mask (null for none) and optional causal masking.
    Pad.forward(Tensor x)
     
    PReLU.forward(Tensor x)
     
    ReLU.forward(Tensor x)
     
    ReLU6.forward(Tensor x)
     
    RMSNorm.forward(Tensor x)
     
    RReLU.forward(Tensor x)
     
    SELU.forward(Tensor x)
     
    Sequential.forward(Tensor x)
    Applies the layers, fusing a ReLU into the layer before it: Linear + ReLU and Conv2d + ReLU run as one GEMM with the activation in the epilogue, BatchNorm2d + ReLU as one kernel.
    Sigmoid.forward(Tensor x)
     
    Softplus.forward(Tensor x)
     
    Softsign.forward(Tensor x)
     
    SyncBatchNorm2d.forward(Tensor x)
     
    Tanh.forward(Tensor x)
     
    ThresholdedReLU.forward(Tensor x)
     
    Upsample.forward(Tensor x)
     
    BatchNorm2d.forwardRelu(Tensor x)
    relu(forward(x)), fused into the normalisation kernel.
    Conv2d.forwardRelu(Tensor x)
    relu(forward(x)), with the bias and ReLU fused into the convolution's output.
    Linear.forwardRelu(Tensor x)
    relu(forward(x)) as one fused GEMM; Sequential uses it for a Linear followed by ReLU.
    GRU.Output.h()
    Returns the value of the h record component.
    LSTM.Output.h()
    Returns the value of the h record component.
    static Tensor
    Bucketing.masked(Buckets batch, Buckets seq, Tensor idx, Tensor mask, int padToken, BinaryOperator<Tensor> model)
    An encoder with an additive attention mask (BERT): model takes tokens [B, T] and a mask [B, 1, 1, T] or [B, 1, T, T] (mask null for none).
    protected Tensor
    Module.parameter(Tensor init)
    Registers a trainable parameter initialised from init.
    static Tensor
    Bucketing.rows(Buckets batch, Tensor x, UnaryOperator<Tensor> model)
    model over x [N, ...] with N padded to a batch size by zero rows; the result's first N rows.
    BatchNorm2d.runningMean()
    The running mean [channels], updated in training mode.
    SyncBatchNorm2d.runningMean()
    The running mean [channels], updated in training mode.
    BatchNorm2d.runningVar()
    The running variance [channels], updated in training mode.
    SyncBatchNorm2d.runningVar()
    The running variance [channels], updated in training mode.
    Conv1d.weight()
    The weight [out, in, kernel].
    Conv2d.weight()
    The weight [out, in/groups, kernel, kernel].
    Conv3d.weight()
    The weight [out, in, kernel, kernel, kernel].
    ConvTranspose2d.weight()
    The weight [in, out/groups, kernel, kernel].
    Embedding.weight()
    The table [count, dim].
    EmbeddingBag.weight()
    The table [count, dim].
    GraphConv.weight()
    The weight [out, in].
    LayerNorm.weight()
    The scale [features].
    Linear.weight()
    The weight [out, in].
    PReLU.weight()
    The slopes [parameters].
    RMSNorm.weight()
    The scale [features].
    GRU.Output.y()
    Returns the value of the y record component.
    LSTM.Output.y()
    Returns the value of the y record component.
    Methods in ai.beestream.jitnn.nn that return types with arguments of type Tensor
    Modifier and Type
    Method
    Description
    Module.buffers()
    This module's buffers and its children's.
    Module.parameters()
    This module's parameters and its children's, in registration order.
    Methods in ai.beestream.jitnn.nn with parameters of type Tensor
    Modifier and Type
    Method
    Description
    protected Tensor
    Module.buffer(Tensor init)
    Registers persistent state that is not trained (running statistics).
    static Tensor
    Bucketing.causal(Buckets batch, Buckets seq, Tensor idx, int padToken, UnaryOperator<Tensor> model)
    A causal token model (GPT-2, Llama) over INT32 tokens [B, T]: rows padded to a batch size, positions padded at the end to a seq size with padToken, which the real positions never attend to; the result [B, T, ...] for the real rows and positions.
    static Tensor
    Bucketing.crossEntropy(Tensor logits, Tensor labels)
    Mean cross-entropy of the first N rows of logits [B, C] (B a padded batch) against INT32 labels [N]: each real row weighs 1/N and each padded row 0, through a weight tensor, so every N in the bucket runs the same plan.
    AdaptiveAvgPool.forward(Tensor x)
     
    AdaptiveMaxPool.forward(Tensor x)
     
    Add.forward(Tensor x)
     
    AvgPool1d.forward(Tensor x)
     
    AvgPool2d.forward(Tensor x)
     
    AvgPool3d.forward(Tensor x)
     
    BatchNorm2d.forward(Tensor x)
     
    CELU.forward(Tensor x)
     
    Conv1d.forward(Tensor x)
     
    Conv2d.forward(Tensor x)
     
    Conv3d.forward(Tensor x)
     
    ConvTranspose2d.forward(Tensor x)
     
    Cube.forward(Tensor x)
     
    Dropout.forward(Tensor x)
     
    ELU.forward(Tensor x)
     
    Embedding.forward(Tensor index)
     
    EmbeddingBag.forward(Tensor indices)
    Every index its own bag.
    EmbeddingBag.forward(Tensor indices, int[] offsets)
    One row per bag: bag b covers indices offsets[b] .. offsets[b + 1] - 1.
    Flatten.forward(Tensor x)
     
    GlobalAvgPool2d.forward(Tensor x)
     
    GraphConv.forward(Tensor x)
     
    GraphConv.forward(Tensor x, SparseMatrix.Valued adjacency)
    Applies the layer to node features x [nodes, in] over the graph's normalised adjacency (see SparseMatrix.gcn(int, int[], int[])).
    GroupNorm.forward(Tensor x)
     
    GRU.forward(Tensor x)
    Output sequence of the last layer, from zero initial states.
    GRU.forward(Tensor x, Tensor h0, int[] lengths)
    From initial states [layers directions, B, H] (null: zeros), for sequences of lengths (null: all T).
    HardSigmoid.forward(Tensor x)
     
    HardSwish.forward(Tensor x)
     
    HardTanh.forward(Tensor x)
     
    InstanceNorm.forward(Tensor x)
     
    LayerNorm.forward(Tensor x)
     
    LeakyReLU.forward(Tensor x)
     
    Linear.forward(Tensor x)
     
    LocalResponseNorm.forward(Tensor x)
     
    LSTM.forward(Tensor x)
    Output sequence of the last layer, from zero initial states.
    LSTM.forward(Tensor x, Tensor h0, Tensor c0, int[] lengths)
    From initial states [layers directions, B, H] (null: zeros), for sequences of lengths (null: all T).
    MaxPool1d.forward(Tensor x)
     
    MaxPool2d.forward(Tensor x)
     
    MaxPool3d.forward(Tensor x)
     
    Mish.forward(Tensor x)
     
    abstract Tensor
    Module.forward(Tensor x)
    Applies the module to x.
    MultiheadAttention.forward(Tensor x)
     
    MultiheadAttention.forward(Tensor x, Tensor mask, boolean causal)
    Attention over x [B, T, D] with an optional additive mask (null for none) and optional causal masking.
    Pad.forward(Tensor x)
     
    PReLU.forward(Tensor x)
     
    ReLU.forward(Tensor x)
     
    ReLU6.forward(Tensor x)
     
    RMSNorm.forward(Tensor x)
     
    RReLU.forward(Tensor x)
     
    SELU.forward(Tensor x)
     
    Sequential.forward(Tensor x)
    Applies the layers, fusing a ReLU into the layer before it: Linear + ReLU and Conv2d + ReLU run as one GEMM with the activation in the epilogue, BatchNorm2d + ReLU as one kernel.
    Sigmoid.forward(Tensor x)
     
    Softplus.forward(Tensor x)
     
    Softsign.forward(Tensor x)
     
    SyncBatchNorm2d.forward(Tensor x)
     
    Tanh.forward(Tensor x)
     
    ThresholdedReLU.forward(Tensor x)
     
    Upsample.forward(Tensor x)
     
    BatchNorm2d.forwardRelu(Tensor x)
    relu(forward(x)), fused into the normalisation kernel.
    Conv2d.forwardRelu(Tensor x)
    relu(forward(x)), with the bias and ReLU fused into the convolution's output.
    Linear.forwardRelu(Tensor x)
    relu(forward(x)) as one fused GEMM; Sequential uses it for a Linear followed by ReLU.
    static Tensor
    Bucketing.masked(Buckets batch, Buckets seq, Tensor idx, Tensor mask, int padToken, BinaryOperator<Tensor> model)
    An encoder with an additive attention mask (BERT): model takes tokens [B, T] and a mask [B, 1, 1, T] or [B, 1, T, T] (mask null for none).
    protected Tensor
    Module.parameter(Tensor init)
    Registers a trainable parameter initialised from init.
    static Tensor
    Bucketing.rows(Buckets batch, Tensor x, UnaryOperator<Tensor> model)
    model over x [N, ...] with N padded to a batch size by zero rows; the result's first N rows.
    Method parameters in ai.beestream.jitnn.nn with type arguments of type Tensor
    Modifier and Type
    Method
    Description
    static Tensor
    Bucketing.causal(Buckets batch, Buckets seq, Tensor idx, int padToken, UnaryOperator<Tensor> model)
    A causal token model (GPT-2, Llama) over INT32 tokens [B, T]: rows padded to a batch size, positions padded at the end to a seq size with padToken, which the real positions never attend to; the result [B, T, ...] for the real rows and positions.
    static Tensor
    Bucketing.masked(Buckets batch, Buckets seq, Tensor idx, Tensor mask, int padToken, BinaryOperator<Tensor> model)
    An encoder with an additive attention mask (BERT): model takes tokens [B, T] and a mask [B, 1, 1, T] or [B, 1, T, T] (mask null for none).
    static Tensor
    Bucketing.rows(Buckets batch, Tensor x, UnaryOperator<Tensor> model)
    model over x [N, ...] with N padded to a batch size by zero rows; the result's first N rows.
    Constructors in ai.beestream.jitnn.nn with parameters of type Tensor
    Modifier
    Constructor
    Description
     
    Embedding(Tensor init, int paddingIdx)
    An embedding with the given initial table [count, dim].
     
    Creates an instance of a Output record class.
     
    Creates an instance of a Output record class.
  • Uses of Tensor in ai.beestream.jitnn.nn.models

    Methods in ai.beestream.jitnn.nn.models that return Tensor
    Modifier and Type
    Method
    Description
    Vae.decode(Tensor z)
    Decodes latent vectors z [B, latent] to [B, in], each value in (0, 1).
    Bert.encode(Tensor idx, Tensor mask)
    Hidden states [B, T, dim]; mask is additive, broadcast to [B, heads, T, T] (e.g.
    Bert.encode(Tensor idx, Tensor tokenTypes, Tensor mask)
    Hidden states [B, T, dim] with INT32 token types [B, T] (null for all 0; ignored by a model without token-type embeddings) and an additive mask (null for none).
    Bert.forward(Tensor idx)
    Hidden states [B, T, dim] for INT32 tokens [B, T], without a padding mask.
    CharRnn.forward(Tensor tokens)
     
    Dcgan.Discriminator.forward(Tensor x)
     
    Dcgan.Generator.forward(Tensor z)
     
    Doc2Vec.forward(Tensor x)
    The document vectors of ids x.
    GloVe.forward(Tensor x)
    The word vectors W + W~ of ids x.
    GPT2.forward(Tensor idx)
    Logits [B, T, vocab] for INT32 tokens [B, T].
    Llama.forward(Tensor idx)
    Logits [B, T, vocab] for INT32 tokens [B, T].
    UNet.forward(Tensor x)
    Logits [B, 1, H, W] for x [B, in, H, W] (H and W divisible by 4).
    Vae.forward(Tensor x)
    Reconstruction with the mean latent (no sampling).
    Word2Vec.forward(Tensor x)
    The word vectors of ids x.
    Vae.Output.logvar()
    Returns the value of the logvar record component.
    Doc2Vec.loss(int[] documents, int[] targets, int[] contexts, int[] negatives, int k)
    The loss of a batch: document ids [B], the predicted words [B], for PV-DM the context words [B * window2] (null for PV-DBOW), and k negatives per sample.
    GloVe.loss(int[] rows, int[] cols, float[] x)
    The loss of a batch of co-occurrences x at (rows, cols), all > 0.
    static Tensor
    Vae.loss(Vae.Output o, Tensor x)
    The negative ELBO per sample: (binary cross-entropy summed over pixels + KL) / B.
    Word2Vec.loss(int[] centres, int[] contexts, int[] negatives, int k)
    The loss of a batch: skip-gram takes centres [B] and contexts [B]; CBOW takes the centre words [B] and their contexts [B * window2] (window2 per sample). negatives holds k words per sample.
    Bert.mlmLogits(Tensor idx, Tensor mask, Tensor rows)
    MLM logits [M, vocab] at the INT32 flat positions rows [M] (indices into B * T): the hidden rows are gathered first, so the head runs on the masked positions only.
    Vae.Output.mu()
    Returns the value of the mu record component.
    Bert.pooled(Tensor hidden)
    The pooler output [B, dim]: tanh(dense(hidden state of the first token)); needs the pooler.
    Vae.Output.recon()
    Returns the value of the recon record component.
    Methods in ai.beestream.jitnn.nn.models with parameters of type Tensor
    Modifier and Type
    Method
    Description
    Vae.decode(Tensor z)
    Decodes latent vectors z [B, latent] to [B, in], each value in (0, 1).
    Bert.encode(Tensor idx, Tensor mask)
    Hidden states [B, T, dim]; mask is additive, broadcast to [B, heads, T, T] (e.g.
    Bert.encode(Tensor idx, Tensor tokenTypes, Tensor mask)
    Hidden states [B, T, dim] with INT32 token types [B, T] (null for all 0; ignored by a model without token-type embeddings) and an additive mask (null for none).
    Bert.forward(Tensor idx)
    Hidden states [B, T, dim] for INT32 tokens [B, T], without a padding mask.
    CharRnn.forward(Tensor tokens)
     
    Dcgan.Discriminator.forward(Tensor x)
     
    Dcgan.Generator.forward(Tensor z)
     
    Doc2Vec.forward(Tensor x)
    The document vectors of ids x.
    GloVe.forward(Tensor x)
    The word vectors W + W~ of ids x.
    GPT2.forward(Tensor idx)
    Logits [B, T, vocab] for INT32 tokens [B, T].
    Llama.forward(Tensor idx)
    Logits [B, T, vocab] for INT32 tokens [B, T].
    UNet.forward(Tensor x)
    Logits [B, 1, H, W] for x [B, in, H, W] (H and W divisible by 4).
    Vae.forward(Tensor x)
    Reconstruction with the mean latent (no sampling).
    Word2Vec.forward(Tensor x)
    The word vectors of ids x.
    void
    HfCheckpoint.load(Tensor target, String name)
    Copies weight name into parameter target of the same shape.
    void
    HfCheckpoint.loadConcatenated(Tensor target, String... names)
    Copies the concatenation, along the first axis, of names into target.
    void
    HfCheckpoint.loadTransposed(Tensor target, String name)
    Copies the transpose of 2-D weight name into target (GPT-2's Conv1D layers store [in, out]).
    static Tensor
    Vae.loss(Vae.Output o, Tensor x)
    The negative ELBO per sample: (binary cross-entropy summed over pixels + KL) / B.
    Bert.mlmLogits(Tensor idx, Tensor mask, Tensor rows)
    MLM logits [M, vocab] at the INT32 flat positions rows [M] (indices into B * T): the hidden rows are gathered first, so the head runs on the masked positions only.
    Bert.pooled(Tensor hidden)
    The pooler output [B, dim]: tanh(dense(hidden state of the first token)); needs the pooler.
    Vae.run(Tensor x, Tensor eps)
    Encodes x [B, in], samples z = mu + exp(logvar / 2) eps with the given noise eps [B, latent], decodes.
    Constructors in ai.beestream.jitnn.nn.models with parameters of type Tensor
    Modifier
    Constructor
    Description
     
    Output(Tensor recon, Tensor mu, Tensor logvar)
    Creates an instance of a Output record class.
  • Uses of Tensor in ai.beestream.jitnn.nn.optim

    Fields in ai.beestream.jitnn.nn.optim with type parameters of type Tensor
    Modifier and Type
    Field
    Description
    protected final List<Tensor>
    Optimizer.params
    The parameters this optimiser updates.
    Methods in ai.beestream.jitnn.nn.optim that return Tensor
    Modifier and Type
    Method
    Description
    Optimizer.clipGradNorm(float maxNorm)
    Clips the gradients of this optimiser's parameters to a global L2 norm of at most maxNorm at the next Optimizer.step(), as PyTorch's clip_grad_norm_, and returns the norm before clipping (after loss unscaling).
    GradScaler.scale(Tensor loss)
    loss * scale.
    protected Tensor
    Optimizer.takeStats()
    The statistics the next update uses (computed now when a pre-scale is pending), or null; clears them.
    Methods in ai.beestream.jitnn.nn.optim with parameters of type Tensor
    Modifier and Type
    Method
    Description
    GradScaler.scale(Tensor loss)
    loss * scale.
    Method parameters in ai.beestream.jitnn.nn.optim with type arguments of type Tensor
    Modifier and Type
    Method
    Description
    static Adam
    Adam.adamW(List<Tensor> params, float lr, float weightDecay)
    AdamW: Adam with decoupled weight decay, PyTorch's default betas and eps.
    Constructor parameters in ai.beestream.jitnn.nn.optim with type arguments of type Tensor
    Modifier
    Constructor
    Description
     
    AdaDelta(List<Tensor> params, float lr, float rho, float eps, float weightDecay)
    AdaDelta with decay rho, eps and L2 weight decay.
     
    AdaGrad(List<Tensor> params, float lr, float lrDecay, float weightDecay, float initialAccumulator, float eps)
    AdaGrad with learning-rate decay, L2 weight decay, the accumulator's starting value, and eps.
     
    Adam(List<Tensor> params, float lr)
    Adam with PyTorch's defaults: betas 0.9 and 0.999, eps 1e-8, no weight decay.
     
    Adam(List<Tensor> params, float lr, float beta1, float beta2, float eps, float weightDecay, boolean decoupled)
    Adam with the given hyper-parameters; decoupled makes the weight decay AdamW's.
     
    Adam(List<Tensor> params, float lr, float beta1, float beta2, float eps, float weightDecay, boolean decoupled, boolean amsgrad)
    Adam with the given hyper-parameters; decoupled makes the weight decay AdamW's, amsgrad uses AMSGrad's maximum of the second moment.
     
    AdaMax(List<Tensor> params, float lr, float beta1, float beta2, float eps, float weightDecay)
    AdaMax with the given betas, eps and L2 weight decay.
     
    Lamb(List<Tensor> params, float lr, float beta1, float beta2, float eps, float weightDecay)
    LAMB with the given betas, eps and decoupled weight decay.
     
    Lars(List<Tensor> params, float lr, float momentum, float weightDecay, float eta, float eps)
    LARS with the given momentum, weight decay, trust coefficient eta and eps.
     
    NAdam(List<Tensor> params, float lr, float beta1, float beta2, float eps, float weightDecay, float momentumDecay)
    NAdam with the given betas, eps, L2 weight decay and momentum decay psi.
    protected
    Optimizer(List<Tensor> params, float lr)
    An optimiser over params with learning rate lr.
     
    RMSProp(List<Tensor> params, float lr, float alpha, float eps, float weightDecay, float momentum, boolean centered)
    RMSProp with smoothing alpha, eps, L2 weight decay, momentum (0 for none) and, with centered, the variance estimated around the mean gradient.
     
    SGD(List<Tensor> params, float lr)
    Plain SGD: no momentum, no weight decay.
     
    SGD(List<Tensor> params, float lr, float momentum, float weightDecay, boolean nesterov)
    SGD with the given momentum (0 for none), L2 weight decay, and Nesterov momentum when nesterov is set.
  • Uses of Tensor in ai.beestream.jitnn.nn.text

    Methods in ai.beestream.jitnn.nn.text that return Tensor
    Modifier and Type
    Method
    Description
    Tokenizer.Batch.additiveMask()
    An additive attention mask [batch, 1, 1, length]: 0 for tokens, -10000 for padding.
    Tokenizer.Batch.ids()
    The token ids as an INT32 tensor [batch, length].
    Tokenizer.Batch.typeIds()
    The token type (segment) ids as an INT32 tensor [batch, length].
  • Uses of Tensor in ai.beestream.jitnn.onnx

    Methods in ai.beestream.jitnn.onnx that return types with arguments of type Tensor
    Modifier and Type
    Method
    Description
    OnnxSession.run(Map<String,Tensor> inputs)
    Runs the graph on inputs (by graph input name) and returns every graph output, as lazy jitNN tensors (read them with toFloatArray, or keep computing with them).
    Methods in ai.beestream.jitnn.onnx with parameters of type Tensor
    Modifier and Type
    Method
    Description
    static void
    OnnxExport.export(Path file, Function<Tensor,Tensor> forward, Tensor example)
    static void
    OnnxExport.export(Path file, Function<Tensor[],Tensor> forward, Tensor[] inputs, String[] inputNames, String outputName)
    Records forward on inputs (put the model in evaluation mode first) and writes it to file with graph inputs inputNames and the output outputName.
    Method parameters in ai.beestream.jitnn.onnx with type arguments of type Tensor
    Modifier and Type
    Method
    Description
    static void
    OnnxExport.export(Path file, Function<Tensor,Tensor> forward, Tensor example)
    static void
    OnnxExport.export(Path file, Function<Tensor,Tensor> forward, Tensor example)
    static void
    OnnxExport.export(Path file, Function<Tensor[],Tensor> forward, Tensor[] inputs, String[] inputNames, String outputName)
    Records forward on inputs (put the model in evaluation mode first) and writes it to file with graph inputs inputNames and the output outputName.
    OnnxSession.run(Map<String,Tensor> inputs)
    Runs the graph on inputs (by graph input name) and returns every graph output, as lazy jitNN tensors (read them with toFloatArray, or keep computing with them).
  • Uses of Tensor in ai.beestream.jitnn.tf

    Methods in ai.beestream.jitnn.tf that return types with arguments of type Tensor
    Modifier and Type
    Method
    Description
    TfModel.run(Map<String,Tensor> inputs)
    Runs the model; outputs are lazy jitNN tensors, by signature output name.
    Method parameters in ai.beestream.jitnn.tf with type arguments of type Tensor
    Modifier and Type
    Method
    Description
    TfModel.run(Map<String,Tensor> inputs)
    Runs the model; outputs are lazy jitNN tensors, by signature output name.