cmendezc

NPU examples

import torch
import torch_npu
print("NPU available?", torch.npu.is_available())
print("Current device:", torch.npu.current_device())
device = torch.device("npu:0")
# x = torch.randn(2, 2).npu()
# y = torch.randn(2, 2).npu()
x = torch.randn(2, 2).to(device)
y = torch.randn(2, 2).to(device)
z = x.mm(y)
print(z)
\ No newline at end of file