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

for item in dir(obj): print(item, end = " ") spamming console. Move to dev branch only if needed, #5

Open
Gerschel opened this issue Jan 6, 2024 · 0 comments

Comments

@Gerschel
Copy link

Gerschel commented Jan 6, 2024

我们可以摆脱:
“对于 dir(obj) 中的项目:
打印(项目...)”

它正在向我的控制台发送垃圾邮件。

We can get rid of:
"For items in dir(obj):
Print (item...)"
?
It's spamming my console.

for item in dir(obj):

至少删除对 print type int 和 print type torch.sensor 的调用

At least remove the calls to print type int, and print type torch.sensor

Dirty workaround:

    def print_object_info(self, obj):
        if (type(obj) == Tensor) or (type(obj) == int):
            return None
        print("Type:", type(obj))
        print("Attributes and methods:", end=" ")
        for item in dir(obj):
            print(item, end=" ")

但我会考虑删除那些在回调中使其发生的内容。

最好在主分支中删除它们,并仅在 dev 分支中使用它们:

self.print_object_info(步骤)
self.print_object_info(x0)
self.print_object_info(x)
self.print_object_info(total_steps)

But I would look into removing the ones that make it happen in the callback.

It might be better to delete these in the main, and use them in dev branch only:

self.print_object_info(step)
self.print_object_info(x0)
self.print_object_info(x)
self.print_object_info(total_steps)

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