code: def test_nbeats_forecaster_tune(self):
      import bigdl.nano.automl.hpo.space as space
  
      train_data, val_data, _ = create_data(loader=False)
      forecaster = NBeatsForecaster(
          past_seq_len=24,
          future_seq_len=5,
          loss="mae",
          metrics=["mae", "mse", "mape"],
          lr=space.Real(0.001, 0.01, log=True),
      )
      forecaster.tune(
          train_data,
          validation_data=val_data,
          n_trials=2,
          target_metric="mse",
          direction="minimize",
      )
      train_data = (train_data[0] * 10000.0, train_data[1] * 10000.0)
      forecaster.fit(train_data, epochs=2)
      train_loss = forecaster.trainer.callback_metrics["train/loss"]
      assert train_loss > 10
  
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 34 for calling the TestChronosNBeatsForecaster obj's underlying member method code with example usage: obj.test_nbeats_forecaster_tune() without return types