Number of parameters keras dense layer with a 2D input
Yes, it takes only to the last dimension, accordingly to the source code (comments are mine):
https://github.com/keras-team/keras/blob/88af7d0c97497b5c3a198ee9416b2accfbc72c36/keras/layers/core.py#L880

def build(self, input_shape):
    assert len(input_shape) &gt;= 2
    input_dim = input_shape[-1]  # uses last dimension