docstr: Shuts down workers and releases resources.
docstr_tok: ["Shuts","down","workers","and","releases","resources","."]
code: def shutdown(self, force=False):
      """Shuts down workers and releases resources."""
      if not force:
          cleanup = [
              worker.shutdown.remote() for worker in self.remote_workers
          ]
          try:
              ray.get(cleanup)
              [
                  worker.__ray_terminate__.remote()
                  for worker in self.remote_workers
              ]
          except RayActorError:
              logger.warning(
                  "Failed to shutdown gracefully, forcing a shutdown."
              )
  
              for worker in self.remote_workers:
                  logger.warning("Killing worker {}.".format(worker))
                  ray.kill(worker)
      else:
          for worker in self.remote_workers:
              logger.debug("Killing worker {}.".format(worker))
              ray.kill(worker)
  
      self.remote_workers = []
  
imports: import io
  import types
  import logging
  import numbers
  import torch
  import numpy
  from zoo.orca.data.ray_xshards import RayXShards
  from zoo.orca.learn.pytorch.training_operator import TrainingOperator
  from zoo.orca.learn.pytorch.torch_runner import TorchRunner
  from zoo.orca.learn.utils import maybe_dataframe_to_xshards, dataframe_to_xshards, convert_predict_xshards_to_dataframe, update_predict_xshards, process_xshards_of_pandas_dataframe
  from zoo.ray import RayContext
  import ray
  from ray.exceptions import RayActorError
label_desc: Use image node_id 13 for calling the PyTorchRayEstimator obj's underlying member method code with example usage: obj.shutdown(force) without return types