Function countNonzero

  • Calculates:

    output = output + (input != 0)
    

    with an initial value of output = 0.0.

    Parameters

    • input: Tensor

      the input tensor of any shape

    • Optional dim: number | number[]
    • Optional keepdim: boolean

    Returns Tensor

    the output tensor

Generated using TypeDoc