class_docstr: Cross Attention 2D Downsizing block - original architecture from Unet transformers:
  https://arxiv.org/abs/2103.06104
  
  Parameters:
      in_channels (:obj:`int`):
          Input channels
      out_channels (:obj:`int`):
          Output channels
      dropout (:obj:`float`, *optional*, defaults to 0.0):
          Dropout rate
      num_layers (:obj:`int`, *optional*, defaults to 1):
          Number of attention blocks layers
      num_attention_heads (:obj:`int`, *optional*, defaults to 1):
          Number of attention heads of each spatial transformer block
      add_downsample (:obj:`bool`, *optional*, defaults to `True`):
          Whether to add downsampling layer before each final output
      use_memory_efficient_attention (`bool`, *optional*, defaults to `False`):
          enable memory efficient attention https://arxiv.org/abs/2112.05682
      split_head_dim (`bool`, *optional*, defaults to `False`):
          Whether to split the head dimension into a new axis for the self-attention computation. In most cases,
          enabling this flag should speed up the computation for Stable Diffusion 2.x and Stable Diffusion XL.
      dtype (:obj:`jnp.dtype`, *optional*, defaults to jnp.float32):
          Parameters `dtype`
class_docstr_tok: ["Cross","Attention","2D","Downsizing","block","-","original","architecture","from","Unet","transformers",":","https",":","\/\/arxiv.org\/abs\/2103.06104","Parameters",":","in_channels","(",":","obj",":","`","int","`",")",":","Input","channels","out_channels","(",":","obj",":","`","int","`",")",":","Output","channels","dropout","(",":","obj",":","`","float","`",",","*","optional","*",",","defaults","to","0.0",")",":","Dropout","rate","num_layers","(",":","obj",":","`","int","`",",","*","optional","*",",","defaults","to","1",")",":","Number","of","attention","blocks","layers","num_attention_heads","(",":","obj",":","`","int","`",",","*","optional","*",",","defaults","to","1",")",":","Number","of","attention","heads","of","each","spatial","transformer","block","add_downsample","(",":","obj",":","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","add","downsampling","layer","before","each","final","output","use_memory_efficient_attention","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","enable","memory","efficient","attention","https",":","\/\/arxiv.org\/abs\/2112.05682","split_head_dim","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","to","split","the","head","dimension","into","a","new","axis","for","the","self-attention","computation",".","In","most","cases",",","enabling","this","flag","should","speed","up","the","computation","for","Stable","Diffusion","2.x","and","Stable","Diffusion","XL",".","dtype","(",":","obj",":","`","jnp.dtype","`",",","*","optional","*",",","defaults","to","jnp.float32",")",":","Parameters","`","dtype","`"]
code: def __call__(
      self,
      hidden_states,
      temb,
      encoder_hidden_states,
      deterministic=True,
  ):
      output_states = ()
  
      for resnet, attn in zip(self.resnets, self.attentions):
          hidden_states = resnet(
              hidden_states, temb, deterministic=deterministic
          )
          hidden_states = attn(
              hidden_states,
              encoder_hidden_states,
              deterministic=deterministic,
          )
          output_states += (hidden_states,)
  
      if self.add_downsample:
          hidden_states = self.downsamplers_0(hidden_states)
          output_states += (hidden_states,)
  
      return hidden_states, output_states
  
imports: import flax.linen
  import jax.numpy
  from .attention_flax import FlaxTransformer2DModel
  from .resnet_flax import FlaxDownsample2D, FlaxResnetBlock2D, FlaxUpsample2D
label_desc: Use image node_id 2 for calling the FlaxCrossAttnDownBlock2D obj's underlying member method code with example usage: obj.__call__(hidden_states, temb, encoder_hidden_states, deterministic) and returns: hidden_states,  output_states