# interlace
torch.cuda.empty_cache()
- gen0 = self._test_memory_stats_generator(self, device=0, N=35)
+ gen0 = self._test_memory_stats_generator(self, device='cuda:0', N=35)
gen1 = self._test_memory_stats_generator(self, device=torch.device('cuda:1'), N=35)
end0 = end1 = False
while not (end0 and end1):
import torch
+import torch._six
def _get_device_index(device, optional=False):
If :attr:`device` is ``None``, this will return the current default CUDA
device if :attr:`optional` is ``True``.
"""
+ if isinstance(device, torch._six.string_classes):
+ device = torch.device(device)
if isinstance(device, torch.device):
dev_type = device.type
if device.type != 'cuda':