Update app.py
Browse files
app.py
CHANGED
@@ -13,15 +13,15 @@ print('one device: ' + str(one.device))
|
|
13 |
two = torch.matmul(one, one).cuda()
|
14 |
print('two device: ' + str(two.device))
|
15 |
|
16 |
-
|
17 |
-
print('
|
18 |
|
19 |
@spaces.GPU
|
20 |
def greet(n):
|
21 |
print('zero device: ' + str(zero.device))
|
22 |
print('one device: ' + str(one.device))
|
23 |
print('two device: ' + str(two.device))
|
24 |
-
print('
|
25 |
return f"Hello {zero + n} Tensor"
|
26 |
|
27 |
gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text()).launch()
|
|
|
13 |
two = torch.matmul(one, one).cuda()
|
14 |
print('two device: ' + str(two.device))
|
15 |
|
16 |
+
xpu_res = torch.ones(2, 2, device='xpu')
|
17 |
+
print('xpu_res device: ' + str(xpu_res.device))
|
18 |
|
19 |
@spaces.GPU
|
20 |
def greet(n):
|
21 |
print('zero device: ' + str(zero.device))
|
22 |
print('one device: ' + str(one.device))
|
23 |
print('two device: ' + str(two.device))
|
24 |
+
print('xpu_res device: ' + str(xpu_res.device))
|
25 |
return f"Hello {zero + n} Tensor"
|
26 |
|
27 |
gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text()).launch()
|