class_docstr: A Loader for [single mode](https://graphneural.network/data-modes/#single-mode).
  
  This loader produces Tensors representing a single graph. As such, it can
  only be used with Datasets of length 1 and the `batch_size` cannot be set.
  
  The loader supports sample weights through the `sample_weights` argument.
  If given, then each batch will be a tuple `(inputs, labels, sample_weights)`.
  
  **Arguments**
  
  - `dataset`: a `spektral.data.Dataset` object with only one graph;
  - `epochs`: int, number of epochs to iterate over the dataset. By default (`None`)
  iterates indefinitely;
  - `shuffle`: bool, whether to shuffle the data at the start of each epoch;
  - `sample_weights`: Numpy array, will be appended to the output automatically.
  
  **Output**
  
  Returns a tuple `(inputs, labels)` or `(inputs, labels, sample_weights)`.
  
  `inputs` is a tuple containing the data matrices of the graph, only if they
  are not `None`:
  
  - `x`: same as `dataset[0].x`;
  - `a`: same as `dataset[0].a` (scipy sparse matrices are converted to
  SparseTensors);
  - `e`: same as `dataset[0].e`;
  
  `labels` is the same as `dataset[0].y`.
  
  `sample_weights` is the same array passed when creating the loader.
code: def __init__(self, dataset, epochs=None, sample_weights=None):
      if len(dataset) != 1:
          raise ValueError(
              "SingleLoader can only be used with Datasets that"
              "have a single graph."
          )
      self.sample_weights = sample_weights
      super().__init__(
          dataset, batch_size=1, epochs=epochs, shuffle=False
      )
  
imports: import numpy
  import tensorflow
  from spektral.data.utils import batch_generator, collate_labels_batch, collate_labels_disjoint, get_spec, prepend_none, sp_matrices_to_sp_tensors, to_batch, to_disjoint, to_mixed, to_tf_signature
label_desc: Use image node_id 1 to create a new SingleLoader object from inherited base classes: Loader with example: obj = SingleLoader(dataset, epochs, sample_weights)