class_docstr: This task abstraction separates the concerns into three main components,
  `pytext.data.Data`, `pytext.models.new_model.NewModel` (names and paths
  will change as these become the primary abstractions), and `pytext.trainers.Trainer`
  
  At its simplest, this abstraction is as follows:
  - `Task` defines a `DataSchema` which describes the python types which are
  accessible in each row of the input data. This should be a common data schema
  which describes a single NLP task, each of which has the same or sufficiently
  similar inputs/outputs (think document classification, optionally including
  dense features).
  - `Model` defines an input signature (called `tensorizers`) which describes the
  tensors that it wants to execute each batch for training or prediction.
  - `Data` takes the `DataSchema` and `tensorizers` and exposes `train`, `test`, and
  `eval` attributes. Iterating over these attributes yields a batch, which is a
  dictionary with the same keys as the `tensorizers` input signature, and whose
  values are tensors.
  - `Model` can train or predict using these input batch dictionaries directly,
  and interally is responsible for defining how to arrange the tensors for passing
  to its forward functions and loss generation. Its train_batch function returns
  a tuple of `(loss, metrics)`, where `loss` is a `torch.loss.Loss` instance, and
  `metrics` can be passed directly into a compatible metric reporter.
  - `Trainer` contains the core training logic, iterating through batches created by
  `Data`, passing them to `Model` for training, aggregating and reporting metrics,
  running `loss.backward()` and `optimizer.step()`, and managing the scheduler.
code: def _init_model(cls, model_config, tensorizers, model_state=None):
      model_config.init_from_saved_state = model_state is not None
      model = create_component(
          ComponentType.MODEL, model_config, tensorizers=tensorizers
      )
      if model_state:
          print("Loading model from model state dict...")
          model.load_state_dict(model_state)
          print("Loaded!")
  
      if cuda.CUDA_ENABLED:
          model = model.cuda()
  
      return model
  
imports: from typing import Any, Dict, Optional, Type, Union
  import torch
  from accelerators.pytorch.lib.accelerator_lowering import lower_modules_to_accelerator, lower_split_model_to_accelerator
  from accelerators.pytorch.lib.export_helper import AccelerateOptions
  from accelerators.pytorch.lib.model_rewriter import find_module_instances, MODULE_TO_REWRITER, rewrite_nnpi_modules, swap_modules
  from accelerators.pytorch.lib.quantize import quantize_fx, quantize_statically
  from pytext.common.constants import Stage
  from pytext.config import ConfigBase, ExportConfig, PyTextConfig
  from pytext.config.component import ComponentType, create_component, create_trainer
  from pytext.data.data import Data
  from pytext.data.sources.data_source import Schema
  from pytext.data.tensorizers import Tensorizer
  from pytext.metric_reporters import MetricReporter
  from pytext.models.model import BaseModel
  from pytext.models.representations.bilstm import BiLSTM
  from pytext.models.roberta import RoBERTaEncoder
  from pytext.trainers import TaskTrainer, TrainingState
  from pytext.utils import cuda, onnx, precision
  from pytext.utils.file_io import PathManager
  from pytext.utils.usage import log_accelerator_feature_usage, log_class_usage, log_feature_usage
  from torch import sort
  from .task import TaskBase
label_desc: Use image node_id 4 for calling the _NewTask obj's underlying member method code with example usage: obj._init_model(cls, model_config, tensorizers, model_state) and returns: model