mirror of
https://gitee.com/ascend/ModelLink.git
synced 2024-12-02 03:48:24 +08:00
8 lines
192 B
Python
8 lines
192 B
Python
import torch
|
|
import torch_npu
|
|
from torch_npu.contrib import transfer_to_npu
|
|
|
|
|
|
torch.cuda.init = torch.npu.init
|
|
torch.npu.init()
|
|
torch.cuda.default_generators = torch_npu.npu.default_generators |