def bottom(self, features):
    """Transforms features to feed into body.

    Ensures that all language tags are transformed using input modality.

    Args:
      features: dict of str to Tensor. The tensors contain token ids.

    Returns:
      transformed_features: dict of same key-value pairs as features. The value
        Tensors are newly transformed (i.e., embeddings).
    """
    if not self._problem_hparams:
      t2t_model.log_warn("Without a Problem, T2TModel.bottom is a passthrough.")
      return features

    transformed_features = collections.OrderedDict()

    # Transform inputs.
    feature_name = "inputs"
    modality_obj = self._problem_hparams.modality[feature_name]
    with tf.variable_scope(modality_obj.name, reuse=False) as vs:
      self._add_variable_scope(modality_obj.name, vs)
      t2t_model.log_info("Transforming feature '%s' with %s.bottom",
                         feature_name,
                         modality_obj.name)
      transformed_features[feature_name] = modality_obj.bottom_simple(
          features[feature_name], "input_emb", reuse=False)

    # Transform tags (using same modality as for the inputs).
    for feature_name in ["all_tags", "input_tags", "target_tags"]:
      if feature_name not in features:
        tf.logging.warning("Missing feature %s - ignoring." % feature_name)
        continue
      with tf.variable_scope(modality_obj.name, reuse=True):
        t2t_model.log_info("Transforming feature '%s' with %s.bottom_simple",
                           feature_name,
                           modality_obj.name)
        transformed_features[feature_name] = modality_obj.bottom_simple(
            features[feature_name], "input_emb", reuse=True)

    # Transform targets.
    feature_name = "targets"
    modality_obj = self._problem_hparams.modality[feature_name]
    with tf.variable_scope(modality_obj.name, reuse=False) as vs:
      self._add_variable_scope(modality_obj.name, vs)
      t2t_model.log_info("Transforming feature '%s' with %s.bottom_simple",
                         feature_name,
                         modality_obj.name)
      transformed_features[feature_name] = modality_obj.bottom_simple(
          features[feature_name], "shared", reuse=False)

    for key in features:
      if key not in transformed_features:
        # For features without a modality, we pass them along as is
        transformed_features[key] = features[key]
      else:
        # Other features get passed along with the "raw" suffix
        transformed_features[key + "_raw"] = features[key]

    return transformed_features
Transforms features to feed into body.

    Ensures that all language tags are transformed using input modality.

    Args:
      features: dict of str to Tensor. The tensors contain token ids.

    Returns:
      transformed_features: dict of same key-value pairs as features. The value
        Tensors are newly transformed (i.e., embeddings).
    
language/labs/consistent_zero_shot_nmt/models/basic.py