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

speed up latents nan replace #1009

Merged
merged 1 commit into from
Dec 21, 2023
Merged

speed up latents nan replace #1009

merged 1 commit into from
Dec 21, 2023

Conversation

liubo0902
Copy link
Contributor

use nan_to_num to speed up nan replace

@kohya-ss
Copy link
Owner

Thank you for this! I didn't know nan_to_num. It is very nice.

Is it fine to remove out=latents, because the returned value is assigned to latents? I'm not sure which is better to omit out or omit the assignment.

@liubo0902
Copy link
Contributor Author

Thank you for this! I didn't know nan_to_num. It is very nice.

Is it fine to remove out=latents, because the returned value is assigned to latents? I'm not sure which is better to omit out or omit the assignment.

with out, it is a inplace op, in this way, no new memory is allocated

@kohya-ss
Copy link
Owner

Thank you for clarification!

@kohya-ss kohya-ss changed the base branch from main to dev December 21, 2023 12:36
@kohya-ss kohya-ss merged commit 0676f1a into kohya-ss:dev Dec 21, 2023
1 check passed
kohya-ss added a commit that referenced this pull request Dec 21, 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.

2 participants