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):
      out = {}
  
      # Input Encoder
      for lyr in range(self.depth):
          block = Encoder1DBlock(
              name=f"encoderblock_{lyr}",
              mlp_dim=self.mlp_dim,
              num_heads=self.num_heads,
              dropout=self.dropout,
              dtype=self.dtype,
          )
          x, out[f"block{lyr:02d}"] = block(x, deterministic)
          if (
              self.num_frozen_layers > 0
              and lyr == self.num_frozen_layers - 1
          ):
              x = jax.lax.stop_gradient(x)
      out[
          "pre_ln"
      ] = x  # Alias for last block, but without the number in it.
  
      return nn.LayerNorm(name="encoder_norm")(x), out
  
file_path: scenic/scenic/projects/knowledge_visual_language/models/vit.py
imports: from typing import Optional, Sequence, Union
  from big_vision.models import vit
  import flax.linen
  import jax
  import jax.numpy
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,  out