class_docstr: Class for managing the user data in nebullvm.
  
  Attributes:
      data_reader(Sequence): Object implementing the __getitem__, the
          __len__ and the __iter__/__next__ APIs. It should read the
          user data and return tuples of tensors for feeding the models.
code: def from_dataloader(
      cls,
      dataloader: Union[DataLoader, tf.data.Dataset],
      max_length: int = 500,
  ):
      batch_size = (
          dataloader.batch_size
          if isinstance(dataloader, DataLoader)
          else dataloader._batch_size
      )
  
      if batch_size > max_length:
          raise ValueError(
              f"Batch size ({dataloader.batch_size}) is greater than "
              f"max_length ({max_length})."
          )
      data_manager = []
      warning_label = False
      for i, batch in enumerate(dataloader):
          if i * batch_size >= max_length:
              break
  
          if isinstance(batch, (list, tuple)):
              if len(batch) == 1:
                  data_manager.append((batch, None))
              elif len(batch) == 2:
                  if isinstance(batch[0], tuple):
                      data_manager.append((batch[0], batch[1]))
                  elif isinstance(batch[0], (torch.Tensor, tf.Tensor)):
                      warning_label = True
                      data_manager.append(((batch[0],), batch[1]))
                  else:
                      raise ValueError(
                          "The first element of the batch should be a "
                          "tuple or a torch.Tensor"
                      )
              else:
                  warning_label = True
                  data_manager.append(
                      (tuple(t for t in batch[:-1]), batch[-1])
                  )
          elif isinstance(batch, (torch.Tensor, tf.Tensor)):
              data_manager.append(((batch,), None))
          else:
              raise ValueError(
                  "The batch should be a tuple, a list or a Tensor"
              )
  
      if warning_label:
          logger.warning(
              "The provided dataloader returns a tuple of tensors"
              "for each batch. The last tensor in the tuple will "
              "be considered as the label. "
              "To avoid this warning, the dataloader should return "
              "a tuple for each batch, where the first element is "
              "a tuple containing the inputs and the second element "
              "is a tensor containing the label."
          )
  
      return cls(data_manager)
  
imports: from typing import Sequence, List, Tuple, Any, Union, Iterable
  import numpy
  from loguru import logger
  from nebullvm.config import MIN_DIM_INPUT_DATA
  from nebullvm.optional_modules.tensorflow import tensorflow
  from nebullvm.optional_modules.torch import torch, Dataset, DataLoader
  from nebullvm.tools.onnx import convert_to_numpy
label_desc: Use image node_id 9 for calling the DataManager obj's underlying member method code with example usage: obj.from_dataloader(cls, dataloader, max_length) and returns: cls