class_docstr: Example:
      >>> # 1. Initialize Forecaster directly
      >>> forecaster = NBeatForecaster(paste_seq_len=10,
                                       future_seq_len=1,
                                       stack_types=("generic", "generic"),
                                       ...)
      >>>
      >>> # 2. The from_tsdataset method can also initialize a NBeatForecaster.
      >>> forecaster.from_tsdataset(tsdata, **kwargs)
      >>> forecaster.fit(tsdata)
      >>> forecaster.to_local() # if you set distributed=True
docstr: Build a NBeats Forecaster Model.
  
  :param tsdataset: Train tsdataset, a bigdl.chronos.data.tsdataset.TSDataset instance.
  :param past_seq_len: Specify the history time steps (i.e. lookback).
         Do not specify the 'past_seq_len' if your tsdataset has called
         the 'TSDataset.roll' method or 'TSDataset.to_torch_data_loader'.
  :param future_seq_len: Specify the output time steps (i.e. horizon).
         Do not specify the 'future_seq_len' if your tsdataset has called
         the 'TSDataset.roll' method or 'TSDataset.to_torch_data_loader'.
  :param kwargs: Specify parameters of Forecaster,
         e.g. loss and optimizer, etc. More info,
         please refer to NBeatsForecaster.__init__ methods.
  
  :return: A NBeats Forecaster Model.
docstr_tok: ["Build","a","NBeats","Forecaster","Model",".",":","param","tsdataset",":","Train","tsdataset",",","a","bigdl.chronos.data.tsdataset.TSDataset","instance",".",":","param","past_seq_len",":","Specify","the","history","time","steps","(","i.e",".","lookback",")",".","Do","not","specify","the","'past_seq_len","'","if","your","tsdataset","has","called","the","'TSDataset.roll","'","method","or","'TSDataset.to_torch_data_loader","'",".",":","param","future_seq_len",":","Specify","the","output","time","steps","(","i.e",".","horizon",")",".","Do","not","specify","the","'future_seq_len","'","if","your","tsdataset","has","called","the","'TSDataset.roll","'","method","or","'TSDataset.to_torch_data_loader","'",".",":","param","kwargs",":","Specify","parameters","of","Forecaster",",","e.g",".","loss","and","optimizer",",","etc",".","More","info",",","please","refer","to","NBeatsForecaster.__init__","methods",".",":","return",":","A","NBeats","Forecaster","Model","."]
code: def from_tsdataset(
      cls, tsdataset, past_seq_len=None, future_seq_len=None, **kwargs
  ):
      """
      Build a NBeats Forecaster Model.
  
      :param tsdataset: Train tsdataset, a bigdl.chronos.data.tsdataset.TSDataset instance.
      :param past_seq_len: Specify the history time steps (i.e. lookback).
             Do not specify the 'past_seq_len' if your tsdataset has called
             the 'TSDataset.roll' method or 'TSDataset.to_torch_data_loader'.
      :param future_seq_len: Specify the output time steps (i.e. horizon).
             Do not specify the 'future_seq_len' if your tsdataset has called
             the 'TSDataset.roll' method or 'TSDataset.to_torch_data_loader'.
      :param kwargs: Specify parameters of Forecaster,
             e.g. loss and optimizer, etc. More info,
             please refer to NBeatsForecaster.__init__ methods.
  
      :return: A NBeats Forecaster Model.
      """
      from bigdl.chronos.data.tsdataset import TSDataset
      from bigdl.nano.utils.common import invalidInputError
  
      invalidInputError(
          isinstance(tsdataset, TSDataset),
          f"We only supports input a TSDataset, but get{type(tsdataset)}.",
      )
  
      def check_time_steps(tsdataset, past_seq_len, future_seq_len):
          if (
              tsdataset.lookback is not None
              and past_seq_len is not None
          ):
              future_seq_len = (
                  future_seq_len
                  if isinstance(future_seq_len, int)
                  else max(future_seq_len)
              )
              return (
                  tsdataset.lookback == past_seq_len
                  and tsdataset.horizon == future_seq_len
              )
          return True
  
      invalidInputError(
          not tsdataset._has_generate_agg_feature,
          "We will add support for 'gen_rolling_feature' method later.",
      )
  
      if (
          tsdataset.lookback is not None
      ):  # calling roll or to_torch_data_loader
          past_seq_len = tsdataset.lookback
          future_seq_len = (
              tsdataset.horizon
              if isinstance(tsdataset.horizon, int)
              else max(tsdataset.horizon)
          )
      elif (
          past_seq_len is not None and future_seq_len is not None
      ):  # initialize only
          past_seq_len = (
              past_seq_len
              if isinstance(past_seq_len, int)
              else tsdataset.get_cycle_length()
          )
          future_seq_len = (
              future_seq_len
              if isinstance(future_seq_len, int)
              else max(future_seq_len)
          )
      else:
          invalidInputError(
              False,
              "Forecaster requires 'past_seq_len' and 'future_seq_len' to specify "
              "the history time step and output time step.",
          )
  
      invalidInputError(
          check_time_steps(tsdataset, past_seq_len, future_seq_len),
          "tsdataset already has historical time steps and "
          "differs from the given past_seq_len and future_seq_len "
          "Expected past_seq_len and future_seq_len to be "
          f"{tsdataset.lookback, tsdataset.horizon}, "
          f"but found {past_seq_len, future_seq_len}",
          fixMsg="Do not specify past_seq_len and future seq_len "
          "or call tsdataset.roll method again and specify time step",
      )
  
      invalidInputError(
          not all(
              [tsdataset.id_sensitive, len(tsdataset._id_list) > 1]
          ),
          "NBeats only supports univariate forecasting.",
      )
  
      return cls(
          past_seq_len=past_seq_len,
          future_seq_len=future_seq_len,
          **kwargs,
      )
  
imports: import torch
  from bigdl.chronos.forecaster.base_forecaster import BasePytorchForecaster
  from bigdl.chronos.model.nbeats_pytorch import model_creator, loss_creator, optimizer_creator
label_desc: Use image node_id 2 for calling the NBeatsForecaster obj's underlying member method code with example usage: obj.from_tsdataset(cls, tsdataset, past_seq_len, future_seq_len) and returns: cls, True, unknown