• Computes rectified linear element-wise: max(x, 0).

    const x = tf.tensor1d([-1, 2, -3, 4]);

    x.relu().print(); // or tf.relu(x)

    Type Parameters

    Parameters

    • x: T | TensorLike

      The input tensor. If the dtype is bool, the output dtype will be int32.

    Returns T