from typing import Any
import torch


def unsqueeze_scalar_tensor(data: Any) -> Any:
    """ Un-squeezes a 0-dim tensor. """
    if isinstance(data, torch.Tensor) and data.dim() == 0:
        data = data.unsqueeze(0)
    return data