DimensionMismatchError
Module: strata.utils • Kind: struct • Traits: Copyable, Movable, Writable
Source: strata/exceptions/errors.mojo
struct DimensionMismatchError(Copyable, Movable, Writable)from strata.utils import DimensionMismatchErrorException raised when input matrix/vector dimensions do not match requirements.
Methods Overview
Section titled “Methods Overview”| Method | Description |
|---|---|
DimensionMismatchError.error() |
Create a formatted DimensionMismatchError message. |
DimensionMismatchError.write_to() |
Format a human-readable string representation to a writer. |
Method Details
Section titled “Method Details”DimensionMismatchError.error()
Section titled “DimensionMismatchError.error()”def error(expected: String, actual: String, context: String = "") -> ErrorCreate a formatted DimensionMismatchError message.
| Parameter | Type | Description |
|---|---|---|
expected |
String |
— |
actual |
String |
— |
context |
String |
— |
Returns: Error
DimensionMismatchError.write_to()
Section titled “DimensionMismatchError.write_to()”def write_to(self, mut writer: Some[Writer])Format a human-readable string representation to a writer.