import torch


def div_func(inputs: torch.Tensor, other: float, unsqueeze_dim: int = 1):
    """
    Overview:
        Divide ``inputs`` by ``other`` and unsqueeze if needed.
    Arguments:
        - inputs (:obj:`torch.Tensor`): the value to be unsqueezed and divided
        - other (:obj:`float`): input would be divided by ``other``
        - unsqueeze_dim (:obj:`int`): the dim to implement unsqueeze
    Returns:
        - ret (:obj:`torch.Tensor`): the value processed after `unsqueeze` and `divide`
    """
    inputs = inputs.float()
    if unsqueeze_dim is not None:
        inputs = inputs.unsqueeze(unsqueeze_dim)
    return torch.div(inputs, other)