Clear autoflow's tensor storage.

        :param obj: target GPflow object.
        :param name: accepts either string value which is unique part of
            an internal attribute name or None value. When None value is passed all
            storages will be cleared, in other words it clears everything with common
            autoflow prefix.

        :raises: ValueError exception if `name` is not a string.

def clear_autoflow(cls, obj, name=None):
        """
        Clear autoflow's tensor storage.

        :param obj: target GPflow object.
        :param name: accepts either string value which is unique part of
            an internal attribute name or None value. When None value is passed all
            storages will be cleared, in other words it clears everything with common
            autoflow prefix.

        :raises: ValueError exception if `name` is not a string.
        """
        if name is not None and not isinstance(name, str):
            raise ValueError('Name must be a string.')
        prefix = cls.__autoflow_prefix__
        if name:
            prefix = "" if name.startswith(prefix) else prefix
            delattr(obj, prefix + name)
        else:
            keys = [attr for attr in obj.__dict__ if attr.startswith(prefix)]
            for key in keys:
                delattr(obj, key)