Skip to content

DimensionMismatchError

Module: strata.utils • Kind: struct • Traits: Copyable, Movable, Writable
Source: strata/exceptions/errors.mojo

struct DimensionMismatchError(Copyable, Movable, Writable)
from strata.utils import DimensionMismatchError

Exception raised when input matrix/vector dimensions do not match requirements.


Method Description
DimensionMismatchError.error() Create a formatted DimensionMismatchError message.
DimensionMismatchError.write_to() Format a human-readable string representation to a writer.

def error(expected: String, actual: String, context: String = "") -> Error

Create a formatted DimensionMismatchError message.

Parameter Type Description
expected String —
actual String —
context String —

Returns: Error


def write_to(self, mut writer: Some[Writer])

Format a human-readable string representation to a writer.