class_docstr: For :math:`N` tensors, they use different dropout masks respectively.
  When :math:`N-M` of them are dropped, the remaining :math:`M` ones are scaled by a factor of :math:`N/M` to compensate,
  and when all of them are dropped together, zeros are returned.
  
  Args:
      p (float):
          The probability of an element to be zeroed. Default: 0.5.
  
  Examples:
      >>> x, y = torch.ones(1, 3, 5), torch.ones(1, 3, 5)
      >>> x, y = IndependentDropout()(x, y)
      >>> x
      tensor([[[1., 1., 1., 1., 1.],
               [0., 0., 0., 0., 0.],
               [2., 2., 2., 2., 2.]]])
      >>> y
      tensor([[[1., 1., 1., 1., 1.],
               [2., 2., 2., 2., 2.],
               [0., 0., 0., 0., 0.]]])
class_docstr_tok: ["For",":","math",":","`","N","`","tensors",",","they","use","different","dropout","masks","respectively",".","When",":","math",":","`","N-M","`","of","them","are","dropped",",","the","remaining",":","math",":","`","M","`","ones","are","scaled","by","a","factor","of",":","math",":","`","N\/M","`","to","compensate",",","and","when","all","of","them","are","dropped","together",",","zeros","are","returned",".","Args",":","p","(","float",")",":","The","probability","of","an","element","to","be","zeroed",".","Default",":","0.5",".","Examples",":",">",">",">","x",",","y","=","torch.ones","(","1",",","3",",","5",")",",","torch.ones","(","1",",","3",",","5",")",">",">",">","x",",","y","=","IndependentDropout","(",")","(","x",",","y",")",">",">",">","x","tensor","(","[","[","[","1.",",","1.",",","1.",",","1.",",","1",".","]",",","[","0.",",","0.",",","0.",",","0.",",","0",".","]",",","[","2.",",","2.",",","2.",",","2.",",","2",".","]","]","]",")",">",">",">","y","tensor","(","[","[","[","1.",",","1.",",","1.",",","1.",",","1",".","]",",","[","2.",",","2.",",","2.",",","2.",",","2",".","]",",","[","0.",",","0.",",","0.",",","0.",",","0",".","]","]","]",")"]
docstr: Args:
      items (list[~torch.Tensor]):
          A list of tensors that have the same shape except the last dimension.
  Returns:
      The returned tensors are of the same shape as `items`.
docstr_tok: ["Args",":","items","(","list","[","~torch.Tensor","]",")",":","A","list","of","tensors","that","have","the","same","shape","except","the","last","dimension",".","Returns",":","The","returned","tensors","are","of","the","same","shape","as","`","items","`","."]
code: def forward(self, *items):
      r"""
      Args:
          items (list[~torch.Tensor]):
              A list of tensors that have the same shape except the last dimension.
      Returns:
          The returned tensors are of the same shape as `items`.
      """
  
      if self.training:
          masks = [
              x.new_empty(x.shape[:2]).bernoulli_(1 - self.p)
              for x in items
          ]
          total = sum(masks)
          scale = len(items) / total.max(torch.ones_like(total))
          masks = [mask * scale for mask in masks]
          items = [
              item * mask.unsqueeze(-1)
              for item, mask in zip(items, masks)
          ]
  
      return items
  
imports: import torch
  import torch.nn
  from torch.nn.utils.rnn import pack_padded_sequence, PackedSequence
  from torch.nn.modules.rnn import apply_permutation
label_desc: Use image node_id 3 for calling the IndependentDropout obj's underlying member method code with example usage: obj.forward() and returns: items