class_docstr: Base class for input data adapter.
  In order to simplify the training code path, all the input data
  object will be converted to a `generator` if possible.
  The sample usage of this class is like:
  
  ```
  x = list(range(100))
  adapter_cls = [ArrayDataAdapter, ..., ListsOfScalarsDataAdapter]
  applicable_adapters = [cls for cls in adapter_cls if cls.can_handle(x)]
  if len(applicable_adapters) != 1:
    raise ValueError("Expect only one adapter class to handle the input")
  dataset = applicable_adapters[0](x).get_dataset()
  for data in dataset():
    # training
  ```
docstr: Return the size (number of batches) for the dataset created.
  For certain type of the data input, the number of batches is known, eg for
  Numpy data, the size is same as (number_of_element / batch_size). Whereas
  for python generator, the size is unknown since it may or may not
  have a end state.
  Returns:
    int, the number of batches for the dataset, or None if it is unknown. The
    caller could use this to control the loop of training, show progress bar,
    or handle unexpected StopIteration error.
docstr_tok: ["Return","the","size","(","number","of","batches",")","for","the","dataset","created",".","For","certain","type","of","the","data","input",",","the","number","of","batches","is","known",",","eg","for","Numpy","data",",","the","size","is","same","as","(","number_of_element","\/","batch_size",")",".","Whereas","for","python","generator",",","the","size","is","unknown","since","it","may","or","may","not","have","a","end","state",".","Returns",":","int",",","the","number","of","batches","for","the","dataset",",","or","None","if","it","is","unknown",".","The","caller","could","use","this","to","control","the","loop","of","training",",","show","progress","bar",",","or","handle","unexpected","StopIteration","error","."]
code: def get_size(self):
      """Return the size (number of batches) for the dataset created.
      For certain type of the data input, the number of batches is known, eg for
      Numpy data, the size is same as (number_of_element / batch_size). Whereas
      for python generator, the size is unknown since it may or may not
      have a end state.
      Returns:
        int, the number of batches for the dataset, or None if it is unknown. The
        caller could use this to control the loop of training, show progress bar,
        or handle unexpected StopIteration error.
      """
      raise NotImplementedError
  
file_path: elegy/elegy/data/data_adapter.py
imports: import abc
  import typing
  import six
label_desc: Use image node_id 4 for calling the DataAdapter obj's underlying member method code with example usage: obj.get_size() without return types