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: Obtain context manager from forecaster.
  
  :param thread_num: int, the num of thread limit. The value is set to None by
         default where no limit is set.
  :param optimize: bool variable indicates whether use original model.
         Default to True means use accelerated_model to generate context manager, which
         requires to call .optimize(), otherwise the original model will be used.
  :return: a context manager.
code: def get_context(self, thread_num=None, optimize=True):
      """
      Obtain context manager from forecaster.
  
      :param thread_num: int, the num of thread limit. The value is set to None by
             default where no limit is set.
      :param optimize: bool variable indicates whether use original model.
             Default to True means use accelerated_model to generate context manager, which
             requires to call .optimize(), otherwise the original model will be used.
      :return: a context manager.
      """
      return ForecasterContextManager(self, thread_num, optimize)
  
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 7 for calling the BasePytorchForecaster obj's underlying member method code with example usage: obj.get_context(thread_num, optimize) and returns: ForecasterContextManager