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

document for utils #14

Merged
merged 7 commits into from
Apr 28, 2023
Merged

Conversation

MrLYG
Copy link
Contributor

@MrLYG MrLYG commented Apr 19, 2023

document for utils folder

Copy link
Contributor

@hjzccc hjzccc left a 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 Show resolved Hide resolved
Returns
-------
list[Path]
A list of the latest checkpoint files sorted by their creation time.
Copy link
Contributor

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 Show resolved Hide resolved
ablator/utils/file.py Show resolved Hide resolved
ablator/utils/file.py Outdated Show resolved Hide resolved
@@ -25,6 +25,19 @@ def __getitem__(self, *args, **kwargs):


def iter_to_numpy(iterable):
"""
Convert torch.Tensor elements to NumPy arrays.
Copy link
Collaborator

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

Copy link
Contributor Author

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."

ablator/utils/base.py Outdated Show resolved Hide resolved
ablator/utils/base.py Outdated Show resolved Hide resolved
ablator/utils/base.py Outdated Show resolved Hide resolved
ablator/utils/base.py Outdated Show resolved Hide resolved
ablator/utils/base.py Show resolved Hide resolved
@MrLYG MrLYG requested a review from hieuchi911 April 28, 2023 21:55

Returns
-------
any
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty.Any*

@fostiropoulos fostiropoulos merged commit 8c498cf into fostiropoulos:trainers Apr 28, 2023
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

Successfully merging this pull request may close these issues.

4 participants