class_docstr: A Dataset that wraps existing ndarrays, Tensors, lists... to provide
  basic Dataset functionalities. Very similar to TensorDataset.
class_docstr_tok: ["A","Dataset","that","wraps","existing","ndarrays",",","Tensors",",","lists","...","to","provide","basic","Dataset","functionalities",".","Very","similar","to","TensorDataset","."]
docstr: Creates a ``SequenceDataset`` instance.
  
  Beware that the second sequence, will be used to fill the targets
  field without running any kind of type conversion.
  
  :param sequences: A sequence of sequences, Tensors or ndarrays
      representing the patterns.
  :param targets: A sequence representing the targets field of the
      dataset. Can either be 1) a sequence of values containing as many
      elements as the number of contained patterns, or 2) the index
      of the sequence to use as the targets field. Defaults to 1, which
      means that the second sequence (usually containing the "y" values)
      will be used for the targets field.
docstr_tok: ["Creates","a","``","SequenceDataset","``","instance",".","Beware","that","the","second","sequence",",","will","be","used","to","fill","the","targets","field","without","running","any","kind","of","type","conversion",".",":","param","sequences",":","A","sequence","of","sequences",",","Tensors","or","ndarrays","representing","the","patterns",".",":","param","targets",":","A","sequence","representing","the","targets","field","of","the","dataset",".","Can","either","be","1",")","a","sequence","of","values","containing","as","many","elements","as","the","number","of","contained","patterns",",","or","2",")","the","index","of","the","sequence","to","use","as","the","targets","field",".","Defaults","to","1",",","which","means","that","the","second","sequence","(","usually","containing","the","``","y","''","values",")","will","be","used","for","the","targets","field","."]
code: def __init__(
      self,
      *sequences: Sequence,
      targets: Union[int, Sequence[TTargetType]] = 1,
  ):
      """
      Creates a ``SequenceDataset`` instance.
  
      Beware that the second sequence, will be used to fill the targets
      field without running any kind of type conversion.
  
      :param sequences: A sequence of sequences, Tensors or ndarrays
          representing the patterns.
      :param targets: A sequence representing the targets field of the
          dataset. Can either be 1) a sequence of values containing as many
          elements as the number of contained patterns, or 2) the index
          of the sequence to use as the targets field. Defaults to 1, which
          means that the second sequence (usually containing the "y" values)
          will be used for the targets field.
      """
      if len(sequences) < 1:
          raise ValueError("At least one sequence must be passed")
  
      common_size = len(sequences[0])
      for seq in sequences:
          if len(seq) != common_size:
              raise ValueError(
                  "Sequences must contain the same "
                  "amount of elements"
              )
  
      self._sequences = sequences
      if isinstance(targets, int):
          targets = sequences[targets]
  
      self.targets: Sequence[TTargetType] = targets
  
imports: from abc import ABC, abstractmethod
  import bisect
  import copy
  from typing import Iterator, overload
  from typing_extensions import final
  import numpy
  from numpy import ndarray
  from torch import Tensor
  from torch.utils.data import Subset
  from .dataset_definitions import IDatasetWithTargets
  from typing import Sequence, List, Iterable, Union, Optional, TypeVar, Callable, Generic
label_desc: Use image node_id 1 to create a new SequenceDataset object from inherited base classes: IDatasetWithTargets with example: obj = SequenceDataset()