class_docstr: Base container for TVM models.
  The container allows to mirror the Sklearn API.
  The test input size must be the same as the batch size this container is created.
docstr: Method used to save the container for future use.
  
  Args:
      location: The location on the file system where to save the model.
docstr_tok: ["Method","used","to","save","the","container","for","future","use",".","Args",":","location",":","The","location","on","the","file","system","where","to","save","the","model","."]
code: def save(self, location):
      """
      Method used to save the container for future use.
  
      Args:
          location: The location on the file system where to save the model.
      """
      assert self.model is not None, "Saving a None model is undefined."
      import hmac
      import hashlib
  
      if location.endswith("zip"):
          location = location[:-4]
      assert not os.path.exists(
          location
      ), "Directory {} already exists.".format(location)
      os.makedirs(location)
  
      # Save the model type.
      with open(
          os.path.join(location, constants.SAVE_LOAD_MODEL_TYPE_PATH),
          "w",
      ) as file:
          file.write("tvm")
  
      # Save the module versions.
      versions = dump_versions(hummingbird, torch, tvm)
      with open(
          os.path.join(
              location, constants.SAVE_LOAD_MODEL_CONFIGURATION_PATH
          ),
          "w",
      ) as file:
          file.writelines(versions)
  
      # Save the actual model.
      path_lib = os.path.join(
          location, constants.SAVE_LOAD_TVM_LIB_PATH
      )
      self._extra_config[constants.TVM_LIB].export_library(path_lib)
      with open(
          os.path.join(location, constants.SAVE_LOAD_TVM_GRAPH_PATH),
          "w",
      ) as file:
          file.write(self._extra_config[constants.TVM_GRAPH])
      with open(
          os.path.join(location, constants.SAVE_LOAD_TVM_PARAMS_PATH),
          "wb",
      ) as file:
          file.write(
              tvm.relay.save_param_dict(
                  self._extra_config[constants.TVM_PARAMS]
              )
          )
  
      # Remove all information that cannot be pickled.
      if constants.TEST_INPUT in self._extra_config:
          self._extra_config[constants.TEST_INPUT] = None
      input_tensors = self._tvm_tensors
      lib = self._extra_config[constants.TVM_LIB]
      graph = self._extra_config[constants.TVM_GRAPH]
      params = self._extra_config[constants.TVM_PARAMS]
      ctx = self._extra_config[constants.TVM_CONTEXT]
      model = self._model
      self._tvm_tensors = None
      self._extra_config[constants.TVM_LIB] = None
      self._extra_config[constants.TVM_GRAPH] = None
      self._extra_config[constants.TVM_PARAMS] = None
      self._extra_config[constants.TVM_CONTEXT] = None
      self._ctx = "cpu" if self._ctx.device_type == 1 else "cuda"
      self._model = None
  
      # Save the container.
      with open(
          os.path.join(location, constants.SAVE_LOAD_CONTAINER_PATH),
          "wb",
      ) as file:
          dill.dump(self, file)
  
      # Zip the dir.
      shutil.make_archive(location, "zip", location)
  
      with open(location + ".zip", "rb") as file:
          digest = hmac.new(
              b"shared-key", file.read(), hashlib.sha1
          ).hexdigest()
          print("Model saved with digest: {}".format(digest))
  
      # Remove the directory.
      shutil.rmtree(location)
  
      # Restore the information
      self._tvm_tensors = input_tensors
      self._extra_config[constants.TVM_LIB] = lib
      self._extra_config[constants.TVM_GRAPH] = graph
      self._extra_config[constants.TVM_PARAMS] = params
      self._extra_config[constants.TVM_CONTEXT] = ctx
      self._ctx = ctx
      self._model = model
      return digest
  
imports: import dill
  import os
  import numpy
  import shutil
  import torch
  import warnings
  import hummingbird
  from hummingbird.ml._utils import tvm_installed, dump_versions, check_dumped_versions
  from hummingbird.ml.operator_converters import constants
  from hummingbird.ml.containers._sklearn_api_containers import SklearnContainer, SklearnContainerTransformer, SklearnContainerRegression, SklearnContainerClassification, SklearnContainerAnomalyDetection
label_desc: Use image node_id 2 for calling the TVMSklearnContainer obj's underlying member method code with example usage: obj.save(location) and returns: digest