demo 1
Browse files
app.py
CHANGED
@@ -17,10 +17,7 @@ RandomTensor.to(device)
|
|
17 |
|
18 |
def sysinfo(newdev = device):
|
19 |
currentDevice = RandomTensor.get_device();
|
20 |
-
tensorExample = RandomTensor.to(newdev)
|
21 |
-
.norm(p=2, dim=1, keepdim=True) # Apply an operation similar to l2_norm
|
22 |
-
.unsqueeze(-1) # Add an extra dimension
|
23 |
-
.to(newdev)
|
24 |
|
25 |
tocpu = tensorExample.cpu().squeeze().half().tolist()
|
26 |
|
|
|
17 |
|
18 |
def sysinfo(newdev = device):
|
19 |
currentDevice = RandomTensor.get_device();
|
20 |
+
tensorExample = RandomTensor.to(newdev).norm(p=2, dim=1, keepdim=True).unsqueeze(-1).to(newdev)
|
|
|
|
|
|
|
21 |
|
22 |
tocpu = tensorExample.cpu().squeeze().half().tolist()
|
23 |
|