-
Notifications
You must be signed in to change notification settings - Fork 34
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
document for utils #14
document for utils #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
ablator/utils/base.py
Outdated
Returns | ||
------- | ||
list[Path] | ||
A list of the latest checkpoint files sorted by their creation time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorted by filename, no time
ablator/utils/base.py
Outdated
@@ -25,6 +25,19 @@ def __getitem__(self, *args, **kwargs): | |||
|
|||
|
|||
def iter_to_numpy(iterable): | |||
""" | |||
Convert torch.Tensor elements to NumPy arrays. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily a tensor, v can be any Iterable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic of code is that only torch.Tensor elements will be converted to NumPy arrays.
How about "Convert elements of the input iterable to NumPy arrays if they are torch.Tensor objects."
|
||
Returns | ||
------- | ||
any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty.Any*
document for utils folder