def fit_generator(self, generator: "DataGenerator", nb_epochs: int = 20, verbose: bool = False, **kwargs) -> None:
        """
        Fit the classifier using the generator that yields batches as specified.

        :param generator: Batch generator providing `(x, y)` for each epoch. If the generator can be used for native
                          training in TensorFlow, it will.
        :param nb_epochs: Number of epochs to use for training.
        :param verbose: Display the training progress bar.
        :param kwargs: Dictionary of framework-specific arguments. This parameter is not currently supported for
               TensorFlow and providing it takes no effect.
        """
        from art.data_generators import TensorFlowDataGenerator

        if self.learning is not None:
            self.feed_dict[self.learning] = True

        # Train directly in TensorFlow
        from art.preprocessing.standardisation_mean_std.numpy import StandardisationMeanStd

        if isinstance(generator, TensorFlowDataGenerator) and (
            self.preprocessing is None
            or (
                isinstance(self.preprocessing, StandardisationMeanStd)
                and (
                    self.preprocessing.mean,
                    self.preprocessing.std,
                )
                == (0, 1)
            )
        ):
            for _ in tqdm(range(nb_epochs), disable=not verbose, desc="Epochs"):
                gen_size = generator.size
                if isinstance(gen_size, int):
                    num_batches = int(gen_size / generator.batch_size)
                else:
                    raise ValueError("Number of batches could not be determined from the generator")

                for _ in range(num_batches):
                    i_batch, o_batch = generator.get_batch()

                    if self._reduce_labels:
                        o_batch = np.argmax(o_batch, axis=1)

                    # Create feed_dict
                    feed_dict = {self.input_ph: i_batch, self.labels_ph: o_batch}
                    feed_dict.update(self.feed_dict)

                    # Run train step
                    self._sess.run(self.train, feed_dict=feed_dict)
        else:
            super().fit_generator(generator, nb_epochs=nb_epochs, **kwargs)

        Fit the classifier using the generator that yields batches as specified.

        :param generator: Batch generator providing `(x, y)` for each epoch. If the generator can be used for native
                          training in TensorFlow, it will.
        :param nb_epochs: Number of epochs to use for training.
        :param verbose: Display the training progress bar.
        :param kwargs: Dictionary of framework-specific arguments. This parameter is not currently supported for
               TensorFlow and providing it takes no effect.
        
art/estimators/classification/tensorflow.py