Documentation
¶
Index ¶
- Constants
- func DTypeToONNX(dt dtypes.DType) onnx.TensorProto_DataType
- func GetSupportedOps() map[compute.OpType]bool
- func MakeScalar(f *Function, value any, dtype dtypes.DType) (compute.Value, error)
- func ONNXDTypeToGoMLX(dt onnx.TensorProto_DataType) dtypes.DType
- func ONNXValueInfoToShape(valInfo *onnx.ValueInfoProto) shapes.Shape
- func ParseModelProto(r io.Reader) (modelProto *onnx.ModelProto, modelBytes []byte, inputNames []string, ...)
- func RemapAndMarshalModel(modelProto *onnx.ModelProto, inputNames []string, outputNames []string) ([]byte, error)
- func ShapeToONNX(shape shapes.Shape) *onnx.TensorShapeProto
- type Builder
- func (b *Builder) Backend() compute.Backend
- func (b *Builder) Compile() (compute.Executable, error)
- func (b *Builder) DeviceAssignment(devices ...compute.DeviceNum) error
- func (b *Builder) ExecutionProvider() executionprovider.Type
- func (b *Builder) Functions() map[string]*Function
- func (b *Builder) LogSeverity() int
- func (b *Builder) Main() compute.Function
- func (b *Builder) MainFunction() *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)
- func (b *Builder) OpsetVersion() int64
- func (b *Builder) SetBackend(backend compute.Backend)
- func (b *Builder) SetExecutionProvider(ep executionprovider.Type)
- func (b *Builder) SetLogSeverity(severity int)
- func (b *Builder) SetOpsetVersion(version int64)
- type CompiledModel
- type CompilerFn
- type Function
- func (f *Function) Abs(x compute.Value) (compute.Value, error)
- func (f *Function) Add(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) AddCustomNode(opType string, inputs []*Node, shape shapes.Shape) *Node
- func (f *Function) ArgMinMax(x compute.Value, axis int, outputDType dtypes.DType, isMin bool) (compute.Value, error)
- func (f *Function) BitwiseAnd(lhs, rhs 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(x compute.Value, outputShape shapes.Shape, broadcastAxes []int) (compute.Value, error)
- func (f *Function) Builder() compute.Builder
- func (f *Function) Ceil(x compute.Value) (compute.Value, error)
- func (f *Function) Clamp(min, x, max compute.Value) (compute.Value, error)
- func (f *Function) Concatenate(axis int, inputs ...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(operand compute.Value, targetDType dtypes.DType) (compute.Value, error)
- func (f *Function) Cos(x compute.Value) (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 []int, lhsBatchAxes []int, ...) (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) Erf(x compute.Value) (compute.Value, error)
- func (f *Function) ExecutionProvider() executionprovider.Type
- 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) FusedAttentionQKVProjection(x compute.Value, wQKV compute.Value, biasQ, biasK, biasV compute.Value, ...) (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) FusedLayerNorm(x, gamma, beta compute.Value, config compute.FusedLayerNormConfig) (compute.Value, error)
- func (f *Function) FusedQuantizedDense(x, weight, bias compute.Value, options compute.FusedQuantizedDenseConfig) (compute.Value, error)
- func (f *Function) FusedScaledDotProductAttention(query, key, value compute.Value, axesLayout compute.AttentionAxesLayout, ...) (output compute.Value, statesForVJP []compute.Value, err error)
- func (f *Function) FusedScaledDotProductAttentionVJP(query, key, value compute.Value, axesLayout compute.AttentionAxesLayout, ...) (dQuery, dKey, dValue 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 compute.Value, startIndices compute.Value, indexVectorAxis int, ...) (compute.Value, error)
- func (f *Function) GreaterOrEqual(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) GreaterThan(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Identity(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) KnownDynamicAxisNames() sets.Set[string]
- func (f *Function) LessOrEqual(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) LessThan(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) LogSeverity() int
- 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) MakeScalar(value any, dtype dtypes.DType) (compute.Value, error)
- func (f *Function) MakeValues(value any, shape shapes.Shape) (compute.Value, error)
- func (f *Function) MakeZeros(shape shapes.Shape) (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) Nodes() []*Node
- 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) 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, spec *compute.ShardingSpec) (compute.Value, error)
- func (f *Function) Params() []*Node
- 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) (newState compute.Value, values compute.Value, err error)
- func (f *Function) Reduce(x compute.Value, opType compute.OpType, axes []int, keepDims bool) (compute.Value, error)
- func (f *Function) ReduceLogical(x compute.Value, opType compute.OpType, axes []int, keepDims bool) (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(operand 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, newDimensions ...int) (compute.Value, error)
- func (f *Function) Return(outputs []compute.Value, shardings []*compute.ShardingSpec) error
- func (f *Function) Returns() []*Node
- 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 compute.Value, source compute.Value, windowDimensions []int, ...) (compute.Value, error)
- func (f *Function) SetExecutionProvider(ep executionprovider.Type)
- 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, start []int, limit []int, stride []int) (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 compute.Value, onTrue compute.Value, onFalse compute.Value) (compute.Value, error)
- type Node
Constants ¶
const ( DefaultOpsetVersion int64 = 21 MinOpsetVersion int64 = 21 )
DefaultOpsetVersion is the default ai.onnx opset version emitted by compute-onnx. Opset 21 (IR version 9) provides broad compatibility across ONNX Runtime releases and execution providers (CPU, CUDA, ROCm/MIGraphX, WASM/WebGPU). Newer opsets (e.g., 23 for RMSNormalization) can be opted into via "opset=<N>".
Variables ¶
This section is empty.
Functions ¶
func DTypeToONNX ¶
func DTypeToONNX(dt dtypes.DType) onnx.TensorProto_DataType
func GetSupportedOps ¶
GetSupportedOps returns a copy of all supported compute.OpType operations.
func MakeScalar ¶
MakeScalar constructs a 0D scalar constant tensor for the given value and DType.
func ONNXDTypeToGoMLX ¶
func ONNXDTypeToGoMLX(dt onnx.TensorProto_DataType) dtypes.DType
ONNXDTypeToGoMLX maps an ONNX TensorProto DataType to GoMLX DType.
func ONNXValueInfoToShape ¶
func ONNXValueInfoToShape(valInfo *onnx.ValueInfoProto) shapes.Shape
ONNXValueInfoToShape converts an ONNX ValueInfoProto to a GoMLX Shape.
func ParseModelProto ¶
func ParseModelProto(r io.Reader) (modelProto *onnx.ModelProto, modelBytes []byte, inputNames []string, inputShapes []shapes.Shape, outputNames []string, outputShapes []shapes.Shape, err error)
ParseModelProto parses ONNX model bytes and extracts input/output names and shapes.
func RemapAndMarshalModel ¶
func RemapAndMarshalModel(modelProto *onnx.ModelProto, inputNames []string, outputNames []string) ([]byte, error)
RemapAndMarshalModel renames inputs and outputs on the ONNX ModelProto and serializes it to bytes.
func ShapeToONNX ¶
func ShapeToONNX(shape shapes.Shape) *onnx.TensorShapeProto
Types ¶
type Builder ¶
type Builder struct {
notimplemented.Builder
// contains filtered or unexported fields
}
Builder implements compute.Builder for building ONNX computation graphs.
func NewBuilder ¶
func NewBuilder(name string, compileFn CompilerFn) *Builder
NewBuilder creates a new graph Builder.
func (*Builder) DeviceAssignment ¶
func (*Builder) ExecutionProvider ¶ added in v0.1.4
func (b *Builder) ExecutionProvider() executionprovider.Type
ExecutionProvider returns the target execution provider.
func (*Builder) LogSeverity ¶ added in v0.1.4
LogSeverity returns the log severity level for the builder.
func (*Builder) MainFunction ¶
MainFunction returns the strongly typed main *Function.
func (*Builder) OpsetVersion ¶ added in v0.1.38
OpsetVersion returns the target ai.onnx opset version for the builder.
func (*Builder) SetBackend ¶ added in v0.1.30
SetBackend associates the owning compute.Backend with this Builder.
func (*Builder) SetExecutionProvider ¶ added in v0.1.4
func (b *Builder) SetExecutionProvider(ep executionprovider.Type)
SetExecutionProvider sets the target execution provider.
func (*Builder) SetLogSeverity ¶ added in v0.1.4
SetLogSeverity sets the log severity level for the builder.
func (*Builder) SetOpsetVersion ¶ added in v0.1.38
SetOpsetVersion sets the target ai.onnx opset version for the builder. Values <= 0 reset to DefaultOpsetVersion (21).
type CompiledModel ¶
type CompiledModel struct {
Model *onnx.ModelProto
ModelBytes []byte
InputNames []string
InputShapes []shapes.Shape
OutputNames []string
OutputShapes []shapes.Shape
UsedDTypes map[dtypes.DType]bool
}
CompiledModel contains the generated ONNX ModelProto and graph metadata.
func CompileToProto ¶
func CompileToProto(b *Builder) (*CompiledModel, error)
CompileToProto translates a graph Builder AST into an ONNX ModelProto and serializes it to bytes.
type CompilerFn ¶
type CompilerFn func(b *Builder) (compute.Executable, error)
CompilerFn is the function type used by Builder to compile a graph into a compute.Executable.
type Function ¶
type Function struct {
notimplemented.Function
// contains filtered or unexported fields
}
func NewFunction ¶
func (*Function) AddCustomNode ¶
AddCustomNode adds a custom node to the function graph (useful for testing or custom ops).
func (*Function) BitwiseAnd ¶
func (*Function) BitwiseXor ¶
func (*Function) BroadcastInDim ¶
func (*Function) Clamp ¶ added in v0.1.29
Clamp supports both scalar and elementwise bounds using ONNX Max and Min.
func (*Function) Concatenate ¶
func (*Function) ConstantFromBuffer ¶ added in v0.1.30
func (*Function) ConvGeneral ¶
func (*Function) ConvertDType ¶
func (*Function) CumSum ¶ added in v0.1.4
func (f *Function) CumSum(operand compute.Value, axis int, options compute.CumSumOptions) (compute.Value, error)
CumSum implements the ONNX CumSum operation.
func (*Function) DotGeneral ¶
func (f *Function) DotGeneral( lhs compute.Value, lhsContractingAxes []int, lhsBatchAxes []int, rhs compute.Value, rhsContractingAxes []int, rhsBatchAxes []int, config compute.DotGeneralConfig, ) (compute.Value, error)
DotGeneral performs a general dot product (matrix multiplication) of lhs and rhs. It maps the generalized contracting and batching axes of XLA semantics to ONNX Einsum.
func (*Function) DynamicBroadcastInDim ¶ added in v0.1.4
func (*Function) DynamicDimensionSize ¶
func (*Function) DynamicIota ¶ added in v0.1.4
func (f *Function) DynamicIota(dtype dtypes.DType, iotaAxis int, dimensions ...compute.DynamicDimensionSpec) (compute.Value, error)
DynamicIota constructs an ONNX Range node for dynamic/static iotaAxis and broadcasts it to target dimensions.
func (*Function) DynamicPad ¶ added in v0.1.4
func (f *Function) DynamicPad(x, fillValue compute.Value, axesConfig ...compute.DynamicPadAxis) (compute.Value, error)
DynamicPad injects padding on the start, end, or interior of the given operand.
func (*Function) DynamicReshape ¶
func (*Function) DynamicShape ¶
func (*Function) DynamicSlice ¶
func (*Function) DynamicUpdateSlice ¶
func (*Function) ExecutionProvider ¶ added in v0.1.5
func (f *Function) ExecutionProvider() executionprovider.Type
ExecutionProvider returns the execution provider configured for the function.
func (*Function) FusedActivation ¶ added in v0.1.8
func (f *Function) FusedActivation(x compute.Value, cfg compute.ActivationConfig) (compute.Value, error)
FusedActivation applies the configured activation function using standard ONNX operators.
func (*Function) FusedAttentionQKVProjection ¶
func (f *Function) FusedAttentionQKVProjection( x compute.Value, wQKV compute.Value, biasQ, biasK, biasV compute.Value, queryDim, keyValueDim int, ) (query, key, value compute.Value, err error)
FusedAttentionQKVProjection performs fused Query-Key-Value projection.
func (*Function) FusedDense ¶
func (f *Function) FusedDense(x, weight, bias compute.Value, options compute.DenseConfig) (compute.Value, error)
FusedDense performs fused matmul + optional bias + optional activation.
func (*Function) FusedLayerNorm ¶
func (f *Function) FusedLayerNorm(x, gamma, beta compute.Value, config compute.FusedLayerNormConfig) (compute.Value, error)
FusedLayerNorm applies layer normalization (ONNX LayerNormalization, opset 17+) or RMS normalization (ONNX RMSNormalization, opset 23+) over contiguous trailing axes.
func (*Function) FusedQuantizedDense ¶
func (f *Function) FusedQuantizedDense(x, weight, bias compute.Value, options compute.FusedQuantizedDenseConfig) (compute.Value, error)
FusedQuantizedDense performs fused dequantization + matmul + optional bias + optional activation.
func (*Function) FusedScaledDotProductAttention ¶
func (f *Function) FusedScaledDotProductAttention( query, key, value compute.Value, axesLayout compute.AttentionAxesLayout, options *compute.ScaledDotProductAttentionConfig) (output compute.Value, statesForVJP []compute.Value, err error)
FusedScaledDotProductAttention computes multi-head scaled dot-product attention.
func (*Function) FusedScaledDotProductAttentionVJP ¶
func (f *Function) FusedScaledDotProductAttentionVJP( query, key, value compute.Value, axesLayout compute.AttentionAxesLayout, options *compute.ScaledDotProductAttentionConfig, output compute.Value, statesForVJP []compute.Value, dOutput compute.Value) (dQuery, dKey, dValue compute.Value, err error)
FusedScaledDotProductAttentionVJP computes gradients of FusedScaledDotProductAttention.
func (*Function) FusedSoftmax ¶
FusedSoftmax computes softmax along the specified axis using ONNX Softmax.
func (*Function) FusedTopK ¶ added in v0.1.29
func (f *Function) FusedTopK(operand compute.Value, k int, cfg compute.FusedTopKConfig) (values, indices compute.Value, err error)
FusedTopK returns sorted values and Int32 indices of the k largest (or smallest when cfg.Smallest is true) elements along cfg.Axis.
func (*Function) Gather ¶
func (f *Function) Gather( operand compute.Value, startIndices compute.Value, indexVectorAxis int, offsetOutputAxes []int, collapsedSliceAxes []int, startIndexMap []int, sliceSizes []int, indicesAreSorted bool, ) (compute.Value, error)
Gather gathers slices from operand using coordinates specified by startIndices. It maps the generalized XLA Gather semantics to ONNX GatherND, Reshape, and Transpose. Packed sub-byte dtypes are not supported directly; use QuantizedGather or Bitcast to Uint8 first.
func (*Function) GreaterOrEqual ¶
func (*Function) GreaterThan ¶
func (*Function) Iota ¶
Iota constructs a Range operator for the iotaAxis dimension and then broadcasts using Expand (BroadcastInDim).
func (*Function) KnownDynamicAxisNames ¶ added in v0.1.29
KnownDynamicAxisNames returns the set of dynamically defined axis names known by the function.
func (*Function) LessOrEqual ¶
func (*Function) LogSeverity ¶ added in v0.1.4
func (*Function) LogicalAnd ¶
func (*Function) LogicalXor ¶
func (*Function) MakeScalar ¶ added in v0.1.4
MakeScalar constructs a 0D scalar constant tensor on Function for the given value and DType.
func (*Function) MakeValues ¶ added in v0.1.4
MakeValues constructs a constant tensor with shape filled with value by broadcasting a scalar.
func (*Function) MakeZeros ¶ added in v0.1.4
MakeZeros constructs a constant tensor with shape filled with zero by broadcasting a scalar zero.
func (*Function) NonZero ¶ added in v0.1.29
NonZero returns row-major coordinates of nonzero elements as an Int64 tensor with shape [count, rank] (or [rank, count] when cfg.Transpose is true).
func (*Function) OptimizationBarrier ¶ added in v0.1.4
OptimizationBarrier implements an optimization barrier. In ONNX Runtime, since we do not perform graph rewriting or CSE across barriers, this acts as Identity.
func (*Function) Pad ¶ added in v0.1.4
func (f *Function) Pad(x, fillValue compute.Value, axesConfig ...compute.PadAxis) (compute.Value, error)
Pad injects padding on the start, end, or interior of the given operand.
func (*Function) QuantizedGather ¶ added in v0.1.31
func (f *Function) QuantizedGather(x, indices compute.Value, xQuantization *compute.Quantization) (compute.Value, error)
QuantizedGather performs a quantized row gather (embedding lookup) with on-the-fly unpacking / dequantization.
func (*Function) RNGBitGenerator ¶
func (f *Function) RNGBitGenerator( state compute.Value, shape shapes.Shape, algorithm compute.RNGAlgorithm, ) (newState compute.Value, values compute.Value, err error)
RNGBitGenerator generates a tensor of the requested shape filled with uniform random bits using the specified algorithm (compute.RNGDefault, compute.RNGSplitMix64, or compute.RNGThreeFry).
func (*Function) ReduceLogical ¶
func (*Function) ReduceLogicalAnd ¶
func (*Function) ReduceLogicalOr ¶
func (*Function) ReduceLogicalXor ¶
func (*Function) ReduceProduct ¶
func (*Function) ReduceWindow ¶
func (*Function) ScatterMax ¶
func (*Function) ScatterMin ¶
func (*Function) ScatterSum ¶
func (*Function) SchedulingBarrier ¶
func (f *Function) SchedulingBarrier(operand compute.Value, dependencies ...compute.Value) (compute.Value, error)
SchedulingBarrier introduces a scheduling barrier. Returned value is identity to the operand, but it is guaranteed to depend on all the dependencies.
Since ONNX Runtime doesn't natively support a scheduling barrier op, we "hack" it by means of a no-op: taking a scalar of each dependency, multiplying by 0, and adding them to the operand.
func (*Function) SelectAndScatterMax ¶
func (*Function) SetExecutionProvider ¶ added in v0.1.5
func (f *Function) SetExecutionProvider(ep executionprovider.Type)
SetExecutionProvider sets the execution provider configured for the function.
func (*Function) ShiftRightArithmetic ¶ added in v0.1.24
func (*Function) ShiftRightLogical ¶
func (*Function) Slice ¶
func (f *Function) Slice(x compute.Value, start []int, limit []int, stride []int) (compute.Value, error)
Slice extracts a slice from x specified by start, limit, and stride. Packed sub-byte dtypes are not supported directly; Bitcast to Uint8 or ConvertDType first.