def get_dataset(config, training):
    if (config.shuffle is False):
        fix_rng_seed(config.seed)
    num_negative_bags = (config.negative_bag_size // config.bag_size)
    gen = GeneratorCLS(is_training=config.is_training, shuffle=config.shuffle, add_gt_list=False, k_shot=config.k_shot, bag_size=config.bag_size, num_negative_bags=num_negative_bags, split=config.split, num_sample_classes=config.num_sample_classes, num_sample_classes_min=config.num_sample_classes_min, use_features=config.use_features, dataset_name=config.dataset_name, one_example_per_class=config.one_example_per_class, has_single_target=config.has_single_target)
    gen.reset_state()
    dataset = tf.data.Dataset.from_generator(gen.get_data, (tf.float32, tf.float32, tf.float32, tf.float32, tf.float32, tf.int32)).prefetch(config.prefetch_buffer_size)
    if training:
        return dataset.batch(config.meta_batch_size).repeat()
    else:
        return dataset.batch(1)
def get_dataset(config, training):
    if (config.shuffle is False):
        fix_rng_seed(config.seed)
    num_negative_bags = (config.negative_bag_size // config.bag_size)
    gen = GeneratorCLS(is_training=config.is_training, shuffle=config.shuffle, add_gt_list=False, k_shot=config.k_shot, bag_size=config.bag_size, num_negative_bags=num_negative_bags, split=config.split, num_sample_classes=config.num_sample_classes, num_sample_classes_min=config.num_sample_classes_min, use_features=config.use_features, dataset_name=config.dataset_name, one_example_per_class=config.one_example_per_class, has_single_target=config.has_single_target)
    gen.reset_state()
    dataset = tf.data.Dataset.from_generator(gen.get_data, (tf.float32, tf.float32, tf.float32, tf.float32, tf.float32, tf.int32)).prefetch(config.prefetch_buffer_size)
    if training:
        return dataset.batch(config.meta_batch_size).repeat()
    else:
        return dataset.batch(1)