class_docstr: Flattens the input Tensor, preserving the batch dimension(s).
  
  ``Flatten`` reshapes input tensors to combine all trailing dimensions
  apart from the first. Additional leading dimensions can be preserved
  by setting the ``preserve_dims`` parameter.
  
  See :class:`Reshape` for more details.
class_docstr_tok: ["Flattens","the","input","Tensor",",","preserving","the","batch","dimension","(","s",")",".","``","Flatten","``","reshapes","input","tensors","to","combine","all","trailing","dimensions","apart","from","the","first",".","Additional","leading","dimensions","can","be","preserved","by","setting","the","``","preserve_dims","``","parameter",".","See",":","class",":","`","Reshape","`","for","more","details","."]
docstr: Constructs a ``Flatten`` module.
  
  Args:
    preserve_dims: Number of leading dimensions that will not be reshaped.
    name: Name of the module.
docstr_tok: ["Constructs","a","``","Flatten","``","module",".","Args",":","preserve_dims",":","Number","of","leading","dimensions","that","will","not","be","reshaped",".","name",":","Name","of","the","module","."]
code: def __init__(
      self, preserve_dims: int = 1, name: Optional[str] = None
  ):
      """Constructs a ``Flatten`` module.
  
      Args:
        preserve_dims: Number of leading dimensions that will not be reshaped.
        name: Name of the module.
      """
      super().__init__(
          output_shape=(-1,), preserve_dims=preserve_dims, name=name
      )
  
file_path: sonnet/sonnet/src/reshape.py
imports: from typing import Optional, Sequence
  import numpy
  from sonnet.src import base
  from sonnet.src import once
  from sonnet.src import types
  import tensorflow
label_desc: Use image node_id 1 to create a new Flatten object from inherited base classes: Reshape with example: obj = Flatten(preserve_dims, name)