code: def drop_connect(inputs, is_training, drop_connect_rate):
      """
      Apply drop connect to random inputs in a batch.
      """
      if not is_training:
          return inputs
  
      keep_prob = 1 - drop_connect_rate
  
      # compute drop connect tensor
      batch_size = inputs.shape[0]
      random_tensor = keep_prob
      random_tensor += torch.rand(
          [batch_size, 1, 1, 1],
          dtype=inputs.dtype,
          device=inputs.device,
      )
      binary_tensor = torch.floor(random_tensor)
      outputs = (inputs / keep_prob) * binary_tensor
      return outputs
  
imports: import copy
  import math
  from collections import OrderedDict
  from typing import Any, Dict, NamedTuple, Optional
  import torch
  import torch.nn
  from classy_vision.generic.util import get_torch_version
  from classy_vision.models import ClassyModel, register_model
label_desc: Use image node_id 2 for calling a global function with example usage: drop_connect(inputs, is_training, drop_connect_rate) and returns: outputs, inputs