class_docstr: Forecaster base model for lstm, seq2seq, tcn and nbeats forecasters.
class_docstr_tok: ["Forecaster","base","model","for","lstm",",","seq2seq",",","tcn","and","nbeats","forecasters","."]
docstr: Transform a distributed forecaster to a local (non-distributed) one.
  
  Common practice is to use distributed training (fit) and predict/
  evaluate with onnx or other frameworks on a single node. To do so,
  you need to call .to_local() and transform the forecaster to a non-
  distributed one.
  
  The optimizer is refreshed, incremental training after to_local
  might have some problem.
  
  :return: a forecaster instance.
code: def to_local(self):
      """
      Transform a distributed forecaster to a local (non-distributed) one.
  
      Common practice is to use distributed training (fit) and predict/
      evaluate with onnx or other frameworks on a single node. To do so,
      you need to call .to_local() and transform the forecaster to a non-
      distributed one.
  
      The optimizer is refreshed, incremental training after to_local
      might have some problem.
  
      :return: a forecaster instance.
      """
      from bigdl.chronos.pytorch import TSTrainer as Trainer
  
      # TODO: optimizer is refreshed, which is not reasonable
      if not self.distributed:
          invalidInputError(False, "The forecaster has become local.")
      model = self.internal.get_model()
      self.internal.shutdown()
  
      loss = self.loss_creator(self.loss_config)
      optimizer = self.optimizer_creator(model, self.optim_config)
      self.internal = Trainer.compile(
          model=model, loss=loss, optimizer=optimizer
      )
      # This trainer is only for saving, once the user call `fit`, it will be
      # replaced according to the new training config
      self.trainer = Trainer(
          logger=False,
          max_epochs=1,
          enable_checkpointing=self.checkpoint_callback,
          num_processes=self.num_processes,
          use_ipex=self.use_ipex,
      )
  
      self.distributed = False
      self.fitted = True
  
      # placeholder for accelerated model obtained from various accelerators
      self.accelerated_model = None
      # str indicates current accelerate method
      self.accelerate_method = None
      self.cxt_manager = DummyForecasterContextManager()
      self.context_enabled = False
      return self
  
imports: from bigdl.chronos.forecaster.abstract import Forecaster
  from bigdl.chronos.forecaster.utils import *
  from bigdl.chronos.metric.forecast_metrics import Evaluator
  from typing import Optional
  import numpy
  import warnings
  import os
  from tempfile import TemporaryDirectory
  import torch
  from torch.utils.data import TensorDataset, DataLoader
  from .utils_hpo import GenericLightningModule, _format_metric_str, _config_has_search_space
  from bigdl.nano.utils.common import invalidOperationError, invalidInputError
  from bigdl.chronos.data.tsdataset import TSDataset
  from bigdl.chronos.pytorch.context_manager import DummyForecasterContextManager, ForecasterContextManager
  from bigdl.chronos.pytorch.utils import _pytorch_fashion_inference
label_desc: Use image node_id 17 for calling the BasePytorchForecaster obj's underlying member method code with example usage: obj.to_local() and returns: self