Snakepit.Error.Shape (Snakepit v0.8.7)
View SourceShape error creation helpers.
Provides functions for creating detailed shape mismatch errors with automatic dimension detection and telemetry emission.
Summary
Functions
Creates a broadcast error.
Creates a dimension-specific mismatch error.
Creates a shape mismatch error.
Functions
@spec broadcast_error([integer()], [integer()], String.t()) :: Snakepit.Error.ShapeMismatch.t()
Creates a broadcast error.
Use when shapes cannot be broadcast together.
@spec dimension_mismatch(non_neg_integer(), integer(), integer(), String.t()) :: Snakepit.Error.ShapeMismatch.t()
Creates a dimension-specific mismatch error.
Use when you know exactly which dimension has the mismatch.
@spec shape_mismatch([integer()], [integer()], String.t()) :: Snakepit.Error.ShapeMismatch.t()
Creates a shape mismatch error.
Automatically detects which dimension differs and emits telemetry.
Examples
error = Shape.shape_mismatch([3, 224, 224], [3, 256, 256], "conv2d")