class_docstr: This class implements a regressor with the PyTorch framework.
class_docstr_tok: ["This","class","implements","a","regressor","with","the","PyTorch","framework","."]
docstr: Save a model to file in the format specific to the backend framework.
  
  :param filename: Name of the file where to store the model.
  :param path: Path of the folder where to store the model. If no path is specified, the model will be stored in
               the default data location of the library `ART_DATA_PATH`.
docstr_tok: ["Save","a","model","to","file","in","the","format","specific","to","the","backend","framework",".",":","param","filename",":","Name","of","the","file","where","to","store","the","model",".",":","param","path",":","Path","of","the","folder","where","to","store","the","model",".","If","no","path","is","specified",",","the","model","will","be","stored","in","the","default","data","location","of","the","library","`","ART_DATA_PATH","`","."]
code: def save(self, filename: str, path: Optional[str] = None) -> None:
      """
      Save a model to file in the format specific to the backend framework.
  
      :param filename: Name of the file where to store the model.
      :param path: Path of the folder where to store the model. If no path is specified, the model will be stored in
                   the default data location of the library `ART_DATA_PATH`.
      """
      import torch
  
      if path is None:
          full_path = os.path.join(config.ART_DATA_PATH, filename)
      else:
          full_path = os.path.join(path, filename)
      folder = os.path.split(full_path)[0]
      if not os.path.exists(folder):
          os.makedirs(folder)
  
      # pylint: disable=W0212
      # disable pylint because access to _modules required
      torch.save(self._model._model.state_dict(), full_path + ".model")
      torch.save(self._optimizer.state_dict(), full_path + ".optimizer")  # type: ignore
      logger.info(
          "Model state dict saved in path: %s.", full_path + ".model"
      )
      logger.info(
          "Optimizer state dict saved in path: %s.",
          full_path + ".optimizer",
      )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import copy
  import logging
  import os
  import time
  from typing import Any, Dict, List, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  import six
  from art import config
  from art.estimators.regression.regressor import RegressorMixin
  from art.estimators.pytorch import PyTorchEstimator
label_desc: Use image node_id 22 for calling the PyTorchRegressor obj's underlying member method code with example usage: obj.save(filename, path) without return types