code: def test_attention_block(self):
      for dims in [2, 3]:
          block = att.AttentionBlock(dims, f_int=2, f_g=6, f_l=6)
          shape = (4, 6) + (30,) * dims
          x = torch.rand(*shape, dtype=torch.float32)
          output = block(x, x)
          self.assertEqual(output.shape, x.shape)
  
          block = att.AttentionBlock(dims, f_int=2, f_g=3, f_l=6)
          xshape = (4, 6) + (30,) * dims
          x = torch.rand(*xshape, dtype=torch.float32)
          gshape = (4, 3) + (30,) * dims
          g = torch.rand(*gshape, dtype=torch.float32)
          output = block(g, x)
          self.assertEqual(output.shape, x.shape)
  
file_path: MONAI/tests/test_attentionunet.py
imports: from __future__ import annotations
  import unittest
  import torch
  import monai.networks.nets.attentionunet
  from tests.utils import skip_if_no_cuda, skip_if_quick
label_desc: Use image node_id 1 for calling the TestAttentionUnet obj's underlying member method code with example usage: obj.test_attention_block() without return types