Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incosistent behaviour on ptpython #216

Closed
Freed-Wu opened this issue Jan 23, 2023 · 2 comments
Closed

incosistent behaviour on ptpython #216

Freed-Wu opened this issue Jan 23, 2023 · 2 comments

Comments

@Freed-Wu
Copy link

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.

Screenshots
screen-2023-01-24-02-21-25

ptpython: 3.0.21
python: 3.10.9
torchinfo: 1.7.1

Additional context
Add any other context about the problem here.

@Freed-Wu
Copy link
Author

Oh, it looks related to sys.ps1.

@Freed-Wu
Copy link
Author

This code use sys.ps1 to detect if it is a REPL, however, python and ipython assign sys.ps1 while ptpython not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant