burn_rmexp_dyntensor/
errors.rs

1//! # Common Error Types
2use burn::prelude::Shape;
3use burn::tensor::Slice;
4
5/// Errors that can occur when checking tensor slices.
6#[derive(Debug, Clone, PartialEq, Eq, Hash)]
7pub enum SlicingError {
8    OutOfBounds {
9        msg: String,
10        shape: Shape,
11        slices: Vec<Slice>,
12    },
13    InvalidRank {
14        msg: String,
15        shape: Shape,
16        slices: Vec<Slice>,
17    },
18}
19
20/// Common Errors.
21#[derive(Debug, Clone, PartialEq, Eq, Hash)]
22pub enum DynTensorError {
23    /// An error occurred while slicing.
24    SliceError(SlicingError),
25
26    /// Invalid Arguments.
27    InvalidArgument { msg: String },
28
29    /// The tensor rank is not supported for the requested operation.
30    UnsupportedRank { msg: String, rank: usize },
31}