Versions in this module Expand all Collapse all v0 v0.1.1 Dec 1, 2026 Changes in this version type Function + func (f *Function) FusedRoPE(x, cos, sin compute.Value, config compute.FusedRoPEConfig) (compute.Value, error) v0.1.0 Nov 30, 2026 Changes in this version + const BackendName + func New(config string) (compute.Backend, error) + type Backend struct + func (b *Backend) BufferFromFlatData(deviceNum compute.DeviceNum, flat any, shape shapes.Shape) (compute.Buffer, error) + func (b *Backend) Builder(name string) compute.Builder + func (b *Backend) Capabilities() compute.Capabilities + func (b *Backend) Description() string + func (b *Backend) DeviceDescription(deviceNum compute.DeviceNum) string + func (b *Backend) Finalize() + func (b *Backend) HasSharedBuffers() bool + func (b *Backend) IsFinalized() bool + func (b *Backend) Name() string + func (b *Backend) NewSharedBuffer(deviceNum compute.DeviceNum, shape shapes.Shape) (compute.Buffer, any, error) + func (b *Backend) NumDevices() int + func (b *Backend) String() string + type Buffer struct + func (buf *Buffer) Backend() compute.Backend + func (buf *Buffer) CopyToDevice(deviceNum compute.DeviceNum) (compute.Buffer, error) + func (buf *Buffer) Data() (any, error) + func (buf *Buffer) DeviceNum() (compute.DeviceNum, error) + func (buf *Buffer) Finalize() error + func (buf *Buffer) Shape() (shapes.Shape, error) + func (buf *Buffer) ToFlatData(flat any) error + type Builder struct + func (b *Builder) Compile() (compute.Executable, error) + func (b *Builder) Main() compute.Function + func (b *Builder) Name() string + func (b *Builder) NewFunction(name string) (compute.Function, error) + func (b *Builder) OpShape(op compute.Value) (shapes.Shape, error) + type Executable struct + func (e *Executable) Execute(inputs []compute.Buffer, donate []bool, defaultDevice compute.DeviceNum) ([]compute.Buffer, error) + func (e *Executable) Finalize() + func (e *Executable) Inputs() ([]string, []shapes.Shape) + func (e *Executable) Outputs() []shapes.Shape + type Function struct + func (f *Function) Abs(x compute.Value) (compute.Value, error) + func (f *Function) Add(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) ArgMinMax(x compute.Value, axis int, outputDType dtypes.DType, isMin bool) (compute.Value, error) + func (f *Function) Atan2(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) BatchNormForInference(operand, scale, offset, mean, variance compute.Value, epsilon float32, ...) (compute.Value, error) + func (f *Function) BatchNormForTraining(operand, scale, offset compute.Value, epsilon float32, featureAxis int) (compute.Value, compute.Value, compute.Value, error) + func (f *Function) BatchNormGradient(operand, scale, mean, variance, gradOutput compute.Value, epsilon float32, ...) (compute.Value, compute.Value, compute.Value, error) + func (f *Function) BitCount(x compute.Value) (compute.Value, error) + func (f *Function) Bitcast(x compute.Value, targetDType dtypes.DType) (compute.Value, error) + func (f *Function) BitwiseAnd(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) BitwiseNot(x compute.Value) (compute.Value, error) + func (f *Function) BitwiseOr(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) BitwiseXor(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) BroadcastInDim(operand compute.Value, outputShape shapes.Shape, broadcastAxes []int) (compute.Value, error) + func (f *Function) Builder() compute.Builder + func (f *Function) Call(target compute.Function, inputs ...compute.Value) ([]compute.Value, error) + func (f *Function) Ceil(x compute.Value) (compute.Value, error) + func (f *Function) Clamp(minVal, x, maxVal compute.Value) (compute.Value, error) + func (f *Function) Closure() (compute.Function, error) + func (f *Function) Clz(x compute.Value) (compute.Value, error) + func (f *Function) Complex(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) Concatenate(axis int, operands ...compute.Value) (compute.Value, error) + func (f *Function) Conj(x compute.Value) (compute.Value, error) + func (f *Function) Constant(flat any, dims ...int) (compute.Value, error) + func (f *Function) ConstantFromBuffer(buf compute.Buffer, donate bool) (compute.Value, error) + func (f *Function) ConvGeneral(input, kernel compute.Value, axes compute.ConvolveAxesConfig, strides []int, ...) (compute.Value, error) + func (f *Function) ConvertDType(x compute.Value, dtype dtypes.DType) (compute.Value, error) + func (f *Function) Cos(x compute.Value) (compute.Value, error) + func (f *Function) CumMax(operand compute.Value, axis int, options compute.CumSumOptions) (compute.Value, error) + func (f *Function) CumSum(operand compute.Value, axis int, options compute.CumSumOptions) (compute.Value, error) + func (f *Function) Div(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) DotGeneral(lhs compute.Value, lhsContractingAxes, lhsBatchAxes []int, rhs compute.Value, ...) (compute.Value, error) + func (f *Function) DynamicBroadcastInDim(operand compute.Value, broadcastAxes []int, ...) (compute.Value, error) + func (f *Function) DynamicDimensionSize(operand compute.Value, axis int) (compute.Value, error) + func (f *Function) DynamicIota(dtype dtypes.DType, iotaAxis int, dimensions ...compute.DynamicDimensionSpec) (compute.Value, error) + func (f *Function) DynamicPad(x, fillValue compute.Value, axesConfig ...compute.DynamicPadAxis) (compute.Value, error) + func (f *Function) DynamicReshape(operand compute.Value, dimensions ...compute.DynamicDimensionSpec) (compute.Value, error) + func (f *Function) DynamicShape(operand compute.Value) (compute.Value, error) + func (f *Function) DynamicSlice(operand compute.Value, startIndices []compute.Value, sliceDims []int) (compute.Value, error) + func (f *Function) DynamicUpdateSlice(operand, update compute.Value, startIndices []compute.Value) (compute.Value, error) + func (f *Function) Equal(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) EqualTotalOrder(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) Erf(x compute.Value) (compute.Value, error) + func (f *Function) Exp(x compute.Value) (compute.Value, error) + func (f *Function) Expm1(x compute.Value) (compute.Value, error) + func (f *Function) Floor(x compute.Value) (compute.Value, error) + func (f *Function) FusedActivation(x compute.Value, cfg compute.ActivationConfig) (compute.Value, error) + func (f *Function) FusedActivationVJP(y, x, dOutput compute.Value, cfg compute.ActivationConfig) (compute.Value, error) + func (f *Function) FusedAttentionQKVProjection(x, wQKV, biasQ, biasK, biasV compute.Value, queryDim, keyValueDim int) (query, key, value compute.Value, err error) + func (f *Function) FusedDense(x, weight, bias compute.Value, options compute.DenseConfig) (compute.Value, error) + func (f *Function) FusedDenseVJP(x, weight, bias, y, dOutput compute.Value, options compute.DenseConfig) (dx, dWeight, dBias compute.Value, err error) + func (f *Function) FusedLayerNorm(x compute.Value, axes []int, epsilon float64, gamma, beta compute.Value) (compute.Value, error) + func (f *Function) FusedLayerNormVJP(x, dOutput compute.Value, axes []int, epsilon float64, ...) (dx, dGamma, dBeta compute.Value, err error) + func (f *Function) FusedQuantizedDense(x, weight, bias compute.Value, options compute.FusedQuantizedDenseConfig) (compute.Value, error) + func (f *Function) FusedQuantizedDenseVJP(x, weight, bias, y, dOutput compute.Value, ...) (dx, dBias compute.Value, err error) + func (f *Function) FusedScaledDotProductAttention(query, key, value compute.Value, axesLayout compute.AttentionAxesLayout, ...) (output compute.Value, statesForVJP []compute.Value, err error) + func (f *Function) FusedSoftmax(x compute.Value, axis int) (compute.Value, error) + func (f *Function) FusedTopK(operand compute.Value, k int, cfg compute.FusedTopKConfig) (values, indices compute.Value, err error) + func (f *Function) Gather(operand, startIndices compute.Value, indexVectorAxis int, ...) (compute.Value, error) + func (f *Function) GreaterOrEqual(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) GreaterOrEqualTotalOrder(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) GreaterThan(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) GreaterThanTotalOrder(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) Identity(x compute.Value) (compute.Value, error) + func (f *Function) If(pred compute.Value, trueBranch, falseBranch compute.Function) ([]compute.Value, error) + func (f *Function) Imag(x compute.Value) (compute.Value, error) + func (f *Function) Iota(shape shapes.Shape, iotaAxis int) (compute.Value, error) + func (f *Function) IsFinite(x compute.Value) (compute.Value, error) + func (f *Function) IsNaN(x compute.Value) (compute.Value, error) + func (f *Function) LessOrEqual(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) LessOrEqualTotalOrder(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) LessThan(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) LessThanTotalOrder(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) Log(x compute.Value) (compute.Value, error) + func (f *Function) Log1p(x compute.Value) (compute.Value, error) + func (f *Function) LogicalAnd(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) LogicalNot(x compute.Value) (compute.Value, error) + func (f *Function) LogicalOr(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) LogicalXor(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) Logistic(x compute.Value) (compute.Value, error) + func (f *Function) Max(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) Min(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) Mul(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) Name() string + func (f *Function) Neg(x compute.Value) (compute.Value, error) + func (f *Function) NonZero(operand compute.Value, cfg compute.NonZeroConfig) (compute.Value, error) + func (f *Function) NotEqual(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) NotEqualTotalOrder(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) OptimizationBarrier(operands ...compute.Value) ([]compute.Value, error) + func (f *Function) Pad(x, fillValue compute.Value, axesConfig ...compute.PadAxis) (compute.Value, error) + func (f *Function) Parameter(name string, shape shapes.Shape, sharding *compute.ShardingSpec) (compute.Value, error) + func (f *Function) Parent() compute.Function + func (f *Function) Pow(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) QuantizedGather(x, indices compute.Value, xQuantization *compute.Quantization) (compute.Value, error) + func (f *Function) RNGBitGenerator(state compute.Value, shape shapes.Shape, algorithm compute.RNGAlgorithm) (compute.Value, compute.Value, error) + func (f *Function) Real(x compute.Value) (compute.Value, error) + func (f *Function) ReduceBitwiseAnd(x compute.Value, axes ...int) (compute.Value, error) + func (f *Function) ReduceBitwiseOr(x compute.Value, axes ...int) (compute.Value, error) + func (f *Function) ReduceBitwiseXor(x compute.Value, axes ...int) (compute.Value, error) + func (f *Function) ReduceLogicalAnd(x compute.Value, axes ...int) (compute.Value, error) + func (f *Function) ReduceLogicalOr(x compute.Value, axes ...int) (compute.Value, error) + func (f *Function) ReduceLogicalXor(x compute.Value, axes ...int) (compute.Value, error) + func (f *Function) ReduceMax(x compute.Value, axes ...int) (compute.Value, error) + func (f *Function) ReduceMin(x compute.Value, axes ...int) (compute.Value, error) + func (f *Function) ReduceProduct(x compute.Value, axes ...int) (compute.Value, error) + func (f *Function) ReduceSum(x compute.Value, axes ...int) (compute.Value, error) + func (f *Function) ReduceWindow(input compute.Value, reductionType compute.ReduceOpType, ...) (compute.Value, error) + func (f *Function) Rem(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) Reshape(x compute.Value, dimensions ...int) (compute.Value, error) + func (f *Function) Return(outputs []compute.Value, shardings []*compute.ShardingSpec) error + func (f *Function) Reverse(x compute.Value, axes ...int) (compute.Value, error) + func (f *Function) Round(x compute.Value) (compute.Value, error) + func (f *Function) Rsqrt(x compute.Value) (compute.Value, error) + func (f *Function) ScatterMax(operand, scatterIndices, updates compute.Value, indexVectorAxis int, ...) (compute.Value, error) + func (f *Function) ScatterMin(operand, scatterIndices, updates compute.Value, indexVectorAxis int, ...) (compute.Value, error) + func (f *Function) ScatterSum(operand, scatterIndices, updates compute.Value, indexVectorAxis int, ...) (compute.Value, error) + func (f *Function) SchedulingBarrier(operand compute.Value, dependencies ...compute.Value) (compute.Value, error) + func (f *Function) SelectAndScatterMax(operand, source compute.Value, windowDimensions, windowStrides []int, ...) (compute.Value, error) + func (f *Function) SelectAndScatterMin(operand, source compute.Value, windowDimensions, windowStrides []int, ...) (compute.Value, error) + func (f *Function) Shape(v compute.Value) (shapes.Shape, error) + func (f *Function) ShiftLeft(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) ShiftRightArithmetic(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) ShiftRightLogical(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) Sign(x compute.Value) (compute.Value, error) + func (f *Function) Sin(x compute.Value) (compute.Value, error) + func (f *Function) Slice(x compute.Value, starts, limits, strides []int) (compute.Value, error) + func (f *Function) Sort(comparator compute.Function, axis int, isStable bool, inputs ...compute.Value) ([]compute.Value, error) + func (f *Function) Sqrt(x compute.Value) (compute.Value, error) + func (f *Function) Sub(lhs, rhs compute.Value) (compute.Value, error) + func (f *Function) Tanh(x compute.Value) (compute.Value, error) + func (f *Function) Transpose(x compute.Value, permutation ...int) (compute.Value, error) + func (f *Function) Where(condition, onTrue, onFalse compute.Value) (compute.Value, error) + func (f *Function) While(cond, body compute.Function, initialState ...compute.Value) ([]compute.Value, error)