(
    array: Tensor, multiple_number: int = 32, pad_value: float = 0
)
return padded_array
pad the nd-array to multiple stride of th e

    Args:
        array (Tensor):
            the tensor with the shape of [batch, channel, height, width]
        multiple_number (int):
            make the height and width can be divided by multiple_number
        pad_value (int): the value to be padded

    Returns:
        padded_array (Tensor)
pad the nd-array to multiple stride of th e
pad the nd - array to multiple stride of th e
def get_padded_tensor(
    array: Tensor, multiple_number: int = 32, pad_value: float = 0
) -> Tensor:
    """ pad the nd-array to multiple stride of th e

    Args:
        array (Tensor):
            the tensor with the shape of [batch, channel, height, width]
        multiple_number (int):
            make the height and width can be divided by multiple_number
        pad_value (int): the value to be padded

    Returns:
        padded_array (Tensor)
    """
    batch, chl, t_height, t_width = array.shape
    padded_height = (
        (t_height + multiple_number - 1) // multiple_number * multiple_number
    )
    padded_width = (t_width + multiple_number - 1) // multiple_number * multiple_number

    padded_array = F.full(
        (batch, chl, padded_height, padded_width), pad_value, dtype=array.dtype
    )

    ndim = array.ndim
    if ndim == 4:
        padded_array[:, :, :t_height, :t_width] = array
    elif ndim == 3:
        padded_array[:, :t_height, :t_width] = array
    else:
        raise Exception("Not supported tensor dim: %d" % ndim)
    return padded_array
def get_padded_tensor ( array : Tensor , multiple_number : int = 32 , pad_value : float = 0 ) -> Tensor : batch , chl , t_height , t_width = array . shape padded_height = ( ( t_height + multiple_number - 1 ) // multiple_number * multiple_number ) padded_width = ( t_width + multiple_number - 1 ) // multiple_number * multiple_number padded_array = F . full ( ( batch , chl , padded_height , padded_width ) , pad_value , dtype = array . dtype ) ndim = array . ndim if ndim == 4 : padded_array [ : , : , : t_height , : t_width ] = array elif ndim == 3 : padded_array [ : , : t_height , : t_width ] = array else : raise Exception ( "Not supported tensor dim: %d" % ndim ) return padded_array