File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 6
6
7
7
Ask yourself the following:
8
8
* Are you using ` matplotlib.pyplot ` to plot pytorch tensors?
9
- * Do you forget to call ` .cpu().detach().numpy() ` everytime you want to plot a tensor
9
+ * Do you forget to call ` .cpu().detach().numpy() ` everytime you want to plot a tensor?
10
10
11
11
Then ` torchplot ` may be something for you. ` torchplot ` is a simple drop-in replacement
12
12
for plotting pytorch tensors. We simply override every ` matplotlib.pyplot ` function such
@@ -16,25 +16,25 @@ Simply just change your default `matplotlib` import statement:
16
16
17
17
18
18
Instead of
19
- ```
19
+ ``` python
20
20
from matplotlib.pyplot import *
21
21
```
22
22
use
23
- ```
23
+ ``` python
24
24
from torchplot import *
25
25
```
26
26
and instead of
27
- ```
27
+ ``` python
28
28
import matplotlib.pyplot as plt
29
29
```
30
30
use
31
- ```
31
+ ``` python
32
32
import torchplot as plt
33
33
```
34
34
Herafter, then you can remove every ` .cpu().detach().numpy() ` (or variations heroff) from
35
35
your code and everything should just work. If you do not want to mix implementations,
36
36
we recommend importing ` torchplot ` as seperaly package:
37
- ```
37
+ ``` python
38
38
import torchplot as tp
39
39
```
40
40
You can’t perform that action at this time.
0 commit comments