Function pow

  • Calculates:

    output = input >= 0 || fract(other) != 0 ? pow(input, other) :
    pow(-input, other) * ((i32(other) & 1) != 0 ? -1f : 1f)

    Gradient:

    inputGrad = input >= 0 || fract(other) != 0 ? outputGrad * other * pow(input, other - 1.0) :
    outputGrad * other * pow(-input, other - 1) * ((i32(other - 1) & 1) != 0 ? -1f : 1f);
    otherGrad = outputGrad * pow(input, other) * log(input)

    Parameters

    • input: Tensor

      the input tensor of any shape

    • other: number | Tensor

      the other tensor whose shape is broadcastable with the input tensor

    Returns Tensor

    the output tensor

Generated using TypeDoc