class_docstr: [CLS]-token for BERT-like inference.
  
  To learn about the [CLS]-based inference, see [1].
  
  When used as a module, the [CLS]-token is appended **to the end** of each item in
  the batch.
  
  References:
  ----------
  [1] Jacob Devlin, Ming-Wei Chang, Kenton Lee, Kristina Toutanova "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding" 2018
class_docstr_tok: ["[","CLS","]","-token","for","BERT-like","inference",".","To","learn","about","the","[","CLS","]","-based","inference",",","see","[","1","]",".","When","used","as","a","module",",","the","[","CLS","]","-token","is","appended","*","*","to","the","end","*","*","of","each","item","in","the","batch",".","References",":","--","--","--","--","--","[","1","]","Jacob","Devlin",",","Ming-Wei","Chang",",","Kenton","Lee",",","Kristina","Toutanova","``","BERT",":","Pre-training","of","Deep","Bidirectional","Transformers","for","Language","Understanding","''","2018"]
docstr: Expand (repeat) the underlying [CLS]-token to a tensor with the given leading dimensions.
  
  A possible use case is building a batch of [CLS]-tokens. See `_CLSToken` for
  examples of usage.
  
  Note:
      Under the hood, the `torch.Tensor.expand` method is applied to the
      underlying :code:`weight` parameter, so gradients will be propagated as
      expected.
  
  Args:
      leading_dimensions: the additional new dimensions
  
  Returns:
      tensor of the shape :code:`(*leading_dimensions, len(self.weight))`
code: def expand(self, *leading_dimensions: int) -> Tensor:
      """Expand (repeat) the underlying [CLS]-token to a tensor with the given leading dimensions.
  
      A possible use case is building a batch of [CLS]-tokens. See `_CLSToken` for
      examples of usage.
  
      Note:
          Under the hood, the `torch.Tensor.expand` method is applied to the
          underlying :code:`weight` parameter, so gradients will be propagated as
          expected.
  
      Args:
          leading_dimensions: the additional new dimensions
  
      Returns:
          tensor of the shape :code:`(*leading_dimensions, len(self.weight))`
      """
      if not leading_dimensions:
          return self.weight
      new_dims = (1,) * (len(leading_dimensions) - 1)
      return self.weight.view(*new_dims, -1).expand(
          *leading_dimensions, -1
      )
  
imports: import enum
  import math
  import warnings
  from typing import Callable, Dict, List, Optional, Tuple, Union, cast
  import torch
  import torch.nn.functional
  from torch import Tensor, nn
  from .utils import init_weights
label_desc: Use image node_id 2 for calling the CLSToken obj's underlying member method code with example usage: obj.expand() and returns: self, self