We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To reshape the input, the code is:
if input_ids.shape.ndims == 2: input_ids = tf.expand_dims(input_ids, axis=[-1]
I'm wondering why we set axis = [-1] instead of -1 and how it is possible to pass a list to axis. I have tried this:
import tensorflow as tf t = tf.constant([1,2]) t1 = tf.expand_dims(t, axis=[0, 1]) print(t1.shape)
but it raised the error: 'dim' must be a tensor with a single value [Op:ExpandDims]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
To reshape the input, the code is:
I'm wondering why we set axis = [-1] instead of -1 and how it is possible to pass a list to axis.
I have tried this:
but it raised the error: 'dim' must be a tensor with a single value [Op:ExpandDims]
The text was updated successfully, but these errors were encountered: