OpAttributeFactory

OpAttributeFactory provides methods to generate operation attributes for tracing. It captures metadata about tensor operations for graph construction and optimization.

Functions

Link copied to clipboard
fun binary(a: Tensor<*, *>, b: Tensor<*, *>, result: Tensor<*, *>): Map<String, Any?>

Binary op convenience (e.g., add, mul).

Link copied to clipboard
fun conv2d(input: Tensor<*, *>, weight: Tensor<*, *>, bias: Tensor<*, *>?, result: Tensor<*, *>, stride: Pair<Int, Int>, padding: Pair<Int, Int>, dilation: Pair<Int, Int>, groups: Int): Map<String, Any?>

Conv2d op attributes: shapes/dtypes + stride/padding/dilation/groups and bias flag.

Link copied to clipboard
fun scalarOp(input: Tensor<*, *>, scalar: Number, result: Tensor<*, *>, isReversed: Boolean): Map<String, Any?>

Generate attributes for scalar operations.

Link copied to clipboard
fun shapesAndDTypes(inputs: List<Tensor<*, *>>, outputs: List<Tensor<*, *>>): Map<String, Any?>

Generate basic shape and dtype attributes for operations.

Link copied to clipboard
fun unary(input: Tensor<*, *>, result: Tensor<*, *>): Map<String, Any?>

Unary op convenience (e.g., relu, sigmoid).