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