code: def create_instance_splitter(self, mode: str):
      assert mode in ["training", "validation", "test"]
  
      instance_sampler = {
          "training": self.train_sampler,
          "validation": self.validation_sampler,
          "test": TestSplitSampler(),
      }[mode]
  
      ts_fields = [
          FieldName.FEAT_DYNAMIC_CAT,
          FieldName.FEAT_DYNAMIC_REAL,
      ]
      past_ts_fields = [
          FieldName.PAST_FEAT_DYNAMIC + "_cat",
          FieldName.PAST_FEAT_DYNAMIC_REAL,
      ]
  
      return TFTInstanceSplitter(
          instance_sampler=instance_sampler,
          past_length=self.context_length,
          future_length=self.prediction_length,
          time_series_fields=ts_fields,
          past_time_series_fields=past_ts_fields,
      )
  
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 3 for calling the TemporalFusionTransformerEstimator obj's underlying member method code with example usage: obj.create_instance_splitter(mode) and returns: TFTInstanceSplitter