Function absolute

  • Calculate the absolute value for every element in a Tensor. There is a method version of this static function: Tensor.absolute.

    $$|x| : \forall x \in T$$

    Example

      const t = sm.randn([128, 128])

    // equivalent calls
    const a = t.absolute()
    const b = sm.absolute(t)

    Returns

    Parameters

    • tensor: Tensor

      Tensor whose values will have their absolute value calculated

    Returns Tensor

Generated using TypeDoc