class_docstr: Conversion class for MultiheadAttention.
code: def from_observed(cls, observed_module: _nn.Module):
      cls.do_attribute_assertions(observed_module)
      finalized_weights = cls.get_finalized_weights(observed_module)
      return_module = _nn.MultiheadAttention(
          embed_dim=observed_module.embed_dim,
          num_heads=observed_module.num_heads,
          dropout=observed_module.dropout,
          bias=observed_module.bias is not None,
          add_bias_kv=observed_module.add_bias_kv,
          add_zero_attn=observed_module.add_zero_attn,
          kdim=observed_module.kdim,
          vdim=observed_module.vdim,
          batch_first=observed_module.batch_first,
          device=observed_module.device
          if hasattr(observed_module, "device")
          else None,
          dtype=observed_module.dtype
          if hasattr(observed_module, "dtype")
          else None,
      )
      return_module.weight = _nn.Parameter(finalized_weights)
      return_module.bias = _nn.Parameter(observed_module.bias.detach())
      if observed_module.add_bias_kv:
          return_module.bias_k = _nn.Parameter(
              observed_module.bias_k.detach()
          )
          return_module.bias_v = _nn.Parameter(
              observed_module.bias_v.detach()
          )
      else:
          return_module.bias_k = return_module.bias_v = None
      return_module.activation_post_process = (
          observed_module.activation_post_process
      )
      return return_module
  
imports: import torch.nn
  import torch.nn.qat
  from ._supported_modules import Conv1d, Embedding, LayerNorm, MultiheadAttention
label_desc: Use image node_id 2 for calling the MultiheadAttentionPalettizationConversion obj's underlying member method code with example usage: obj.from_observed(cls, observed_module) and returns: return_module