from typing import Dict
import torch


def tensors_to_float(tensors: Dict[str, torch.Tensor]) -> Dict[str, float]:
    """
    Converts all single-value tensors in dictionary to float values.

    Args:
        tensors (dict): Dictionary of tensors with single value.

    Returns:
        dict
    """
    assert isinstance(tensors, dict), f"Input argument must be dict! Found {type(tensors)}"

    output = {}
    for k, v in tensors.items():
        if isinstance(v, torch.Tensor):
            output[k] = v.item()
        else:
            output[k] = v

    return output