docstr: Prevent the PyTorchTrialController from automatically moving batched data to device.
  Call this if you want to override the default behavior of moving all items of a list,
  tuple, and/or dict to the GPU. Then, you can control how data is moved to the GPU directly
  in the ``train_batch`` and ``evaluate_batch`` methods of your PyTorchTrial definition.
  You should call context.to_device on primitive data types that you do want to move to GPU
  as in the example below.
  
  .. code-block:: python
  
      # PyTorchTrial methods.
      def __init__(context): # PyTorchTrial init
          self.context.experimental.disable_auto_to_device()
          ...
  
      def train_batch(self, context, batch):
          for k, item in batch.items():
              if k == "img":
                  batch["img"] = self.context.to_device(batch["img"])
          ...
docstr_tok: ["Prevent","the","PyTorchTrialController","from","automatically","moving","batched","data","to","device",".","Call","this","if","you","want","to","override","the","default","behavior","of","moving","all","items","of","a","list",",","tuple",",","and\/or","dict","to","the","GPU",".","Then",",","you","can","control","how","data","is","moved","to","the","GPU","directly","in","the","``","train_batch","``","and","``","evaluate_batch","``","methods","of","your","PyTorchTrial","definition",".","You","should","call","context.to_device","on","primitive","data","types","that","you","do","want","to","move","to","GPU","as","in","the","example","below",".","..","code-block",":",":","python","#","PyTorchTrial","methods",".","def","__init__","(","context",")",":","#","PyTorchTrial","init","self.context.experimental.disable_auto_to_device","(",")","...","def","train_batch","(","self",",","context",",","batch",")",":","for","k",",","item","in","batch.items","(",")",":","if","k","==","``","img","''",":","batch","[","``","img","''","]","=","self.context.to_device","(","batch","[","``","img","''","]",")","..."]
code: def disable_auto_to_device(self) -> None:
      """
      Prevent the PyTorchTrialController from automatically moving batched data to device.
      Call this if you want to override the default behavior of moving all items of a list,
      tuple, and/or dict to the GPU. Then, you can control how data is moved to the GPU directly
      in the ``train_batch`` and ``evaluate_batch`` methods of your PyTorchTrial definition.
      You should call context.to_device on primitive data types that you do want to move to GPU
      as in the example below.
  
      .. code-block:: python
  
          # PyTorchTrial methods.
          def __init__(context): # PyTorchTrial init
              self.context.experimental.disable_auto_to_device()
              ...
  
          def train_batch(self, context, batch):
              for k, item in batch.items():
                  if k == "img":
                      batch["img"] = self.context.to_device(batch["img"])
              ...
      """
      self._auto_to_device = False
      logger.info("disabled automatically moving data to device")
  
imports: import logging
  from typing import Any
label_desc: Use image node_id 4 for calling the PyTorchExperimentalContext obj's underlying member method code with example usage: obj.disable_auto_to_device() without return types