Function pad

  • Pads a tensor with a given value and paddings.

    Parameters

    • t: Tensor

      the input tensor

    • paddings: [number, number][]

      an array prescribing how much to pad [before, after] along each tensor axis

    • Optional constantValue: number

      (optional) the pad value to use

    Returns Tensor

    the padded tensor