code: def compute_lds(
      self,
      F,
      feat_static_cat: Tensor,
      seasonal_indicators: Tensor,
      time_feat: Tensor,
      length: int,
      prior_mean: Optional[Tensor] = None,
      prior_cov: Optional[Tensor] = None,
      lstm_begin_state: Optional[List[Tensor]] = None,
  ):
      # embed categorical features and expand along time axis
      embedded_cat = self.embedder(feat_static_cat)
      repeated_static_features = embedded_cat.expand_dims(
          axis=1
      ).repeat(axis=1, repeats=length)
  
      # construct big features tensor (context)
      features = F.concat(time_feat, repeated_static_features, dim=2)
  
      output, lstm_final_state = self.lstm.unroll(
          inputs=features,
          begin_state=lstm_begin_state,
          length=length,
          merge_outputs=True,
      )
  
      if prior_mean is None:
          prior_input = F.slice_axis(
              output, axis=1, begin=0, end=1
          ).squeeze(axis=1)
  
          prior_mean = self.prior_mean_model(prior_input)
          prior_cov_diag = (
              self.prior_cov_diag_model(prior_input)
              * (
                  self.prior_cov_bounds.upper
                  - self.prior_cov_bounds.lower
              )
              + self.prior_cov_bounds.lower
          )
          prior_cov = make_nd_diag(
              F, prior_cov_diag, self.issm.latent_dim()
          )
  
      (
          emission_coeff,
          transition_coeff,
          innovation_coeff,
      ) = self.issm.get_issm_coeff(seasonal_indicators)
  
      noise_std, innovation, residuals = self.lds_proj(output)
  
      lds = LDS(
          emission_coeff=emission_coeff,
          transition_coeff=transition_coeff,
          innovation_coeff=F.broadcast_mul(
              innovation, innovation_coeff
          ),
          noise_std=noise_std,
          residuals=residuals,
          prior_mean=prior_mean,
          prior_cov=prior_cov,
          latent_dim=self.issm.latent_dim(),
          output_dim=self.issm.output_dim(),
          seq_length=length,
      )
  
      return lds, lstm_final_state
  
imports: from typing import List, Optional
  import mxnet
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from gluonts.mx.block.feature import FeatureEmbedder
  from gluonts.mx.block.scaler import MeanScaler, NOPScaler
  from gluonts.mx.distribution.lds import LDS, LDSArgsProj, ParameterBounds
  from gluonts.mx.util import make_nd_diag, weighted_average
  from .issm import ISSM
label_desc: Use image node_id 2 for calling the DeepStateNetwork obj's underlying member method code with example usage: obj.compute_lds(F, feat_static_cat, seasonal_indicators, time_feat, length, prior_mean, prior_cov, lstm_begin_state) and returns: lds,  lstm_final_state