(cls, *args)
| 238 | def get_new_tensor_fn_for_dtype(dtype: torch.dtype) -> Callable: |
| 239 | |
| 240 | def new_tensor(cls, *args) -> Tensor: |
| 241 | device = torch.device(get_accelerator().device_name(os.environ["LOCAL_RANK"])) |
| 242 | tensor = _orig_torch_empty(0, device=device).new_empty(*args) |
| 243 | if tensor.is_floating_point(): |
| 244 | tensor = tensor.to(dtype) |
| 245 | |
| 246 | return tensor |
| 247 | |
| 248 | return new_tensor |
| 249 |
nothing calls this directly
no test coverage detected