keras/src/trainers/data_adapters/data_adapter_utils.py/is_tensorflow_sparse
def is_tensorflow_sparse(value):
    if hasattr(value, "__class__"):
        return (
            value.__class__.__name__ == "SparseTensor"
            and "tensorflow.python." in str(value.__class__.__module__)
        )
    return False