code: def test_devices_settings(self):
      train_generator = some_data_tensor_generator(
          ModelTestMultiGPU.batch_size
      )
      valid_generator = some_data_tensor_generator(
          ModelTestMultiGPU.batch_size
      )
  
      devices = "all"
      self.model.to(devices)
      self.model.fit_generator(
          train_generator,
          valid_generator,
          epochs=ModelTestMultiGPU.epochs,
          steps_per_epoch=ModelTestMultiGPU.steps_per_epoch,
          validation_steps=ModelTestMultiGPU.steps_per_epoch,
      )
      self._test_multiple_gpu_mode(devices=devices)
  
      devices = ["cuda:0", "cuda:1"]
      self.model.to(devices)
      self.model.fit_generator(
          train_generator,
          valid_generator,
          epochs=ModelTestMultiGPU.epochs,
          steps_per_epoch=ModelTestMultiGPU.steps_per_epoch,
          validation_steps=ModelTestMultiGPU.steps_per_epoch,
      )
      self._test_multiple_gpu_mode(devices=devices)
  
      devices = [torch.device("cuda:0"), torch.device("cuda:1")]
      self.model.to(devices)
      self.model.fit_generator(
          train_generator,
          valid_generator,
          epochs=ModelTestMultiGPU.epochs,
          steps_per_epoch=ModelTestMultiGPU.steps_per_epoch,
          validation_steps=ModelTestMultiGPU.steps_per_epoch,
      )
      self._test_multiple_gpu_mode(devices=devices)
  
      devices = ["cuda:1"]
      self.model.to(devices)
      self.assertIsNone(self.model.other_device)
      self.model.fit_generator(
          train_generator,
          valid_generator,
          epochs=ModelTestMultiGPU.epochs,
          steps_per_epoch=ModelTestMultiGPU.steps_per_epoch,
          validation_steps=ModelTestMultiGPU.steps_per_epoch,
      )
      self._test_device(torch.device("cuda:1"))
      self._test_single_gpu_mode()
  
file_path: poutyne/tests/framework/model/test_multi_gpu.py
imports: import os
  from unittest import skipIf
  import torch
  from torch import nn
  from poutyne import Model
  from tests.framework.model.base import ModelFittingTestCase
  from tests.framework.tools import SomeConstantMetric, repeat_batch_metric, repeat_batch_metric_value, some_batch_metric_1, some_batch_metric_2, some_constant_metric_value, some_data_tensor_generator, some_metric_1_value, some_metric_2_value
label_desc: Use image node_id 6 for calling the ModelTestMultiGPU obj's underlying member method code with example usage: obj.test_devices_settings() without return types