File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 66
77Ask yourself the following:
88* 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?
1010
1111Then ` torchplot ` may be something for you. ` torchplot ` is a simple drop-in replacement
1212for plotting pytorch tensors. We simply override every ` matplotlib.pyplot ` function such
@@ -16,25 +16,25 @@ Simply just change your default `matplotlib` import statement:
1616
1717
1818Instead of
19- ```
19+ ``` python
2020from matplotlib.pyplot import *
2121```
2222use
23- ```
23+ ``` python
2424from torchplot import *
2525```
2626and instead of
27- ```
27+ ``` python
2828import matplotlib.pyplot as plt
2929```
3030use
31- ```
31+ ``` python
3232import torchplot as plt
3333```
3434Herafter, then you can remove every ` .cpu().detach().numpy() ` (or variations heroff) from
3535your code and everything should just work. If you do not want to mix implementations,
3636we recommend importing ` torchplot ` as seperaly package:
37- ```
37+ ``` python
3838import torchplot as tp
3939```
4040
You can’t perform that action at this time.
0 commit comments