Update README.md
Browse files
README.md
CHANGED
@@ -19,11 +19,6 @@ For example, the file in `gpt2-medium/wikipedia/6_9.pickle` contains the matrix
|
|
19 |
import pickle
|
20 |
import torch
|
21 |
|
22 |
-
|
23 |
-
def mul(mat, v):
|
24 |
-
return (mat @ v[..., None]).squeeze(-1)
|
25 |
-
|
26 |
-
|
27 |
with open(file_name, 'rb') as f:
|
28 |
mat = pickle.load(f)
|
29 |
|
@@ -33,7 +28,7 @@ assert(mat.shape[0] == mat.shape[1])
|
|
33 |
|
34 |
v = torch.rand(mat.shape[1])
|
35 |
|
36 |
-
w =
|
37 |
|
38 |
assert(w.shape == v.shape)
|
39 |
```
|
|
|
19 |
import pickle
|
20 |
import torch
|
21 |
|
|
|
|
|
|
|
|
|
|
|
22 |
with open(file_name, 'rb') as f:
|
23 |
mat = pickle.load(f)
|
24 |
|
|
|
28 |
|
29 |
v = torch.rand(mat.shape[1])
|
30 |
|
31 |
+
w = mat @ v
|
32 |
|
33 |
assert(w.shape == v.shape)
|
34 |
```
|