import torch


def pad_avail(avails: torch.Tensor, pad_to: int) -> torch.Tensor:
    """Pad avails to `pad_to` size

    :param avails: avails to be padded, should be (B,N,P) and we're padding P
    :type avails: torch.Tensor
    :param pad_to: nums of points we want
    :type pad_to: int
    :return: the padded avails (B,N,pad_to)
    :rtype: torch.Tensor
    """
    batch, num_els, num_points = avails.shape
    pad_len = pad_to - num_points
    pad = torch.zeros(batch, num_els, pad_len, dtype=avails.dtype, device=avails.device)
    return torch.cat([avails, pad], dim=-1)