import torch


def hard_swish(tensor: torch.Tensor) -> torch.Tensor:
    """
    Applies HardSwish function element-wise.

    See :class:`torchlayers.activations.HardSwish` for more details.

    Arguments:
        tensor :
            Tensor activated element-wise

    Returns:
        torch.Tensor:
    """
    return tensor * torch.nn.functional.relu6(tensor + 3) / 6