ML::ShapeOps
Utility functions for shape operations
Instance methods
batched_matmul_shape(a : Shape, b : Shape) : Shape
Compute output shape for batched matmul: [..., M, K] @ [..., K, N] -> [..., M, N]
Flatten shape from start_dim to end_dim
matmul_shape(a : Shape, b : Shape) : Shape
Compute output shape for matmul: [M, K] @ [K, N] -> [M, N]
Squeeze: remove dimensions of size 1