Missed TensorFlow World? Check out the recap. Learn more

tf.keras.backend.squeeze

TensorFlow 2 version View source on GitHub

Removes a 1-dimension from the tensor at index "axis".

Aliases:

tf.keras.backend.squeeze(
    x,
    axis
)

Arguments:

  • x: A tensor or variable.
  • axis: Axis to drop.

Returns:

A tensor with the same data as x but reduced dimensions.