• Removes dimensions of size 1 from the shape of a tf.Tensor.

    const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);
    x.squeeze().print();

    Type Parameters

    Parameters

    • x: Tensor<Rank> | TensorLike

      The input tensor to be squeezed.

    • Optional axis: number[]

      An optional list of numbers. If specified, only squeezes the dimensions listed. The dimension index starts at 0. It is an error to squeeze a dimension that is not 1.

    Returns T

    Doc

Generated using TypeDoc