def error_code

bendtorch-core@0.1.0.0 · src/tensor/transforms.bend:492

import bendtorch-core@0.1.0.0/src/tensor/transforms.bend as Transforms
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout

492def error_code(error: Error) -> U32:
493  match error:
494    case LayoutError{Layout.ShapeError{error}}:
495      Shape.error_code(error)
496    case LayoutError{Layout.AxesLengthMismatch{}}:
497      12
498    case LayoutError{Layout.AxisOutOfBounds{}}:
499      13
500    case LayoutError{Layout.DuplicateAxis{}}:
501      14
502    case LayoutError{Layout.ElementCountMismatch{}}:
503      15
504    case LayoutError{Layout.MappingError{}}:
505      16
506    case TensorError{error}:
507      Core.error_code(error)

Uses (5)

Used by (7)