class_docstr: Parameters
  ----------
  context_length
      Number of time steps prior to prediction time that the model
      takes as inputs.
  prediction_length
      Length of the prediction horizon.
  num_feat_dynamic_proj
      Output size of feature projection layer.
  num_feat_dynamic_real
      Number of dynamic real features in the data.
  num_feat_static_real
      Number of static real features in the data.
  num_feat_static_cat
      Number of static categorical features in the data.
  cardinality
      Number of values of each categorical feature.
      This must be set if ``num_feat_static_cat > 0``.
  embedding_dimension
      Dimension of the embeddings for categorical features.
  feat_proj_hidden_dim
      Size of the feature projection layer.
  encoder_hidden_dim
      Size of the dense encoder layer.
  decoder_hidden_dim
      Size of the dense decoder layer.
  temporal_hidden_dim
      Size of the temporal decoder layer.
  distr_hidden_dim
      Size of the distribution projection layer.
  decoder_output_dim
      Output size of dense decoder.
  dropout_rate
      Dropout regularization parameter.
  num_layers_encoder
      Number of layers in dense encoder.
  num_layers_decoder
      Number of layers in dense decoder.
  layer_norm
      Enable layer normalization or not.
  distr_output
      Distribution to use to evaluate observations and sample predictions.
  scaling
      Which scaling method to use to scale the target values.
class_docstr_tok: ["Parameters","--","--","--","--","--","context_length","Number","of","time","steps","prior","to","prediction","time","that","the","model","takes","as","inputs",".","prediction_length","Length","of","the","prediction","horizon",".","num_feat_dynamic_proj","Output","size","of","feature","projection","layer",".","num_feat_dynamic_real","Number","of","dynamic","real","features","in","the","data",".","num_feat_static_real","Number","of","static","real","features","in","the","data",".","num_feat_static_cat","Number","of","static","categorical","features","in","the","data",".","cardinality","Number","of","values","of","each","categorical","feature",".","This","must","be","set","if","``","num_feat_static_cat",">","0","``",".","embedding_dimension","Dimension","of","the","embeddings","for","categorical","features",".","feat_proj_hidden_dim","Size","of","the","feature","projection","layer",".","encoder_hidden_dim","Size","of","the","dense","encoder","layer",".","decoder_hidden_dim","Size","of","the","dense","decoder","layer",".","temporal_hidden_dim","Size","of","the","temporal","decoder","layer",".","distr_hidden_dim","Size","of","the","distribution","projection","layer",".","decoder_output_dim","Output","size","of","dense","decoder",".","dropout_rate","Dropout","regularization","parameter",".","num_layers_encoder","Number","of","layers","in","dense","encoder",".","num_layers_decoder","Number","of","layers","in","dense","decoder",".","layer_norm","Enable","layer","normalization","or","not",".","distr_output","Distribution","to","use","to","evaluate","observations","and","sample","predictions",".","scaling","Which","scaling","method","to","use","to","scale","the","target","values","."]
code: def loss(
      self,
      feat_static_real: torch.Tensor,
      feat_static_cat: torch.Tensor,
      past_time_feat: torch.Tensor,
      past_target: torch.Tensor,
      past_observed_values: torch.Tensor,
      future_time_feat: torch.Tensor,
      future_target: torch.Tensor,
      future_observed_values: torch.Tensor,
  ):
      distr_args, loc, scale = self(
          feat_static_real=feat_static_real,
          feat_static_cat=feat_static_cat,
          past_time_feat=past_time_feat,
          past_target=past_target,
          past_observed_values=past_observed_values,
          future_time_feat=future_time_feat,
      )
      loss = self.distr_output.loss(
          target=future_target,
          distr_args=distr_args,
          loc=loc,
          scale=scale,
      )
      return weighted_average(
          loss, weights=future_observed_values, dim=-1
      )
  
imports: from typing import List, Tuple
  import torch
  from torch import nn
  from gluonts.core.component import validated
  from gluonts.torch.modules.feature import FeatureEmbedder
  from gluonts.model import Input, InputSpec
  from gluonts.torch.distributions import DistributionOutput
  from gluonts.torch.scaler import StdScaler, MeanScaler, NOPScaler
  from gluonts.torch.model.simple_feedforward import make_linear_layer
  from gluonts.torch.util import weighted_average
label_desc: Use image node_id 4 for calling the TiDEModel obj's underlying member method code with example usage: obj.loss(feat_static_real, feat_static_cat, past_time_feat, past_target, past_observed_values, future_time_feat, future_target, future_observed_values) and returns: weighted_average