class_docstr: Given an input shaped like ``(batch_size, time_steps, [rest])`` and a ``Module`` that takes
  inputs like ``(batch_size, [rest])``, ``TimeDistributed`` reshapes the input to be
  ``(batch_size * time_steps, [rest])``, applies the contained ``Module``, then reshapes it back.
  
  Note that while the above gives shapes with ``batch_size`` first, this ``Module`` also works if
  ``batch_size`` is second - we always just combine the first two dimensions, then split them.
class_docstr_tok: ["Given","an","input","shaped","like","``","(","batch_size",",","time_steps",",","[","rest","]",")","``","and","a","``","Module","``","that","takes","inputs","like","``","(","batch_size",",","[","rest","]",")","``",",","``","TimeDistributed","``","reshapes","the","input","to","be","``","(","batch_size","*","time_steps",",","[","rest","]",")","``",",","applies","the","contained","``","Module","``",",","then","reshapes","it","back",".","Note","that","while","the","above","gives","shapes","with","``","batch_size","``","first",",","this","``","Module","``","also","works","if","``","batch_size","``","is","second","-","we","always","just","combine","the","first","two","dimensions",",","then","split","them","."]
code: def __init__(self, module):
      super(TimeDistributed, self).__init__()
      self._module = module
  
file_path: jiant/jiant/ext/allennlp.py
imports: from typing import Optional
  import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new TimeDistributed object from inherited base classes: torch.nn with example: obj = TimeDistributed(module)