
Implement a fully connected neural network layer using only NumPy. Given an input matrix x of shape (batch_size, in_features), a weight matrix W of shape (in_features, out_features), and a bias vector b of shape (out_features,), write a function that returns the forward output y = x @ W + b and the gradients dx, dW, and db for a provided upstream gradient dout of shape (batch_size, out_features). The implementation must be fully vectorized and rely on NumPy broadcasting rather than Python loops.
1 <= batch_size <= 10^41 <= in_features, out_features <= 10^3x.shape == (batch_size, in_features)W.shape == (in_features, out_features)b.shape == (out_features,)dout.shape == (batch_size, out_features)