class_docstr: A batch of series from different base datasets, represented by the padded batch, the lengths of the series
  and the splits sizes indicating the corresponding base dataset.
class_docstr_tok: ["A","batch","of","series","from","different","base","datasets",",","represented","by","the","padded","batch",",","the","lengths","of","the","series","and","the","splits","sizes","indicating","the","corresponding","base","dataset","."]
docstr: Choose the first n splits of the sequences as defined by split_sections.
  Self.sequences has thus sum(split_section[i], i=0, ..., n-1) elements.
docstr_tok: ["Choose","the","first","n","splits","of","the","sequences","as","defined","by","split_sections",".","Self.sequences","has","thus","sum","(","split_section","[","i","]",",","i=0",",","...",",","n-1",")","elements","."]
code: def first_n(self, n: int) -> SeriesBatch:
      """
      Choose the first n splits of the sequences as defined by split_sections.
      Self.sequences has thus sum(split_section[i], i=0, ..., n-1) elements.
      """
      splits = torch.split(self.sequences, self.split_sections.tolist())
      lengths = torch.split(self.lengths, self.split_sections.tolist())
      return SeriesBatch(
          sequences=torch.cat(splits[:n]),
          lengths=torch.cat(lengths[:n]),
          split_sections=self.split_sections[:n],
      )
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import List, Optional
  import torch
  from torch.nn.utils.rnn import pad_sequence
  from .sampling import Triplet
  from .dataset import TimeSeries
  from meta.common.torch import tensor_to_np
label_desc: Use image node_id 7 for calling the SeriesBatch obj's underlying member method code with example usage: obj.first_n(n) and returns: SeriesBatch