class_docstr: Lazily serves copies of a tensor to requested devices.  Copies are cached per-device.
class_docstr_tok: ["Lazily","serves","copies","of","a","tensor","to","requested","devices",".","Copies","are","cached","per-device","."]
code: def __init__(self, master_tensor: torch.Tensor) -> None:
      assert master_tensor.is_cuda
      self.master = master_tensor
      self._per_device_tensors: Dict[torch.device, torch.Tensor] = {}
  
file_path: insightface/recognition/vpl/utils/utils_amp.py
imports: from typing import Dict, List
  import torch
  from torch._six import container_abcs
  from torch.cuda.amp import GradScaler
label_desc: Use image node_id 1 to create a new _MultiDeviceReplicator object from inherited base classes: object with example: obj = _MultiDeviceReplicator(master_tensor)