1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use thiserror::Error;
use ndarray::ShapeError;
#[derive(Error, Debug)]
pub enum CsapsError {
#[error("Invalid input: {0}")]
InvalidInputData(String),
#[error("Cannot reshape 2-d array with shape {input_shape:?} \
to {}-d array with shape {output_shape:?} by axis {axis}. Error: {source}",
output_shape.len())]
ReshapeFrom2d {
input_shape: Vec<usize>,
output_shape: Vec<usize>,
axis: usize,
#[source]
source: ShapeError,
},
#[error("Cannot reshape {}-d array with shape {input_shape:?} by axis {axis} \
to 2-d array with shape {output_shape:?}. Error: {source}",
input_shape.len())]
ReshapeTo2d {
input_shape: Vec<usize>,
output_shape: Vec<usize>,
axis: usize,
#[source]
source: ShapeError,
},
}