code: def setUp(self, seed=1234):
      torch.manual_seed(seed)
  
      self.seq_length = 80
      self.sequences = 10
      self.hidden_dim = 1024
      self.heads = 16
      self.dropout_prob = 0.0
  
      self.ref_layer = EncdecMultiheadAttn(
          self.hidden_dim,
          self.heads,
          dropout=self.dropout_prob,
          bias=False,
          include_norm_add=False,
          impl="default",
      )
      self.ref_layer.cuda().half()
      self.ref_layer.reset_parameters()
      self.ref_inputs_q = torch.randn(
          self.seq_length,
          self.sequences,
          self.hidden_dim,
          dtype=torch.float16,
          device=torch.device("cuda"),
      ).requires_grad_(True)
      self.ref_inputs_k = torch.randn(
          self.seq_length,
          self.sequences,
          self.hidden_dim,
          dtype=torch.float16,
          device=torch.device("cuda"),
      ).requires_grad_(True)
  
      # Reset seed so parameters are identical
      torch.manual_seed(seed)
      torch.cuda.manual_seed_all(seed)
  
      self.tst_layer = EncdecMultiheadAttn(
          self.hidden_dim,
          self.heads,
          dropout=self.dropout_prob,
          bias=False,
          include_norm_add=False,
          impl="fast",
      )
      self.tst_layer.cuda().half()
      self.tst_layer.reset_parameters()
  
      self.tst_inputs_q = torch.randn(
          self.seq_length,
          self.sequences,
          self.hidden_dim,
          dtype=torch.float16,
          device=torch.device("cuda"),
      ).requires_grad_(True)
      self.tst_inputs_k = torch.randn(
          self.seq_length,
          self.sequences,
          self.hidden_dim,
          dtype=torch.float16,
          device=torch.device("cuda"),
      ).requires_grad_(True)
  
file_path: apex/apex/contrib/test/multihead_attn/test_encdec_multihead_attn.py
imports: import unittest
  import torch
label_desc: Use image node_id 1 for calling the EncdecMultiheadAttnTest obj's underlying member method code with example usage: obj.setUp(seed) without return types