docstr: Returns node structure representing the hierarchy as defined in the hts package.
  Examples:
      ["1D", "8H", "1H"] --> [3, [8, 8, 8]]
      ["1H", "30min", "1min"] --> [2, [30, 30]]
  
  Note that the nodes structure does not work if any node is *not* formed by grouping its immediate descendants,
  e.g., ["6H", "4H", "2H"].
  
  To know the exact structure of nodes see the help:
  Hierarchical: https://stackoverflow.com/questions/13579292/how-to-use-hts-with-multi-level-hierarchies
  Grouped: https://robjhyndman.com/hyndsight/gts/
  
  :return:
docstr_tok: ["Returns","node","structure","representing","the","hierarchy","as","defined","in","the","hts","package",".","Examples",":","[","``","1D","''",",","``","8H","''",",","``","1H","''","]","--",">","[","3",",","[","8",",","8",",","8","]","]","[","``","1H","''",",","``","30min","''",",","``","1min","''","]","--",">","[","2",",","[","30",",","30","]","]","Note","that","the","nodes","structure","does","not","work","if","any","node","is","*","not","*","formed","by","grouping","its","immediate","descendants",",","e.g.",",","[","``","6H","''",",","``","4H","''",",","``","2H","''","]",".","To","know","the","exact","structure","of","nodes","see","the","help",":","Hierarchical",":","https",":","\/\/stackoverflow.com\/questions\/13579292\/how-to-use-hts-with-multi-level-hierarchies","Grouped",":","https",":","\/\/robjhyndman.com\/hyndsight\/gts\/",":","return",":"]
code: def nodes(self):
      """
      Returns node structure representing the hierarchy as defined in the hts package.
      Examples:
          ["1D", "8H", "1H"] --> [3, [8, 8, 8]]
          ["1H", "30min", "1min"] --> [2, [30, 30]]
  
      Note that the nodes structure does not work if any node is *not* formed by grouping its immediate descendants,
      e.g., ["6H", "4H", "2H"].
  
      To know the exact structure of nodes see the help:
      Hierarchical: https://stackoverflow.com/questions/13579292/how-to-use-hts-with-multi-level-hierarchies
      Grouped: https://robjhyndman.com/hyndsight/gts/
  
      :return:
      """
      agg_multiples = np.array(self.agg_multiples)
      num_children = agg_multiples[:-1] // agg_multiples[1:]
      num_nodes_at_agg_levels = self.num_nodes_per_level[:-1]
  
      nodes = [
          [nc] * num_nodes if num_nodes > 1 else nc
          for nc, num_nodes in zip(
              num_children, num_nodes_at_agg_levels
          )
      ]
      return nodes
  
imports: from typing import Iterator, List
  import numpy
  import pandas
  from gluonts.core.component import validated
  from gluonts.model.forecast import SampleForecast
  from gluonts.mx import Tensor
label_desc: Use image node_id 6 for calling the TemporalHierarchy obj's underlying member method code with example usage: obj.nodes() and returns: nodes