Replaced Q by input_dim