code: def _get_dropped_weights(w_raw, dropout_p, is_training):
      """Drops out weights to implement DropConnect.
  
      Args:
          w_raw: Full, pre-dropout, weights to be dropped out.
          dropout_p: Proportion of weights to drop out.
          is_training: True iff _shared_ model is training.
  
      Returns:
          The dropped weights.
  
      TODO(brendan): Why does torch.nn.functional.dropout() return:
      1. `torch.autograd.Variable()` on the training loop
      2. `torch.nn.Parameter()` on the controller or eval loop, when
      training = False...
  
      Even though the call to `_setweights` in the Smerity repo's
      `weight_drop.py` does not have this behaviour, and `F.dropout` always
      returns `torch.autograd.Variable` there, even when `training=False`?
  
      The above TODO is the reason for the hacky check for `torch.nn.Parameter`.
      """
      dropped_w = F.dropout(w_raw, p=dropout_p, training=is_training)
  
      if isinstance(dropped_w, torch.nn.Parameter):
          dropped_w = dropped_w.clone()
  
      return dropped_w
  
imports: import numpy
  import collections
  import torch
  from torch import nn
  import torch.nn.functional
  from torch.autograd import Variable
  import models.shared_base
  import utils
label_desc: Use image node_id 1 for calling a global function with example usage: _get_dropped_weights(w_raw, dropout_p, is_training) and returns: dropped_w