class_docstr: The Seq2Edits model. See file docstring.
docstr: Encodes transformer inputs, see transformer.transformer_encode().
docstr_tok: ["Encodes","transformer","inputs",",","see","transformer.transformer_encode","(",")","."]
code: def encode(
      self, inputs, target_space, hparams, features=None, losses=None
  ):
      """Encodes transformer inputs, see transformer.transformer_encode()."""
      return transformer.transformer_encode(
          self._encoder_function,
          inputs,
          target_space,
          hparams,
          attention_weights=self.attention_weights,
          features=features,
          losses=losses,
          prepare_encoder_fn=self._prepare_encoder_fn,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import transformer_layers
  from tensor2tensor.models import transformer
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the TransformerSeq2edits obj's underlying member method code with example usage: obj.encode(inputs, target_space, hparams, features, losses) and returns: transformer