def METHOD_NAME(data: t.Any) -> t.Union[tf.TensorSpec, t.Dict]:
    dtype = type(data)
    if dtype in _TYPE_DICT:
        return tf.TensorSpec(shape=(), dtype=_TYPE_DICT[dtype])
    if isinstance(data, (sw_type.BaseArtifact, sw_type.BoundingBox)):
        return tf.TensorSpec(shape=data.shape, dtype=data.dtype)
    elif isinstance(data, (list, tuple)):
        narray = numpy.array(data)
        narray_shape: t.List[t.Optional[int]] = list(narray.shape)
        narray_dtype: numpy.dtype = narray.dtype
        if narray_dtype == numpy.object_:
            _ravel_list = narray.ravel().tolist()
            _type_cnt = len(set([type(n) for n in _ravel_list]))
            if isinstance(_ravel_list[0], (list, tuple)):
                raise ValueError(f"Can't ravel to one dimension array: {_ravel_list}")
            if _type_cnt > 1:
                raise NoSupportError(
                    f"Can't convert different types in one array to tensor: {data}"
                )
            elif _type_cnt == 0:
                raise ValueError(
                    f"Can't find any types, but numpy array type is numpy.object_: {data}"
                )
            else:
                _spec = METHOD_NAME(_ravel_list[0])
                if isinstance(_spec, tf.TensorSpec):
                    narray_dtype = _spec.dtype
                    _shape = _spec.shape.as_list()
                    narray_shape.extend(_shape)
                else:
                    raise NoSupportError(
                        f"Can't handle the compound type: {_ravel_list[0]}"
                    )
        return tf.TensorSpec(shape=narray_shape, dtype=narray_dtype)
    elif isinstance(data, dict):
        return {k: METHOD_NAME(v) for k, v in data.items()}
    else:
        raise NoSupportError(
            f"inspect tensor spec does not support {dtype} type: {data}"
        )