def __init__(
        self,
        sess: "tf.Session",
        iterator: "tf.data.Iterator",
        iterator_type: str,
        iterator_arg: dict | tuple | "tf.Operation",
        size: int,
        batch_size: int,
    ) -> None:
        """
        Create a data generator wrapper for TensorFlow. Supported iterators: initializable, reinitializable, feedable.

        :param sess: TensorFlow session.
        :param iterator: Data iterator from TensorFlow.
        :param iterator_type: Type of the iterator. Supported types: `initializable`, `reinitializable`, `feedable`.
        :param iterator_arg: Argument to initialize the iterator. It is either a feed_dict used for the initializable
        and feedable mode, or an init_op used for the reinitializable mode.
        :param size: Total size of the dataset.
        :param batch_size: Size of the minibatches.
        :raises `TypeError`, `ValueError`: If input parameters are not valid.
        """

        import tensorflow.compat.v1 as tf

        super().__init__(size=size, batch_size=batch_size)
        self.sess = sess
        self._iterator = iterator
        self.iterator_type = iterator_type
        self.iterator_arg = iterator_arg

        if not isinstance(iterator, tf.data.Iterator):
            raise TypeError("Only support object tf.data.Iterator")

        if iterator_type == "initializable":
            if not isinstance(iterator_arg, dict):
                raise TypeError(f"Need to pass a dictionary for iterator type {iterator_type}")
        elif iterator_type == "reinitializable":
            if not isinstance(iterator_arg, tf.Operation):
                raise TypeError(f"Need to pass a TensorFlow operation for iterator type {iterator_type}")
        elif iterator_type == "feedable":
            if not isinstance(iterator_arg, tuple):
                raise TypeError(f"Need to pass a tuple for iterator type {iterator_type}")
        else:
            raise TypeError(f"Iterator type {iterator_type} not supported")

        Create a data generator wrapper for TensorFlow. Supported iterators: initializable, reinitializable, feedable.

        :param sess: TensorFlow session.
        :param iterator: Data iterator from TensorFlow.
        :param iterator_type: Type of the iterator. Supported types: `initializable`, `reinitializable`, `feedable`.
        :param iterator_arg: Argument to initialize the iterator. It is either a feed_dict used for the initializable
        and feedable mode, or an init_op used for the reinitializable mode.
        :param size: Total size of the dataset.
        :param batch_size: Size of the minibatches.
        :raises `TypeError`, `ValueError`: If input parameters are not valid.
        
art/data_generators.py