Hi,
So, as far as I understood your code,
you defined an input of 1 variable into a dense layer with 3 neurons. The output is 2 values as your last dense layer has 2 neurons.
If you give an input with 3 values, for each one you get 2 values, hence the 3x2 result
to change that, you need to change input_shape to 3, this will make your model understand the 3 values as one input and the output will be 1x2
model = keras.Sequential(
    [
        layers.InputLayer(input_shape=(3,)),
        layers.Dense(3, activation="relu", name="layer1"),
        layers.Dense(16, activation="relu", name="layer2"),
        layers.Dense(2, name="layer3"),
    ]
)
# Call model on a test input
model.summary()
x = tf.ones((1, 3))
y = model(x)
print(y)

sorry for the non-JS code