def torch_approximation(settings, key: str) ->str:
    """
    PyTorch has no `bool` type in libtorch hence we approximate one.

    Each item will be later static_casted to appropriate type if needed,
    which is essentially a no-op for for already correct types.

    Usually only `bool` will be casted (eventually other "hard-types" if
    the architecture is specific).

    Parameters
    ----------
    settings : typing.Dict
        YAML parsed to dict

    Returns
    -------
    str:
        String specifying type, e.g. "int8_t"
    """
    type_mapping = {'bool': 'int8_t', 'int': 'int32_t', 'long': 'int64_t',
        'double': 'double'}
    if settings['return'][key] is None:
        return ''
    return type_mapping[settings['return'][key]['type'].lower()]
