def METHOD_NAME(x: torch.Tensor, num_frames: torch.Tensor) -> torch.Tensor:
    if num_frames > len(x):
        x = F.pad(x, (0, num_frames - len(x)))
    elif num_frames < len(x):
        x = x[:num_frames]
    return x