Cannot apply softmax to a tensor that is 1D

Hello! When trying to run this code from the video " Walk through a Notebook for computer vision":

# Declare sample inputs and convert it to a tensor
inputs = np.array([1.0, 3.0, 4.0, 2.0])
inputs = tf.convert_to_tensor(inputs)
print(f'input to softmax function: {inputs.numpy()}')

# Feed the inputs to a softmax activation function
outputs = tf.keras.activations.softmax(inputs)
print(f'output of softmax function: {outputs.numpy()}')

I get the error:

ValueError: Cannot apply softmax to a tensor that is 1D. Received input: [1. 3. 4. 2.]”

Would be grateful if someone helps me to solve it.

I use Python 8 and TF 2.11.0

Solved it, sorry. I did a mistake in that line:

inputs = np.array([[1.0, 3.0, 4.0, 2.0]])

Everything works fine now.