code: def _make_block_diagonal(blocks: Sequence[Tensor]) -> Tensor:
      assert (
          len(blocks) > 0
      ), "You need at least one tensor to make a block-diagonal tensor"
  
      if len(blocks) == 1:
          return blocks[0]
  
      F = getF(blocks[0])
  
      # transition coefficient is block diagonal!
      block_diagonal = _make_2_block_diagonal(F, blocks[0], blocks[1])
      for i in range(2, len(blocks)):
          block_diagonal = _make_2_block_diagonal(
              F=F, left=block_diagonal, right=blocks[i]
          )
  
      return block_diagonal
  
imports: from typing import List, Sequence, Tuple
  from pandas.tseries.frequencies import to_offset
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from gluonts.mx.distribution.distribution import getF
  from gluonts.mx.util import _broadcast_param
  from gluonts.time_feature import Constant, day_of_week_index, hour_of_day_index, minute_of_hour_index, month_of_year_index, TimeFeature, week_of_year_index, norm_freq_str
label_desc: Use image node_id 1 for calling a global function with example usage: _make_block_diagonal(blocks) and returns: block_diagonal, blocks