pub fn compute_fans(shape: &[usize]) -> Result<(usize, usize), InitError>Expand description
Compute (fan_in, fan_out) from a weight tensor shape.
- 2-D
[out_features, in_features]: fan_in = in_features, fan_out = out_features - N-D (N >= 3) convolution
[out_channels, in_channels, k1, k2, ...]: fan_in = in_channels * product(k_dims) fan_out = out_channels * product(k_dims)