code: def test_forecaster_from_tsdataset(self):
      train, test = create_tsdataset()
      nbeats = NBeatsForecaster.from_tsdataset(
          train,
          stack_types=("generic", "seasnoality"),
          share_weights_in_stack=True,
          hidden_layer_units=32,
      )
      nbeats.fit(train, epochs=2, batch_size=32)
      yhat = nbeats.predict(test, batch_size=32, acceleration=False)
      test.roll(
          lookback=nbeats.data_config["past_seq_len"],
          horizon=nbeats.data_config["future_seq_len"],
      )
      _, y_test = test.to_numpy()
      assert yhat.shape == y_test.shape
  
      del nbeats
      train, test = create_tsdataset(roll=False, horizon=[1, 3, 5])
      nbeats = NBeatsForecaster.from_tsdataset(
          train,
          past_seq_len=24,
          future_seq_len=2,
          stack_types=("generic", "seasnoality"),
          share_weights_in_stack=True,
          hidden_layer_units=32,
      )
      nbeats.fit(train, epochs=2, batch_size=32)
      yhat = nbeats.predict(test, batch_size=None, acceleration=False)
      test.roll(
          lookback=nbeats.data_config["past_seq_len"],
          horizon=nbeats.data_config["future_seq_len"],
      )
      _, y_test = test.to_numpy()
      assert yhat.shape == y_test.shape
  
imports: import os
  import tempfile
  import numpy
  from unittest import TestCase
  import pytest
  from bigdl.chronos.utils import LazyImport
  from ..None import op_torch, op_distributed, op_inference, op_automl
label_desc: Use image node_id 20 for calling the TestChronosNBeatsForecaster obj's underlying member method code with example usage: obj.test_forecaster_from_tsdataset() without return types