incosistent behaviour on ptpython
Freed-Wu opened this issue · comments
wzy commented
Describe the bug
from torchvision.models import resnet18
from torchinfo import summary
model = resnet18()
a = summary(model, (1, 3, 256, 256))
In python
, ipython
, this code will not output anything, however, in ptpython, it will output a
.
Expected behavior
in any REPL of python, it shouldn't output.
ptpython: 3.0.21
python: 3.10.9
torchinfo: 1.7.1
Additional context
Add any other context about the problem here.
wzy commented
Oh, it looks related to sys.ps1
.
wzy commented
This code use sys.ps1
to detect if it is a REPL, however, python and ipython assign sys.ps1
while ptpython not.