code: def test_drop_connect_layer(self):
      p_list = [float(d + 1) / 10.0 for d in range(9)]
  
      # testing 1D, 2D and 3D shape
      for rand_tensor_shape in [
          (512, 16, 4),
          (384, 16, 4, 4),
          (256, 16, 4, 4, 4),
      ]:
          # test validation mode, out tensor == in tensor
          training = False
          for p in p_list:
              in_tensor = torch.rand(rand_tensor_shape) + 0.1
              out_tensor = drop_connect(in_tensor, p, training=training)
              self.assertTrue(torch.equal(out_tensor, in_tensor))
  
          # test training mode, sum((out tensor * (1.0 - p)) != in tensor)/out_tensor.size() == p
          # use tolerance of 0.175 to account for rounding errors due to finite set in/out
          tol = 0.175
          training = True
          for p in p_list:
              in_tensor = torch.rand(rand_tensor_shape) + 0.1
              out_tensor = drop_connect(in_tensor, p, training=training)
  
              p_calculated = 1.0 - torch.sum(
                  torch.isclose(in_tensor, out_tensor * (1.0 - p))
              ) / float(in_tensor.numel())
              p_calculated = p_calculated.cpu().numpy()
  
              self.assertTrue(abs(p_calculated - p) < tol)
  
imports: from __future__ import annotations
  import os
  import unittest
  from typing import TYPE_CHECKING
  from unittest import skipUnless
  import torch
  from parameterized import parameterized
  from monai.networks import eval_mode
  from monai.networks.nets import BlockArgs, EfficientNetBN, EfficientNetBNFeatures, drop_connect, get_efficientnet_image_size
  from monai.utils import optional_import
  from tests.utils import skip_if_downloading_fails, skip_if_quick, test_pretrained_networks, test_script_save
label_desc: Use image node_id 4 for calling the TestEFFICIENTNET obj's underlying member method code with example usage: obj.test_drop_connect_layer() without return types