class_docstr: [`FlaxSpeechEncoderDecoderModel`] 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: ["[","`","FlaxSpeechEncoderDecoderModel","`","]","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: SpeechEncoderDecoderConfig,
      input_shape: Optional[Tuple] = None,
      seed: int = 0,
      dtype: jnp.dtype = jnp.float32,
      _do_init: bool = True,
      **kwargs,
  ):
      if not _do_init:
          raise ValueError(
              "`FlaxSpeechEncoderDecoderModel` cannot be created without initializing, `_do_init` must be `True`."
          )
  
      if config.decoder.cross_attention_hidden_size is not None:
          # Raise ValueError or option to project enc to dec hidden_size (eg EncAdapterLayer)
          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`."
              )
  
      # make sure input & output embeddings are not tied
      config.tie_word_embeddings = False
      module = self.module_class(config=config, dtype=dtype, **kwargs)
  
      if input_shape is None:
          # speech encoders almost always downsample the sequence length dimension
          encoder_input_length = 1024
          decoder_input_length = (
              module._get_feat_extract_output_lengths(
                  encoder_input_length
              )
          )
          input_shape = (
              (1, encoder_input_length),
              (1, decoder_input_length),
          )
  
      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_speech_encoder_decoder import SpeechEncoderDecoderConfig
label_desc: Use image node_id 1 to create a new FlaxSpeechEncoderDecoderModel object from inherited base classes: FlaxPreTrainedModel with example: obj = FlaxSpeechEncoderDecoderModel(config, input_shape, seed, dtype, _do_init)