code: def create_training_network(
      self, device: torch.device
  ) -> TemporalFusionTransformerTrainingNetwork:
      network = TemporalFusionTransformerTrainingNetwork(
          context_length=self.context_length,
          prediction_length=self.prediction_length,
          variable_dim=self.variable_dim,
          embed_dim=self.embed_dim,
          num_heads=self.num_heads,
          num_outputs=self.num_outputs,
          dropout=self.dropout_rate,
          d_past_feat_dynamic_real=_default_feat_args(
              list(self.past_dynamic_feature_dims.values())
          ),
          c_past_feat_dynamic_cat=_default_feat_args(
              list(self.past_dynamic_cardinalities.values())
          ),
          # +1 is for Age Feature
          d_feat_dynamic_real=_default_feat_args(
              [1] * (len(self.time_features) + 1)
              + list(self.dynamic_feature_dims.values())
          ),
          c_feat_dynamic_cat=_default_feat_args(
              list(self.dynamic_cardinalities.values())
          ),
          d_feat_static_real=_default_feat_args(
              list(self.static_feature_dims.values()),
          ),
          c_feat_static_cat=_default_feat_args(
              list(self.static_cardinalities.values()),
          ),
      )
      return network.to(device)
  
imports: from itertools import chain
  from typing import List, Optional, Dict
  import numpy
  import torch
  from gluonts.core.component import validated
  from gluonts.dataset.field_names import FieldName
  from gluonts.model.forecast_generator import QuantileForecastGenerator
  from gluonts.model.predictor import Predictor
  from gluonts.time_feature import TimeFeature, time_features_from_frequency_str
  from gluonts.torch.model.predictor import PyTorchPredictor
  from gluonts.torch.util import copy_parameters
  from gluonts.transform import Transformation, Chain, ValidationSplitSampler, TestSplitSampler, ExpectedNumInstanceSampler, AddAgeFeature, AsNumpyArray, AddObservedValuesIndicator, AddTimeFeatures, VstackFeatures, SetField
  from pts import Trainer
  from pts.model import PyTorchEstimator
  from pts.model.utils import get_module_forward_input_names
  from .tft_network import TemporalFusionTransformerPredictionNetwork, TemporalFusionTransformerTrainingNetwork
  from .tft_transform import BroadcastTo, TFTInstanceSplitter
label_desc: Use image node_id 4 for calling the TemporalFusionTransformerEstimator obj's underlying member method code with example usage: obj.create_training_network(device) and returns: network