concision_params/traits/
shape.rs

1/*
2    Appellation: shape <module>
3    Created At: 2025.12.14:11:03:05
4    Contrib: @FL03
5*/
6use ndarray::RemoveAxis;
7
8pub trait GetBiasDim<A, D>
9where
10    D: RemoveAxis,
11{
12    type Output;
13
14    fn get_bias_dim(&self) -> Self::Output;
15}
16
17/*
18 ************* Implementations *************
19*/
20
21impl<A, D, U> GetBiasDim<A, D> for U
22where
23    D: RemoveAxis,
24    U: AsRef<ndarray::LayoutRef<A, D>>,
25{
26    type Output = D::Smaller;
27
28    fn get_bias_dim(&self) -> Self::Output {
29        crate::extract_bias_dim(self)
30    }
31}