import torch


def _addones(x):
    """Add a feature of all ones.

    Parameters
    ----------
    x : (n_frames, n_features) torch.Tensor
        Tensor of features.

    Returns
    -------
    (n_frames, n_features + 1) torch.Tensor
        Input tensor with an additional feature of all ones.

    """
    ones = torch.ones(len(x), 1, dtype=x.dtype, device=x.device)
    return torch.cat([ones, x], dim=-1)