code: def _embeddings_to_distr(
      self,
      F,
      embeddings_at_all_levels: Tensor,
      scales: List,
  ) -> Distribution:
      distr_output = self.models[0].distr_output
      distr_args_at_all_levels: Dict = {
          arg_name: [] for arg_name in distr_output.args_dim.keys()
      }
      scales_ls = []
  
      start_ix = 0
      for i, num_nodes in enumerate(
          self.temporal_hierarchy.num_nodes_per_level
      ):
          end_ix = start_ix + num_nodes
          distr_args = self.models[i].proj_distr_args(
              embeddings_at_all_levels[..., start_ix:end_ix, :]
          )
  
          for j, arg_ls in enumerate(distr_args_at_all_levels.values()):
              arg_ls.append(distr_args[j])
  
          scales_ls.append(scales[i].broadcast_like(distr_args[0]))
  
          start_ix = end_ix
  
      # Last dimension contains parameters at all time-levels and aggregation can be done on it.
      distr_args_at_all_levels = {
          arg_name: F.concat(*arg_ls, dim=-1)
          for arg_name, arg_ls in distr_args_at_all_levels.items()
      }
  
      scale_at_all_levels = F.concat(*scales_ls, dim=-1)
  
      distr_at_all_levels = distr_output.distribution(
          distr_args=distr_args_at_all_levels.values(),
          scale=scale_at_all_levels,
      )
  
      if isinstance(distr_at_all_levels, TransformedPiecewiseLinear):
          distr_at_all_levels = TransformedPiecewiseLinear(
              base_distribution=gluonts_fixes.PiecewiseLinearWithSampling(
                  gamma=distr_at_all_levels.base_distribution.gamma,
                  slopes=distr_at_all_levels.base_distribution.slopes,
                  knot_spacings=distr_at_all_levels.base_distribution.knot_spacings,
              ),
              transforms=distr_at_all_levels.transforms,
          )
  
      return distr_at_all_levels
  
imports: from typing import Dict, List, Optional, Tuple
  import mxnet
  import numpy
  from gluonts.core.component import Type, validated
  from gluonts.itertools import prod
  from gluonts.mx.model.deepar import DeepAREstimator
  from gluonts.mx.model.deepar._network import DeepARPredictionNetwork
  from gluonts.mx.model.deepvar_hierarchical._estimator import projection_mat
  from gluonts.mx.model.deepvar_hierarchical._network import coherency_error
  from gluonts.mx.distribution import Distribution, EmpiricalDistribution
  from gluonts.mx import Tensor
  from gluonts.mx.distribution import TransformedPiecewiseLinear
  from gluonts.nursery.temporal_hierarchical_forecasting.utils import utils
  from gluonts.nursery.temporal_hierarchical_forecasting.model.cop_deepar import gluonts_fixes, gnn
label_desc: Use image node_id 3 for calling the COPNetwork obj's underlying member method code with example usage: obj._embeddings_to_distr(F, embeddings_at_all_levels, scales) and returns: distr_at_all_levels