class_docstr: Layout Denoise VH-only Transformer.
  
  Attributes:
    num_heads: Number of heads.
    num_encoder_layers: Number of encoder layers.
    qkv_dim: Dimension of the query/key/value.
    mlp_dim: Dimension of the mlp on top of attention block.
    return_intermediate_dec: If return the outputs from intermediate layers of
      the decoder.
    normalize_before: If use LayerNorm before attention/mlp blocks.
    dropout_rate: Dropout rate.
    attention_dropout_rate:Dropout rate for attention weights.
    dtype: Data type of the computation (default: float32).
class_docstr_tok: ["Layout","Denoise","VH-only","Transformer",".","Attributes",":","num_heads",":","Number","of","heads",".","num_encoder_layers",":","Number","of","encoder","layers",".","qkv_dim",":","Dimension","of","the","query\/key\/value",".","mlp_dim",":","Dimension","of","the","mlp","on","top","of","attention","block",".","return_intermediate_dec",":","If","return","the","outputs","from","intermediate","layers","of","the","decoder",".","normalize_before",":","If","use","LayerNorm","before","attention\/mlp","blocks",".","dropout_rate",":","Dropout","rate",".","attention_dropout_rate",":","Dropout","rate","for","attention","weights",".","dtype",":","Data","type","of","the","computation","(","default",":","float32",")","."]
docstr: Applies DeTRTransformer on the inputs.
  
  Args:
    vh_inputs: vh inputs.
    padding_mask: Binary mask containing 0 for padding tokens.
    pos_embedding: Positional Embedding to be added to the inputs.
    train: Whether it is training.
  
  Returns:
    Output of the encoding of view hierarchy nodes.
docstr_tok: ["Applies","DeTRTransformer","on","the","inputs",".","Args",":","vh_inputs",":","vh","inputs",".","padding_mask",":","Binary","mask","containing","0","for","padding","tokens",".","pos_embedding",":","Positional","Embedding","to","be","added","to","the","inputs",".","train",":","Whether","it","is","training",".","Returns",":","Output","of","the","encoding","of","view","hierarchy","nodes","."]
code: def __call__(
      self,
      vh_inputs: jnp.ndarray,
      *,
      padding_mask: Optional[jnp.ndarray] = None,
      pos_embedding: Optional[jnp.ndarray] = None,
      train: bool = False,
  ) -> Tuple[jnp.ndarray, jnp.ndarray]:
      """Applies DeTRTransformer on the inputs.
  
      Args:
        vh_inputs: vh inputs.
        padding_mask: Binary mask containing 0 for padding tokens.
        pos_embedding: Positional Embedding to be added to the inputs.
        train: Whether it is training.
  
      Returns:
        Output of the encoding of view hierarchy nodes.
      """
      encoder_norm = nn.LayerNorm() if self.normalize_before else None
      encoded = transformer.Encoder(
          num_heads=self.num_heads,
          num_layers=self.num_encoder_layers,
          qkv_dim=self.qkv_dim,
          mlp_dim=self.mlp_dim,
          normalize_before=self.normalize_before,
          norm=encoder_norm,
          dropout_rate=self.dropout_rate,
          attention_dropout_rate=self.attention_dropout_rate,
          dtype=self.dtype,
          name="encoder",
      )(
          vh_inputs,
          padding_mask=padding_mask,
          pos_embedding=pos_embedding,
          train=train,
      )
  
      return encoded
  
imports: from typing import Any, Dict, List, Tuple, Optional
  import flax.linen
  import jax.numpy
  import ml_collections
  from scenic.projects.baselines import resnet
  from scenic.projects.layout_denoise import base_model
  from scenic.projects.layout_denoise.layers import common
  from scenic.projects.layout_denoise.layers import embedding
  from scenic.projects.layout_denoise.layers import predictor
  from scenic.projects.layout_denoise.layers import transformer
label_desc: Use image node_id 1 for calling the VHOnlyModel obj's underlying member method code with example usage: obj.__call__(vh_inputs) and returns: encoded