//! Shared input/weight validation for the layer module
use crate;
/// Validates that a weight array assigned to a layer has the shape the layer expects
///
/// Layers initialize their weight arrays with the correct shape in `new()`, so loaded or
/// user-supplied weights must match that shape. This turns a silent corruption (and a later
/// opaque panic deep inside `dot`) into a clear, recoverable error
///
/// # Parameters
///
/// - `name` - Name of the parameter being set, used in the error message, e.g. "weight" or "bias"
/// - `expected` - Shape the layer currently has for this parameter
/// - `found` - Shape of the array being assigned
///
/// # Errors
///
/// - `Error::NeuralNetwork(NnError::WeightShape)` if the shapes differ
pub