class_docstr: Flattens a contiguous range of dims into a tensor.
  
  For use with :class:`~nn.Sequential`, see :meth:`torch.flatten` for details.
  
  Shape:
      - Input: :math:`(*, S_{\text{start}},..., S_{i}, ..., S_{\text{end}}, *)`,'
        where :math:`S_{i}` is the size at dimension :math:`i` and :math:`*` means any
        number of dimensions including none.
      - Output: :math:`(*, \prod_{i=\text{start}}^{\text{end}} S_{i}, *)`.
  
  Args:
      start_dim: first dim to flatten (default = 1).
      end_dim: last dim to flatten (default = -1).
  
  Examples::
      >>> input = torch.randn(32, 1, 5, 5)
      >>> # With default parameters
      >>> m = nn.Flatten()
      >>> output = m(input)
      >>> output.size()
      torch.Size([32, 25])
      >>> # With non-default parameters
      >>> m = nn.Flatten(0, 2)
      >>> output = m(input)
      >>> output.size()
      torch.Size([160, 5])
class_docstr_tok: ["Flattens","a","contiguous","range","of","dims","into","a","tensor",".","For","use","with",":","class",":","`","~nn.Sequential","`",",","see",":","meth",":","`","torch.flatten","`","for","details",".","Shape",":","-","Input",":",":","math",":","`","(","*",",","S_","{","\\text","{","start","}","}",",","...",",","S_","{","i","}",",","...",",","S_","{","\\text","{","end","}","}",",","*",")","`",",","'","where",":","math",":","`","S_","{","i","}","`","is","the","size","at","dimension",":","math",":","`","i","`","and",":","math",":","`","*","`","means","any","number","of","dimensions","including","none",".","-","Output",":",":","math",":","`","(","*",",","\\prod_","{","i=\\text","{","start","}","}","^","{","\\text","{","end","}","}","S_","{","i","}",",","*",")","`",".","Args",":","start_dim",":","first","dim","to","flatten","(","default","=","1",")",".","end_dim",":","last","dim","to","flatten","(","default","=","-1",")",".","Examples",":",":",">",">",">","input","=","torch.randn","(","32",",","1",",","5",",","5",")",">",">",">","#","With","default","parameters",">",">",">","m","=","nn.Flatten","(",")",">",">",">","output","=","m","(","input",")",">",">",">","output.size","(",")","torch.Size","(","[","32",",","25","]",")",">",">",">","#","With","non-default","parameters",">",">",">","m","=","nn.Flatten","(","0",",","2",")",">",">",">","output","=","m","(","input",")",">",">",">","output.size","(",")","torch.Size","(","[","160",",","5","]",")"]
code: def forward(self, input: Tensor) -> Tensor:
      return input.flatten(self.start_dim, self.end_dim)
  
file_path: pytorch/torch/nn/modules/flatten.py
imports: from .module import Module
  from typing import Tuple, Union
  from torch import Tensor
  from torch.types import _size
label_desc: Use image node_id 2 for calling the Flatten obj's underlying member method code with example usage: obj.forward(input) and returns: input