class_docstr: [`FlaxEncoderDecoderModel`] is a generic model class that will be instantiated as a transformer architecture with
  the module (flax.nn.Module) of one of the base model classes of the library as encoder module and another one as
  decoder module when created with the :meth*~transformers.FlaxAutoModel.from_pretrained* class method for the
  encoder and :meth*~transformers.FlaxAutoModelForCausalLM.from_pretrained* class method for the decoder.
class_docstr_tok: ["[","`","FlaxEncoderDecoderModel","`","]","is","a","generic","model","class","that","will","be","instantiated","as","a","transformer","architecture","with","the","module","(","flax.nn.Module",")","of","one","of","the","base","model","classes","of","the","library","as","encoder","module","and","another","one","as","decoder","module","when","created","with","the",":","meth","*","~transformers.FlaxAutoModel.from_pretrained","*","class","method","for","the","encoder","and",":","meth","*","~transformers.FlaxAutoModelForCausalLM.from_pretrained","*","class","method","for","the","decoder","."]
code: def __init__(
      self,
      config: EncoderDecoderConfig,
      input_shape: Optional[Tuple] = None,
      seed: int = 0,
      dtype: jnp.dtype = jnp.float32,
      _do_init: bool = True,
      **kwargs,
  ):
      if input_shape is None:
          input_shape = ((1, 1), (1, 1))
  
      if not _do_init:
          raise ValueError(
              "`FlaxEncoderDecoderModel` cannot be created without initializing, `_do_init` must be `True`."
          )
  
      if config.decoder.cross_attention_hidden_size is not None:
          if (
              config.decoder.cross_attention_hidden_size
              != config.encoder.hidden_size
          ):
              raise ValueError(
                  "If `cross_attention_hidden_size` is specified in the decoder's configuration, it has to be equal"
                  f" to the encoder's `hidden_size`. Got {config.decoder.cross_attention_hidden_size} for"
                  f" `config.decoder.cross_attention_hidden_size` and {config.encoder.hidden_size} for"
                  " `config.encoder.hidden_size`."
              )
  
      module = self.module_class(config=config, dtype=dtype, **kwargs)
      super().__init__(
          config,
          module,
          input_shape=input_shape,
          seed=seed,
          dtype=dtype,
          _do_init=_do_init,
      )
  
imports: import os
  from typing import Optional, Tuple, Union
  import flax.linen
  import jax
  import jax.numpy
  from flax.core.frozen_dict import FrozenDict, freeze, unfreeze
  from flax.traverse_util import flatten_dict, unflatten_dict
  from jax import lax
  from jax.random import PRNGKey
  from ...modeling_flax_outputs import FlaxBaseModelOutput, FlaxCausalLMOutputWithCrossAttentions, FlaxSeq2SeqLMOutput
  from ...modeling_flax_utils import FlaxPreTrainedModel
  from ...utils import add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from ..auto.configuration_auto import AutoConfig
  from ..auto.modeling_flax_auto import FlaxAutoModel, FlaxAutoModelForCausalLM
  from .configuration_encoder_decoder import EncoderDecoderConfig
label_desc: Use image node_id 1 to create a new FlaxEncoderDecoderModel object from inherited base classes: FlaxPreTrainedModel with example: obj = FlaxEncoderDecoderModel(config, input_shape, seed, dtype, _do_init)