Neural network layers as parametric spans