class_docstr: Transformer Model Encoder for sequence to sequence translation.
class_docstr_tok: ["Transformer","Model","Encoder","for","sequence","to","sequence","translation","."]
code: def __call__(self, x, deterministic=True):
      for lyr in range(self.depth):
          x = Encoder1DBlock(
              name=f"encoderblock_{lyr}",
              mlp_dim=self.mlp_dim,
              num_heads=self.num_heads,
              dropout=self.dropout,
          )(x, deterministic)
      return nn.LayerNorm(name="encoder_norm")(x)
  
imports: import functools
  from typing import Any, Optional
  from absl import logging
  import flax
  import flax.linen
  from flax.training import common_utils
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.model_lib.base_models import base_model
  from scenic.model_lib.base_models import classification_model
  from scenic.model_lib.base_models import model_utils
  from scenic.model_lib.base_models import multilabel_classification_model
  from scenic.model_lib.layers import nn_layers
  import scipy
label_desc: Use image node_id 1 for calling the Encoder obj's underlying member method code with example usage: obj.__call__(x, deterministic) and returns: nn