I have issue to follow the following step:

Exercise 2 - music_inference_model

2.D: Convert the last output into a new input for the next time step. You will do this in 2 substeps:

Get the index of the maximum value of the predicted output using tf.math.argmax along the last axis.

Convert the index into its n_values-one-hot encoding using tf.one_hot.

My code

x = tf.math.argmax(output, axis=-1)

x = tf.one_hot(x)

always has ValueError: Can’t convert Python sequence with mixed types to Tensor.

Pls advise!