def test_get_dataset_enc_dec_unpacked(self):
    mixture_or_task_name = 'enc_dec_unpacked'
    x = [{'inputs': [7, 8, 5, 6, 9, 4, 3], 'targets': [3, 9]}, {'inputs': [8, 4], 'targets': [4]}, {'inputs': [5, 6, 7], 'targets': [6, 5]}]
    ds = create_default_dataset(x)
    dataset_fn = (lambda split, shuffle_files: ds)
    register_dummy_task(mixture_or_task_name, dataset_fn=dataset_fn)
    task_feature_lengths = {'inputs': 7, 'targets': 5}
    converter = feature_converters.EncDecFeatureConverter(pack=False)
    output_ds = dataset_providers.get_dataset(mixture_or_task_name=mixture_or_task_name, task_feature_lengths=task_feature_lengths, dataset_split='train', shuffle=False, feature_converter=converter)
    expected = [{'encoder_input_tokens': [7, 8, 5, 6, 9, 4, 1], 'decoder_target_tokens': [3, 9, 1, 0, 0], 'decoder_input_tokens': [0, 3, 9, 1, 0], 'decoder_loss_weights': [1, 1, 1, 0, 0]}, {'encoder_input_tokens': [8, 4, 1, 0, 0, 0, 0], 'decoder_target_tokens': [4, 1, 0, 0, 0], 'decoder_input_tokens': [0, 4, 1, 0, 0], 'decoder_loss_weights': [1, 1, 0, 0, 0]}, {'encoder_input_tokens': [5, 6, 7, 1, 0, 0, 0], 'decoder_target_tokens': [6, 5, 1, 0, 0], 'decoder_input_tokens': [0, 6, 5, 1, 0], 'decoder_loss_weights': [1, 1, 1, 0, 0]}]
    expected_dtypes = {feat: tf.int32 for feat in expected[0].keys()}
    assert_dataset(output_ds, expected, expected_dtypes=expected_dtypes)
def test_get_dataset_enc_dec_unpacked(self):
    mixture_or_task_name = 'enc_dec_unpacked'
    x = [{'inputs': [7, 8, 5, 6, 9, 4, 3], 'targets': [3, 9]}, {'inputs': [8, 4], 'targets': [4]}, {'inputs': [5, 6, 7], 'targets': [6, 5]}]
    ds = create_default_dataset(x)
    dataset_fn = (lambda split, shuffle_files: ds)
    register_dummy_task(mixture_or_task_name, dataset_fn=dataset_fn)
    task_feature_lengths = {'inputs': 7, 'targets': 5}
    converter = feature_converters.EncDecFeatureConverter(pack=False)
    output_ds = dataset_providers.get_dataset(mixture_or_task_name=mixture_or_task_name, task_feature_lengths=task_feature_lengths, dataset_split='train', shuffle=False, feature_converter=converter)
    expected = [{'encoder_input_tokens': [7, 8, 5, 6, 9, 4, 1], 'decoder_target_tokens': [3, 9, 1, 0, 0], 'decoder_input_tokens': [0, 3, 9, 1, 0], 'decoder_loss_weights': [1, 1, 1, 0, 0]}, {'encoder_input_tokens': [8, 4, 1, 0, 0, 0, 0], 'decoder_target_tokens': [4, 1, 0, 0, 0], 'decoder_input_tokens': [0, 4, 1, 0, 0], 'decoder_loss_weights': [1, 1, 0, 0, 0]}, {'encoder_input_tokens': [5, 6, 7, 1, 0, 0, 0], 'decoder_target_tokens': [6, 5, 1, 0, 0], 'decoder_input_tokens': [0, 6, 5, 1, 0], 'decoder_loss_weights': [1, 1, 1, 0, 0]}]
    expected_dtypes = {feat: tf.int32 for feat in expected[0].keys()}
    assert_dataset(output_ds, expected, expected_dtypes=expected_dtypes)