code: def test_from_to_config():
      num_heads = 8
      head_size = 12
  
      mha = MultiHeadAttention(
          head_size=head_size, num_heads=num_heads, dropout=0.5
      )
  
      config = mha.get_config()
  
      new_mha = MultiHeadAttention.from_config(config)
  
      assert mha.head_size == new_mha.head_size
      assert mha.num_heads == new_mha.num_heads
      assert mha._droput_rate == new_mha._droput_rate
  
file_path: addons/tensorflow_addons/layers/tests/multihead_attention_test.py
imports: import tempfile
  from pathlib import Path
  import numpy
  import pytest
  import tensorflow
  from tensorflow_addons.layers.multihead_attention import MultiHeadAttention
label_desc: Use image node_id 11 for calling a global function with example usage: test_from_to_config() without return types