import tensorflow as tf

        if self._trg_lang_tag_position in ["src", "source"]:
            src = tf.concat([tf.expand_dims(batch_of_data["trg_lang"], axis=1), src], axis=1)
        if self._with_src_lang_tag:
            src = tf.concat([tf.expand_dims(batch_of_data["src_lang"], axis=1), src], axis=1)

        input_dict = {"src": src,
                      "src_length": deduce_text_length(src, self._multilingual_dp.meta["pad_id"],
                                                       self._multilingual_dp.meta["padding_mode"])}
        if self._trg_lang_tag_position in ["trg", "target"]:
            target_bos = batch_of_data["trg_lang"]
        else:
            target_bos = tf.tile([tf.convert_to_tensor(
                self._multilingual_dp.meta["bos_id"], dtype=tf.int64)], [tf.shape(src)[0]])
        if mode == compat.ModeKeys.INFER:
            input_dict["trg_input"] = target_bos
        else:
            input_dict["trg"] = batch_of_data["label"]
            input_dict["trg_length"] = deduce_text_length(batch_of_data["label"],
                                                          self._multilingual_dp.meta["pad_id"],
                                                          self._multilingual_dp.meta["padding_mode"])
            input_dict["trg_input"] = tf.concat([tf.expand_dims(target_bos, axis=1),
                                                 batch_of_data["label"][:, :-1]], axis=1)
