Uses of Class
io.github.kirstenali.deepj.tensor.Tensor
Packages that use Tensor
Package
Description
Neural networks composed from DeepJ tensors, layers, autograd and backend operations.
-
Uses of Tensor in io.github.kirstenali.deepj.activations
Methods in io.github.kirstenali.deepj.activations that return TensorModifier and TypeMethodDescriptionSoftmax.forwardCausal(Tensor logits, int sequenceLength, float scale) Methods in io.github.kirstenali.deepj.activations with parameters of type TensorModifier and TypeMethodDescriptionSoftmax.forwardCausal(Tensor logits, int sequenceLength, float scale) -
Uses of Tensor in io.github.kirstenali.deepj.autograd
Methods in io.github.kirstenali.deepj.autograd that return TensorModifier and TypeMethodDescriptionstatic Tensorstatic TensorTensor[]static TensorLayoutOps.batchedMatmul(Tensor a, Tensor b, int batches, boolean ta, boolean tb) static Tensorstatic Tensorstatic TensorAttentionOps.causal(Tensor query, Tensor key, Tensor value, int queryHeads, int keyValueHeads, float scale) static TensorActivationOps.causalSoftmax(Tensor input, int length, float scale) static TensorThe derivative is zero at either clipping boundary.static Tensorstatic TensorViewOps.contiguous(Tensor input) static Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic TensorGradientState.gradient()static TensorLayoutOps.indexSelect(Tensor input, int axis, int[] indices) static Tensorstatic Tensorstatic Tensorstatic Tensorstatic TensorTied maxima share the row gradient equally.static Tensorstatic Tensorstatic TensorLayoutOps.mergeHeads(Tensor input, int heads) static Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic TensorAutograd.record(Tensor output, BackwardRule rule, Tensor... inputs) static TensorAutograd.recordSaved(Tensor output, BackwardRule rule, Tensor[] inputs, Tensor... saved) static Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic TensorLayoutOps.splitHeads(Tensor input, int heads) static Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic TensorMethods in io.github.kirstenali.deepj.autograd with parameters of type TensorModifier and TypeMethodDescriptionstatic Tensorstatic TensorTensor[]static voidstatic voidstatic TensorLayoutOps.batchedMatmul(Tensor a, Tensor b, int batches, boolean ta, boolean tb) voidGradientState.bindGradient(Tensor value) static Tensorstatic Tensorstatic TensorAttentionOps.causal(Tensor query, Tensor key, Tensor value, int queryHeads, int keyValueHeads, float scale) static TensorActivationOps.causalSoftmax(Tensor input, int length, float scale) static TensorThe derivative is zero at either clipping boundary.static Tensorstatic TensorViewOps.contiguous(Tensor input) static Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic TensorLayoutOps.indexSelect(Tensor input, int axis, int[] indices) static Tensorstatic Tensorstatic Tensorstatic Tensorstatic TensorTied maxima share the row gradient equally.static Tensorstatic Tensorstatic TensorLayoutOps.mergeHeads(Tensor input, int heads) static Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic TensorAutograd.record(Tensor output, BackwardRule rule, Tensor... inputs) static TensorAutograd.recordSaved(Tensor output, BackwardRule rule, Tensor[] inputs, Tensor... saved) static Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic TensorLayoutOps.splitHeads(Tensor input, int heads) static Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic booleanstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensorstatic Tensor -
Uses of Tensor in io.github.kirstenali.deepj.inference
Methods in io.github.kirstenali.deepj.inference that return TensorModifier and TypeMethodDescriptionInferenceContext.attend(Object owner, Tensor query, Tensor key, Tensor value, int queryHeads, int keyValueHeads, float scale) InferenceContext.rotate(RotaryEmbedding rotary, Tensor input, int length, int heads) Methods in io.github.kirstenali.deepj.inference with parameters of type Tensor -
Uses of Tensor in io.github.kirstenali.deepj.layers
Methods in io.github.kirstenali.deepj.layers that return TensorModifier and TypeMethodDescriptionstatic Tensordefault TensorLayer.forward(Tensor input, InferenceContext context) static Tensorstatic TensorMethods in io.github.kirstenali.deepj.layers with parameters of type Tensor -
Uses of Tensor in io.github.kirstenali.deepj.layers.transformer
Methods in io.github.kirstenali.deepj.layers.transformer that return TensorMethods in io.github.kirstenali.deepj.layers.transformer with parameters of type Tensor -
Uses of Tensor in io.github.kirstenali.deepj.layers.transformer.attention
Methods in io.github.kirstenali.deepj.layers.transformer.attention that return TensorModifier and TypeMethodDescriptionGroupedQueryAttention.forward(Tensor input, InferenceContext context) MultiHeadLatentAttention.forward(Tensor input, InferenceContext context) MultiHeadSelfAttention.forward(Tensor input, InferenceContext context) protected TensorMultiHeadSelfAttention.transformQueryKey(Tensor heads, int seqLen) protected TensorMultiHeadSelfAttention.transformQueryKey(Tensor heads, int length, int offset) protected TensorMultiHeadSelfAttention.transformQueryKey(Tensor heads, int length, InferenceContext context) protected TensorRoPEMultiHeadSelfAttention.transformQueryKey(Tensor heads, int seqLen) protected TensorRoPEMultiHeadSelfAttention.transformQueryKey(Tensor heads, int length, int offset) protected TensorRoPEMultiHeadSelfAttention.transformQueryKey(Tensor heads, int length, InferenceContext context) Methods in io.github.kirstenali.deepj.layers.transformer.attention with parameters of type TensorModifier and TypeMethodDescriptionGroupedQueryAttention.forward(Tensor input, InferenceContext context) MultiHeadLatentAttention.forward(Tensor input, InferenceContext context) MultiHeadSelfAttention.forward(Tensor input, InferenceContext context) protected TensorMultiHeadSelfAttention.transformQueryKey(Tensor heads, int seqLen) protected TensorMultiHeadSelfAttention.transformQueryKey(Tensor heads, int length, int offset) protected TensorMultiHeadSelfAttention.transformQueryKey(Tensor heads, int length, InferenceContext context) protected TensorRoPEMultiHeadSelfAttention.transformQueryKey(Tensor heads, int seqLen) protected TensorRoPEMultiHeadSelfAttention.transformQueryKey(Tensor heads, int length, int offset) protected TensorRoPEMultiHeadSelfAttention.transformQueryKey(Tensor heads, int length, InferenceContext context) -
Uses of Tensor in io.github.kirstenali.deepj.layers.transformer.norm
Methods in io.github.kirstenali.deepj.layers.transformer.norm that return TensorModifier and TypeMethodDescriptionMethods in io.github.kirstenali.deepj.layers.transformer.norm with parameters of type Tensor -
Uses of Tensor in io.github.kirstenali.deepj.loss
Methods in io.github.kirstenali.deepj.loss that return TensorModifier and TypeMethodDescriptionstatic Tensorstatic TensorCrossEntropyLoss.fromIntTargets(int[] targets) static Tensorstatic TensorMethods in io.github.kirstenali.deepj.loss with parameters of type TensorModifier and TypeMethodDescriptionstatic Tensorstatic Tensorstatic Tensorstatic floatstatic floatfloatfloatfloatstatic CrossEntropyResultstatic int[]CrossEntropyLoss.toIntTargets(Tensor actual) -
Uses of Tensor in io.github.kirstenali.deepj.nn
Methods in io.github.kirstenali.deepj.nn that return TensorModifier and TypeMethodDescriptionRecurrentState.cell()Returns the value of thecellrecord component.static TensorTensorJoin.concatenate(int axis, Tensor... inputs) final Tensorfinal Tensorprotected final TensorRecurrentState.hidden()Returns the value of thehiddenrecord component.BatchNorm.runningMean()BatchNorm.runningVariance()RecurrentResult.sequence()Returns the value of thesequencerecord component.static TensorMethods in io.github.kirstenali.deepj.nn that return types with arguments of type TensorModifier and TypeMethodDescriptionBatchNorm.buffers()Module.buffers()Persistent non-parameter tensors, in deterministic traversal order.Methods in io.github.kirstenali.deepj.nn with parameters of type TensorModifier and TypeMethodDescriptionstatic TensorTensorJoin.concatenate(int axis, Tensor... inputs) final Tensorfinal Tensorprotected final Tensorprotected RecurrentStateGRUCell.next(Tensor input, RecurrentState state) protected RecurrentStateLSTMCell.next(Tensor input, RecurrentState state) protected abstract RecurrentStateRecurrentCell.next(Tensor input, RecurrentState state) protected RecurrentStateRNNCell.next(Tensor input, RecurrentState state) final RecurrentResultRecurrent.run(Tensor input, RecurrentState initial, int[] lengths) static Tensorfinal RecurrentStateRecurrentCell.step(Tensor input, RecurrentState state) static TrainerNdSupervisedTraining.trainer(Layer model, LossFunction loss, ParameterOptimizer optimizer, Tensor inputs, Tensor targets, long seed) Constructors in io.github.kirstenali.deepj.nn with parameters of type TensorModifierConstructorDescriptionRecurrentResult(Tensor sequence, RecurrentState state) Creates an instance of aRecurrentResultrecord class.RecurrentState(Tensor hidden) RecurrentState(Tensor hidden, Tensor cell) Creates an instance of aRecurrentStaterecord class. -
Uses of Tensor in io.github.kirstenali.deepj.nn.transformer
Methods in io.github.kirstenali.deepj.nn.transformer that return TensorModifier and TypeMethodDescriptionprotected TensorDecoderOnlyModel.embed(int[] inputIds) protected TensorDecoderOnlyModel.embed(int[] inputIds, int offset) protected TensorDecoderOnlyModel.embedBatch(int[][] inputIds) CausalLM.forward(int[] inputIds) DecoderOnlyModel.forward(int[] inputIds) default TensorCausalLM.forwardBatch(int[][] inputIds) DecoderOnlyModel.forwardBatch(int[][] inputIds) Method parameters in io.github.kirstenali.deepj.nn.transformer with type arguments of type TensorModifier and TypeMethodDescriptionstatic StringTextGenerator.generate(Function<int[], Tensor> forwarder, int maxSeqLen, Tokenizer tok, String prompt, int maxNewTokens, float temperature, int topK, long seed) static StringTextGenerator.generate(Function<int[], Tensor> forwarder, int maxSeqLen, Tokenizer tok, String prompt, int maxNewTokens, float temperature, int topK, long seed, float repetitionPenalty) static StringTextGenerator.generate(Function<int[], Tensor> forwarder, TransformerConfig cfg, Tokenizer tok, String prompt, int maxNewTokens, float temperature, int topK, long seed) static StringTextGenerator.stream(Function<int[], Tensor> forwarder, int maxSeqLen, Tokenizer tok, String prompt, int maxNewTokens, float temperature, int topK, long seed, float repetitionPenalty, Consumer<String> listener) static StringTextGenerator.stream(Function<int[], Tensor> forwarder, int maxSeqLen, Tokenizer tok, String prompt, int maxNewTokens, float temperature, int topK, long seed, Consumer<String> listener) -
Uses of Tensor in io.github.kirstenali.deepj.nn.transformer.origin
Methods in io.github.kirstenali.deepj.nn.transformer.origin that return Tensor -
Uses of Tensor in io.github.kirstenali.deepj.optimisers
Fields in io.github.kirstenali.deepj.optimisers declared as TensorMethods in io.github.kirstenali.deepj.optimisers that return TensorMethods in io.github.kirstenali.deepj.optimisers that return types with arguments of type TensorModifier and TypeMethodDescriptionAdamW.State.firstMoments()Returns the value of thefirstMomentsrecord component.AdamW.State.masterWeights()Returns the value of themasterWeightsrecord component.AdamW.State.secondMoments()Returns the value of thesecondMomentsrecord component.Methods in io.github.kirstenali.deepj.optimisers with parameters of type TensorConstructors in io.github.kirstenali.deepj.optimisers with parameters of type TensorConstructor parameters in io.github.kirstenali.deepj.optimisers with type arguments of type TensorModifierConstructorDescriptionState(long step, float learningRate, float beta1, float beta2, float epsilon, float weightDecay, List<Tensor> firstMoments, List<Tensor> secondMoments) State(long step, float learningRate, float beta1, float beta2, float epsilon, float weightDecay, List<Tensor> firstMoments, List<Tensor> secondMoments, Map<Integer, Tensor> masterWeights) Creates an instance of aStaterecord class.State(long step, float learningRate, float beta1, float beta2, float epsilon, float weightDecay, List<Tensor> firstMoments, List<Tensor> secondMoments, Map<Integer, Tensor> masterWeights) Creates an instance of aStaterecord class. -
Uses of Tensor in io.github.kirstenali.deepj.tensor
Methods in io.github.kirstenali.deepj.tensor that return TensorModifier and TypeMethodDescriptionCausalAttentionResult.accumulatedOutput()Returns the value of theaccumulatedOutputrecord component.Tensor.addBroadcastCols(Tensor colVector) TensorBackend.addBroadcastCols(Tensor a, Tensor colVector) Tensor.addBroadcastRows(Tensor rowVector) TensorBackend.addBroadcastRows(Tensor a, Tensor rowVector) Tensor.addInPlace(Tensor other) Tensor.addRowVector(Tensor rowVector) TensorBackend.addRowVector(Tensor a, Tensor rowVector) Tensor.addScalar(float s) Tensor.addScalarInPlace(float scalar) static Tensorstatic Tensorstatic Tensorstatic TensorCpuNdNormalization.backward(Tensor gradient, Tensor normalized, Tensor denominator, Tensor gamma, boolean centered) default TensorTensorBackend.batchedMatmul(Tensor left, Tensor right, int batches, boolean transposeLeft, boolean transposeRight) static TensorCpuNdElementwise.binary(Tensor left, Tensor right, CpuNdElementwise.Binary operation) static Tensordefault Tensorstatic TensorTensor.causalMask(int size) default TensorTensorBackend.causalMask(Tensor input, int sequenceLength) default TensorTensorBackend.causalSoftmax(Tensor input, int sequenceLength, float scale) Tensor.clamp(float min, float max) final TensorTensorManipulations.contiguous()Tensor.copy()Bit-preserving independent storage with an identity autograd edge.default TensorIndependent storage with the same float bits, without recording an autograd operation.final TensorIndependent value assignment with an explicit cast to this tensor's dtype; shapes must match.TensorBackend.crossEntropyGradient(Tensor logits, int[] targets) TensorBackend.crossEntropyGradient(Tensor logits, int[] targets, boolean[] mask) NormalizationResult.denominator()Returns the value of thedenominatorrecord component.Tensor.detach()Independent detached storage, preserving DeepJ's existing copy-based detach behavior.Tensor.divideBroadcastCols(Tensor colVector) TensorBackend.divideBroadcastCols(Tensor a, Tensor colVector) Tensor.divideInPlace(Tensor other) Tensor.divideScalar(float s) TensorBackend.divideScalar(Tensor a, float scalar) Tensor.divideScalarInPlace(float scalar) Tensor.exp()default Tensorfinal TensorTensorManipulations.expand(int... shape) Tensor.expInPlace()static TensorTensor.from(float[] values) static TensorTensor.from(float[] values, int... shape) static Tensorstatic Tensorstatic TensorTensor.from2D(float[][] data) static TensorTensorAdapters.fromIntColumn(int[] values) SwiGluBackwardResult.gateGradient()Returns the value of thegateGradientrecord component.Tensor.geluActivation()TensorBackend.geluBackward(Tensor input, Tensor gradOutput) Tensor.geluInPlace()Tensor.getRow(int row) Tensor.grad()static TensorCrossEntropyResult.gradient()Returns the value of thegradientrecord component.default TensorTensorBackend.headPrefixMatmul(Tensor left, Tensor cache, int heads, int length, boolean transposeCache) final TensorTensorManipulations.indexAddInPlace(int axis, int[] indices, Tensor updates) default TensorTensorBackend.indexSelect(Tensor input, int axis, int[] indices) final TensorTensorManipulations.indexSelect(int axis, int... indices) default TensorTensorBackend.indexSelectGradient(Tensor gradient, int[] shape, int axis, int[] indices) AttentionGradients.key()Returns the value of thekeyrecord component.TensorBackend.layerNormBackward(Tensor dXHat, Tensor xHat, Tensor std, int dim) Tensor.log()Tensor.logInPlace()CrossEntropyResult.loss()Returns the value of thelossrecord component.static Tensorstatic TensorPackedLayouts.matmul(TensorBackend backend, Tensor left, Tensor right, int batches, boolean transposeLeft, boolean transposeRight) Tensor.maxAlongRows()TensorBackend.maxAlongRows(Tensor a) final TensorTensorManipulations.maxAxes(int... axes) static Tensorfinal TensorTensorManipulations.maximum(int axis, boolean keep) Tied maxima share their gradient equally.default TensorTensorBackend.maximumAxes(Tensor input, int[] axes, boolean keepDimensions) default TensorTensorBackend.maximumAxesBackward(Tensor input, Tensor maximum, Tensor gradient, int[] axes, boolean keep) static TensorCpuNdStatistics.maximumGradient(Tensor input, Tensor maximum, Tensor gradient, int[] axes, boolean keep) static Tensorfinal TensorTensorManipulations.mean(int axis, boolean keep) Tensor.meanAlongRows()TensorBackend.meanAlongRows(Tensor a) default Tensorfinal TensorTensorManipulations.meanAxes(int... axes) static Tensorstatic TensorPackedLayouts.merge(TensorBackend backend, Tensor input, int heads) default TensorTensorBackend.mergeHeads(Tensor input, int heads) Tensor.multiplyBroadcastCols(Tensor colVector) TensorBackend.multiplyBroadcastCols(Tensor a, Tensor colVector) Tensor.multiplyBroadcastRows(Tensor rowVector) TensorBackend.multiplyBroadcastRows(Tensor a, Tensor rowVector) Tensor.multiplyInPlace(Tensor other) Tensor.multiplyScalar(float s) TensorBackend.multiplyScalar(Tensor a, float scalar) Tensor.multiplyScalarInPlace(float scalar) Tensor.neg()Tensor.negInPlace()CausalAttentionResult.normalization()Returns the value of thenormalizationrecord component.default TensorTensorBackend.normalizationBackward(Tensor gradient, Tensor normalized, Tensor denominator, Tensor gamma, boolean centered) NormalizationResult.normalized()Returns the value of thenormalizedrecord component.RmsNormResult.normalized()Returns the value of thenormalizedrecord component.static TensorTensor.ones(int rows, int cols) static TensorCausalAttentionResult.output()Returns the value of theoutputrecord component.NormalizationResult.output()Returns the value of theoutputrecord component.RmsNormResult.output()Returns the value of theoutputrecord component.static Tensordefault Tensorfinal TensorTensorManipulations.permute(int... axes) Tensor.pow(float exponent) static TensorHeadCacheOps.prefix(TensorBackend backend, Tensor cache, int heads, int length) AttentionGradients.query()Returns the value of thequeryrecord component.static Tensorstatic Tensorstatic TensorTensorEncoding.readValuesToBackend(DataInput input, DType dtype, int... shape) Explicit checkpoint transfer; private host staging is released after an independent backend copy.Tensor.reluActivation()TensorBackend.reluBackward(Tensor input, Tensor gradOutput) Tensor.reluInPlace()Tensor.requiresGrad(boolean required) default Tensorfinal TensorTensorManipulations.reshape(int... shape) Tensor.retainDeviceBuffer()RmsNormResult.rms()Returns the value of thermsrecord component.default TensorTensorBackend.rmsNormBackward(Tensor gradient, Tensor normalized, Tensor rms, Tensor gamma) static Tensordefault Tensorstatic Tensorstatic TensorTensor.sampleRows(Tensor t, int n, Random rnd) static Tensorstatic Tensordefault Tensorfinal TensorTensorManipulations.select(int axis, int index) Tensor.sigmoidActivation()Tensor.sigmoidInPlace()default Tensorfinal TensorTensorManipulations.slice(int axis, int start, int stop) final TensorTensorManipulations.slice(int axis, int start, int stop, int step) static TensorCpuNdReduction.sliceGradient(Tensor gradient, int[] dimensions, int axis, int start, int step) default TensorTensorBackend.sliceGradient(Tensor gradient, int[] shape, int axis, int start, int step) static Tensordefault Tensorstatic Tensorfinal TensorTensorManipulations.softmax(int axis) default TensorTensorBackend.softmaxAxis(Tensor input, int axis) default TensorTensorBackend.softmaxAxisBackward(Tensor gradient, Tensor output, int axis) TensorBackend.softmaxBackward(Tensor gradOutput, Tensor softmaxOut) default TensorTensorBackend.softmaxBackward(Tensor gradOutput, Tensor softmaxOut, float scale) Tensor.softmaxRows()TensorBackend.softmaxRows(Tensor logits) static Tensorstatic TensorPackedLayouts.split(TensorBackend backend, Tensor input, int heads) default TensorTensorBackend.splitHeads(Tensor input, int heads) Tensor.sqrt()Tensor.sqrtInPlace()Tensor.subtractBroadcastCols(Tensor colVector) TensorBackend.subtractBroadcastCols(Tensor a, Tensor colVector) Tensor.subtractInPlace(Tensor other) static Tensorfinal TensorTensorManipulations.sum(int axis, boolean keepDimensions) Tensor.sumAlongCols()TensorBackend.sumAlongCols(Tensor a) Tensor.sumAlongRows()TensorBackend.sumAlongRows(Tensor a) default Tensorfinal TensorTensorManipulations.sumAxes(int... axes) Tensor.sumRows()Tensor.sumTensor()default TensorTensorBackend.sumToShape(Tensor input, int... shape) default TensorTensor.tanhActivation()Tensor.tanhInPlace()protected TensorTensor.tensor()protected abstract TensorTensorManipulations.tensor()final TensorTensor.transpose()final TensorTensorManipulations.transpose(int first, int second) static TensorCpuNdElementwise.unary(Tensor input, CpuNdElementwise.Unary operation) static TensorTensorAdapters.unpackF32(float[] flat, int rows, int cols) default Tensorfinal TensorTensorManipulations.unsqueeze(int axis) SwiGluBackwardResult.upGradient()Returns the value of theupGradientrecord component.AttentionGradients.value()Returns the value of thevaluerecord component.static Tensorfinal TensorTensorManipulations.variance(int axis, boolean keep) Population variance; use the correction overload for a different denominator.final TensorTensorManipulations.variance(int axis, boolean keep, int correction) Tensor.varianceAlongRows()TensorBackend.varianceAlongRows(Tensor a) default TensorTensorBackend.varianceAxes(Tensor input, int[] axes, boolean keepDimensions, int correction) final TensorTensorManipulations.varianceAxes(int[] axes, boolean keep, int correction) default Tensorfinal TensorTensorManipulations.view(int... shape) static TensorTensor.zeros(int rows, int cols) default TensorTensorBackend.zeros(int rows, int columns) Backend-owned positive-zero storage; ordinary Tensor constructors stay CPU-backed.default Tensorstatic TensorMethods in io.github.kirstenali.deepj.tensor with parameters of type TensorModifier and TypeMethodDescriptionstatic voidTensor.adamWUpdate(Tensor w, Tensor g, Tensor mt, Tensor vt, float lr, float beta1, float beta2, float eps, float weightDecay, float bc1, float bc2) voidTensorBackend.adamWUpdate(Tensor w, Tensor g, Tensor mt, Tensor vt, float lr, float beta1, float beta2, float eps, float weightDecay, float bc1, float bc2) static voidTensor.addBroadcastCols(Tensor colVector) TensorBackend.addBroadcastCols(Tensor a, Tensor colVector) Tensor.addBroadcastRows(Tensor rowVector) TensorBackend.addBroadcastRows(Tensor a, Tensor rowVector) Tensor.addInPlace(Tensor other) voidTensorBackend.addInPlace(Tensor a, Tensor b) static voidCpuNdIndexing.addMatrixRows(Tensor target, int[] indices, Tensor updates) Tensor.addRowVector(Tensor rowVector) TensorBackend.addRowVector(Tensor a, Tensor rowVector) voidTensorBackend.addScalarInPlace(Tensor a, float s) static voidstatic CrossEntropyResultstatic Tensorstatic NormalizationResultstatic Tensorstatic Tensorstatic CrossEntropyResultCrossEntropyDefaults.apply(TensorBackend backend, Tensor logits, int[] targets, boolean[] mask) static voidstatic TensorCpuNdNormalization.backward(Tensor gradient, Tensor normalized, Tensor denominator, Tensor gamma, boolean centered) static SwiGluBackwardResultstatic voidvoiddefault TensorTensorBackend.batchedMatmul(Tensor left, Tensor right, int batches, boolean transposeLeft, boolean transposeRight) static intstatic TensorCpuNdElementwise.binary(Tensor left, Tensor right, CpuNdElementwise.Binary operation) static voidCpuNdElementwise.binaryInto(Tensor left, Tensor right, Tensor output, CpuNdElementwise.Binary operation) static Tensordefault TensorCausalAttentionBackend.causalAttention(Tensor query, Tensor key, Tensor value, int heads, float scale) default CausalAttentionResultCausalAttentionBackend.causalAttention(Tensor query, Tensor key, Tensor value, int queryHeads, int keyValueHeads, float scale) CausalAttentionBackend.causalAttentionBackward(Tensor query, Tensor key, Tensor value, CausalAttentionResult saved, Tensor gradient, int heads, float scale) default AttentionGradientsCausalAttentionBackend.causalAttentionBackward(Tensor query, Tensor key, Tensor value, CausalAttentionResult saved, Tensor gradient, int queryHeads, int keyValueHeads, float scale) default TensorTensorBackend.causalMask(Tensor input, int sequenceLength) default TensorTensorBackend.causalSoftmax(Tensor input, int sequenceLength, float scale) static intdefault TensorIndependent storage with the same float bits, without recording an autograd operation.final TensorIndependent value assignment with an explicit cast to this tensor's dtype; shapes must match.default voidExplicitly assigns logical values, casting to the destination's storage dtype.default CrossEntropyResultTensorBackend.crossEntropy(Tensor logits, int[] targets) default CrossEntropyResultTensorBackend.crossEntropy(Tensor logits, int[] targets, boolean[] mask) TensorBackend.crossEntropyGradient(Tensor logits, int[] targets) TensorBackend.crossEntropyGradient(Tensor logits, int[] targets, boolean[] mask) floatTensorBackend.crossEntropyLoss(Tensor logits, int[] targets) floatTensorBackend.crossEntropyLoss(Tensor logits, int[] targets, boolean[] mask) Tensor.divideBroadcastCols(Tensor colVector) TensorBackend.divideBroadcastCols(Tensor a, Tensor colVector) Tensor.divideInPlace(Tensor other) voidTensorBackend.divideInPlace(Tensor a, Tensor b) TensorBackend.divideScalar(Tensor a, float scalar) voidTensorBackend.divideScalarInPlace(Tensor a, float s) default TensorvoidTensorBackend.expInPlace(Tensor a) voidstatic voidNormalizationChecks.forward(Tensor input, Tensor gamma, Tensor beta, float epsilon, boolean centered) TensorBackend.geluBackward(Tensor input, Tensor gradOutput) voidTensorBackend.geluInPlace(Tensor a) static Tensordefault TensorTensorBackend.headPrefixMatmul(Tensor left, Tensor cache, int heads, int length, boolean transposeCache) default voidfinal TensorTensorManipulations.indexAddInPlace(int axis, int[] indices, Tensor updates) default TensorTensorBackend.indexSelect(Tensor input, int axis, int[] indices) default TensorTensorBackend.indexSelectGradient(Tensor gradient, int[] shape, int axis, int[] indices) TensorBackend.layerNormBackward(Tensor dXHat, Tensor xHat, Tensor std, int dim) static voidNormalizationChecks.layerStatistics(Tensor input, Tensor std) static intvoidTensorBackend.logInPlace(Tensor a) static floatstatic Tensordefault voidTensorBackend.materializeTensor(Tensor t) static TensorPackedLayouts.matmul(TensorBackend backend, Tensor left, Tensor right, int batches, boolean transposeLeft, boolean transposeRight) static booleanTensorBackend.maxAlongRows(Tensor a) static Tensordefault TensorTensorBackend.maximumAxes(Tensor input, int[] axes, boolean keepDimensions) default TensorTensorBackend.maximumAxesBackward(Tensor input, Tensor maximum, Tensor gradient, int[] axes, boolean keep) static TensorCpuNdStatistics.maximumGradient(Tensor input, Tensor maximum, Tensor gradient, int[] axes, boolean keep) static TensorTensorBackend.meanAlongRows(Tensor a) default Tensorstatic Tensorstatic TensorPackedLayouts.merge(TensorBackend backend, Tensor input, int heads) default TensorTensorBackend.mergeHeads(Tensor input, int heads) Tensor.multiplyBroadcastCols(Tensor colVector) TensorBackend.multiplyBroadcastCols(Tensor a, Tensor colVector) Tensor.multiplyBroadcastRows(Tensor rowVector) TensorBackend.multiplyBroadcastRows(Tensor a, Tensor rowVector) Tensor.multiplyInPlace(Tensor other) voidTensorBackend.multiplyInPlace(Tensor a, Tensor b) TensorBackend.multiplyScalar(Tensor a, float scalar) voidTensorBackend.multiplyScalarInPlace(Tensor a, float s) voidTensorBackend.negInPlace(Tensor a) default TensorTensorBackend.normalizationBackward(Tensor gradient, Tensor normalized, Tensor denominator, Tensor gamma, boolean centered) default NormalizationResultstatic PackedMatmulShapestatic DTypeNormalizationChecks.outputType(Tensor input, Tensor gamma, Tensor beta, boolean centered) static Tensorstatic float[]static voiddefault Tensorstatic intstatic TensorHeadCacheOps.prefix(TensorBackend backend, Tensor cache, int heads, int length) static voidstatic voidTensorEncoding.readValues(DataInput input, Tensor tensor) TensorBackend.reluBackward(Tensor input, Tensor gradOutput) voidTensorBackend.reluInPlace(Tensor a) static voidstatic voidMatrixShapeChecks.requireCausal(Tensor input, int sequenceLength) voidTensorDescriptor.requireMatches(Tensor tensor) static voidMatrixShapeChecks.requireMatrix(Tensor input) static voidHeadCacheOps.requirePrefix(Tensor cache, int heads, int length) static voidMatrixShapeChecks.requireRotary(Tensor input, Tensor cosine, Tensor sine, int sequenceLength) static voidMatrixShapeChecks.requireRowMaximum(Tensor input) static voidTensor.requireSameShape(Tensor a, Tensor b, String op) static voidOptimizerChecks.requireState(Tensor weight, Tensor gradient, Tensor first, Tensor second) static voidCrossEntropyChecks.requireTargets(Tensor logits, int[] targets) static voidTensor.requireTargetsMatchRows(Tensor logits, int[] targets) static voidSequenceLayout.requireWidth(Tensor input, int width) static voidHeadCacheOps.requireWrite(Tensor cache, Tensor update, int heads, int offset) default Tensorstatic voidExplicit host-side restoration after file validation; not an operator fallback.default RmsNormResultdefault TensorTensorBackend.rmsNormBackward(Tensor gradient, Tensor normalized, Tensor rms, Tensor gamma) static Tensordefault Tensorstatic booleanCpuNdElementwise.sameMatrices(Tensor left, Tensor right) static Tensorstatic TensorTensor.sampleRows(Tensor t, int n, Random rnd) static voidTensor.scatterAddRows(Tensor target, int[] indices, Tensor grad) voidTensorBackend.scatterAddRows(Tensor target, int[] indices, Tensor grad) static Tensorstatic Tensordefault TensorvoidvoidTensorBackend.sigmoidInPlace(Tensor a) default Tensorstatic TensorCpuNdReduction.sliceGradient(Tensor gradient, int[] dimensions, int axis, int start, int step) default TensorTensorBackend.sliceGradient(Tensor gradient, int[] shape, int axis, int start, int step) static Tensordefault Tensorstatic Tensordefault TensorTensorBackend.softmaxAxis(Tensor input, int axis) default TensorTensorBackend.softmaxAxisBackward(Tensor gradient, Tensor output, int axis) TensorBackend.softmaxBackward(Tensor gradOutput, Tensor softmaxOut) default TensorTensorBackend.softmaxBackward(Tensor gradOutput, Tensor softmaxOut, float scale) TensorBackend.softmaxRows(Tensor logits) static Tensorstatic TensorPackedLayouts.split(TensorBackend backend, Tensor input, int heads) default TensorTensorBackend.splitHeads(Tensor input, int heads) voidTensorBackend.sqrtInPlace(Tensor a) static voidNormalizationChecks.statistics(Tensor input, Tensor denominator) static int[]NormalizationChecks.statisticsShape(Tensor input) Tensor.subtractBroadcastCols(Tensor colVector) TensorBackend.subtractBroadcastCols(Tensor a, Tensor colVector) Tensor.subtractInPlace(Tensor other) voidTensorBackend.subtractInPlace(Tensor a, Tensor b) static TensorfloatfloatTensorBackend.sumAlongCols(Tensor a) TensorBackend.sumAlongRows(Tensor a) default Tensordefault TensorTensorBackend.sumToShape(Tensor input, int... shape) booleanCausalAttentionBackend.supportsCausalAttention(Tensor query, Tensor key, Tensor value, int heads, float scale) default booleanCausalAttentionBackend.supportsCausalAttention(Tensor query, Tensor key, Tensor value, int queryHeads, int keyValueHeads, float scale) default Tensordefault SwiGluBackwardResultTensorBackend.swiGluBackward(Tensor gradient, Tensor gate, Tensor up) voidTensorBackend.tanhInPlace(Tensor a) static floatstatic intHeadLayout.totalHeads(Tensor input, int heads) static TensorCpuNdElementwise.unary(Tensor input, CpuNdElementwise.Unary operation) static voidCpuNdElementwise.unaryInto(Tensor input, Tensor output, CpuNdElementwise.Unary operation) static voidTensorAdapters.unpackF32Into(float[] flat, Tensor t) default Tensorstatic voidCpuNdAdamW.update(Tensor weight, Tensor gradient, Tensor first, Tensor second, float learningRate, float beta1, float beta2, float epsilon, float decay, float bc1, float bc2) static TensorTensorBackend.varianceAlongRows(Tensor a) default TensorTensorBackend.varianceAxes(Tensor input, int[] axes, boolean keepDimensions, int correction) default Tensorstatic intstatic voidTensorEncoding.write(DataOutput output, Tensor tensor) default voidTensorBackend.writeHeadCache(Tensor cache, Tensor update, int heads, int offset) static voidHeadCacheOps.writeLayouts(TensorBackend backend, Tensor cache, Tensor update, int heads, int offset) static voidTensorEncoding.writeValues(DataOutput output, Tensor tensor) Method parameters in io.github.kirstenali.deepj.tensor with type arguments of type TensorConstructors in io.github.kirstenali.deepj.tensor with parameters of type TensorModifierConstructorDescriptionAttentionGradients(Tensor query, Tensor key, Tensor value) Creates an instance of aAttentionGradientsrecord class.CausalAttentionResult(Tensor output, Tensor normalization) CausalAttentionResult(Tensor output, Tensor normalization, Tensor accumulatedOutput) Creates an instance of aCausalAttentionResultrecord class.CrossEntropyResult(Tensor loss, Tensor gradient) Creates an instance of aCrossEntropyResultrecord class.NormalizationResult(Tensor output, Tensor normalized, Tensor denominator) Creates an instance of aNormalizationResultrecord class.RmsNormResult(Tensor output, Tensor normalized, Tensor rms) Creates an instance of aRmsNormResultrecord class.SwiGluBackwardResult(Tensor gateGradient, Tensor upGradient) Creates an instance of aSwiGluBackwardResultrecord class. -
Uses of Tensor in io.github.kirstenali.deepj.tensor.cpu
Methods in io.github.kirstenali.deepj.tensor.cpu that return TensorModifier and TypeMethodDescriptionCpuBackend.batchedMatmul(Tensor left, Tensor right, int batches, boolean ta, boolean tb) CpuBackend.causalSoftmax(Tensor input, int length, float scale) CpuBackend.indexSelect(Tensor input, int axis, int[] indices) CpuBackend.indexSelectGradient(Tensor gradient, int[] shape, int axis, int[] indices) CpuBackend.maximumAxes(Tensor input, int[] axes, boolean keep) CpuBackend.maximumAxesBackward(Tensor input, Tensor maximum, Tensor gradient, int[] axes, boolean keep) CpuBackend.mergeHeads(Tensor input, int heads) CpuBackend.normalizationBackward(Tensor gradient, Tensor normalized, Tensor denominator, Tensor gamma, boolean centered) CpuBackend.rmsNormBackward(Tensor gradient, Tensor normalized, Tensor rms, Tensor gamma) CpuBackend.sliceGradient(Tensor gradient, int[] shape, int axis, int start, int step) CpuBackend.softmaxAxis(Tensor input, int axis) CpuBackend.splitHeads(Tensor input, int heads) CpuBackend.varianceAxes(Tensor input, int[] axes, boolean keep, int correction) Methods in io.github.kirstenali.deepj.tensor.cpu with parameters of type TensorModifier and TypeMethodDescriptionCpuBackend.batchedMatmul(Tensor left, Tensor right, int batches, boolean ta, boolean tb) CpuBackend.causalSoftmax(Tensor input, int length, float scale) voidCpuBackend.crossEntropy(Tensor logits, int[] targets) CpuBackend.crossEntropy(Tensor logits, int[] targets, boolean[] mask) voidCpuBackend.indexSelect(Tensor input, int axis, int[] indices) CpuBackend.indexSelectGradient(Tensor gradient, int[] shape, int axis, int[] indices) CpuBackend.maximumAxes(Tensor input, int[] axes, boolean keep) CpuBackend.maximumAxesBackward(Tensor input, Tensor maximum, Tensor gradient, int[] axes, boolean keep) CpuBackend.mergeHeads(Tensor input, int heads) CpuBackend.normalizationBackward(Tensor gradient, Tensor normalized, Tensor denominator, Tensor gamma, boolean centered) CpuBackend.rmsNormBackward(Tensor gradient, Tensor normalized, Tensor rms, Tensor gamma) CpuBackend.sliceGradient(Tensor gradient, int[] shape, int axis, int start, int step) CpuBackend.softmaxAxis(Tensor input, int axis) CpuBackend.splitHeads(Tensor input, int heads) CpuBackend.swiGluBackward(Tensor gradient, Tensor gate, Tensor up) CpuBackend.varianceAxes(Tensor input, int[] axes, boolean keep, int correction) -
Uses of Tensor in io.github.kirstenali.deepj.training
Methods in io.github.kirstenali.deepj.training with parameters of type TensorModifier and TypeMethodDescriptionstatic TrainerSupervisedTraining.trainer(Layer model, LossFunction lossFn, ParameterOptimizer opt, Tensor xAll, Tensor yAll, long seed) -
Uses of Tensor in io.github.kirstenali.deepj.transformer
Methods in io.github.kirstenali.deepj.transformer that return TensorModifier and TypeMethodDescriptionLoopedTransformer.forward(Tensor input, InferenceContext inference) TransformerStack.forward(Tensor input, InferenceContext context) Methods in io.github.kirstenali.deepj.transformer with parameters of type Tensor -
Uses of Tensor in io.github.kirstenali.deepj.transformer.embeddings
Methods in io.github.kirstenali.deepj.transformer.embeddings that return TensorModifier and TypeMethodDescriptionRotaryEmbedding.applyBackward(Tensor t, int seqLen, int nHeads) RotaryEmbedding.applyInference(Tensor input, int length, int heads, int offset) Continuing positions for rolling inference; persistent rotary tables never grow.Embedding.forward(int[] ids) PositionalEmbedding.forward(int seqLen) PositionalEmbedding.forward(int seqLen, int offset) Embedding.forwardBatch(int[][] sequences) Methods in io.github.kirstenali.deepj.transformer.embeddings with parameters of type TensorModifier and TypeMethodDescriptionRotaryEmbedding.applyBackward(Tensor t, int seqLen, int nHeads) RotaryEmbedding.applyInference(Tensor input, int length, int heads, int offset) Continuing positions for rolling inference; persistent rotary tables never grow.