• Computes step of the input tf.Tensor element-wise: x > 0 ? 1 : alpha

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

    x.step(.5).print(); // or tf.step(x, .5)

    Type Parameters

    Parameters

    • x: TensorLike | T

      The input tensor.

    • Optional alpha: number

      The gradient when input is negative. Defaults to 0.

    Returns T

    Doc

Generated using TypeDoc