class_docstr: https://arxiv.org/abs/2212.00794
class_docstr_tok: ["https",":","\/\/arxiv.org\/abs\/2212.00794"]
code: def __call__(self, x):
      if self.prob == 0.0 or not self.training:
          return x
  
      class_token_length = self.class_token_length
      if self.exclude_cls_tokens:
          cls_tokens, x = (
              x[:, :class_token_length],
              x[:, class_token_length:],
          )
  
      batch, num_tokens, _ = x.shape
      device = x.device
  
      batch_indices = torch.arange(batch, device=device)
      batch_indices = batch_indices[..., None]
  
      keep_prob = 1 - self.prob
      num_patches_keep = max(1, int(num_tokens * keep_prob))
  
      rand = torch.randn(batch, num_tokens, device=device)
      patch_indices_keep = rand.topk(num_patches_keep, dim=-1).indices
  
      x = x[batch_indices, patch_indices_keep]
  
      if self.exclude_cls_tokens:
          x = torch.cat((cls_tokens, x), dim=1)
  
      return x
  
imports: import math
  from functools import partial
  import einops
  import torch
  import torch.nn.functional
  from nemo.collections.nlp.modules.common.megatron.fused_layer_norm import get_layer_norm
  from nemo.collections.nlp.modules.common.megatron.module import MegatronModule
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults, init_method_normal, scaled_init_method_normal
  from nemo.collections.vision.modules.common.megatron.vision_transformer import ParallelVisionTransformer
label_desc: Use image node_id 2 for calling the DropPatch obj's underlying member method code with example usage: obj.__call__(x) and returns: x, x