-
Notifications
You must be signed in to change notification settings - Fork 1
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
Sourcery Starbot ⭐ refactored soundmasteraj/WaveVAE #1
base: master
Are you sure you want to change the base?
Conversation
train_indices, test_indices = range(0, len(paths) - test_num_samples), \ | ||
range(len(paths) - test_num_samples, len(paths)) | ||
train_indices, test_indices = ( | ||
range(len(paths) - test_num_samples), | ||
range(len(paths) - test_num_samples, len(paths)), | ||
) | ||
|
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.
Function LJspeechDataset.interest_indices
refactored with the following changes:
- Replace range(0, x) with range(x) (
remove-zero-from-range
)
x = np.pad(x, [(b_pad, max_len - len(x) - b_pad), (0, 0)], | ||
return np.pad(x, [(b_pad, max_len - len(x) - b_pad), (0, 0)], | ||
mode="constant", constant_values=0) | ||
return x |
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.
Function _pad_2d
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
else: | ||
pass | ||
new_batch.append((x, c)) | ||
batch = new_batch | ||
else: | ||
pass | ||
|
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.
Function collate_fn
refactored with the following changes:
- Remove redundant pass statement (
remove-redundant-pass
) - Replace unneeded comprehension with generator (
comprehension-to-generator
)
else: | ||
pass | ||
|
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.
Function collate_fn_synthesize
refactored with the following changes:
- Remove redundant pass statement (
remove-redundant-pass
) - Replace unneeded comprehension with generator (
comprehension-to-generator
)
x_sample = self.decoder.generate(z, c_up) | ||
return x_sample | ||
return self.decoder.generate(z, c_up) |
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.
Function WaveVAE.generate
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
out = self.final_conv(skip) | ||
return out | ||
return self.final_conv(skip) |
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.
Function Wavenet.wavenet
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
logs_tot = logs_tot + logs | ||
logs_tot += logs |
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.
Function Wavenet_Student.iaf
refactored with the following changes:
- Replace assignment with augmented assignment (
aug-assign
)
receptive_field = 1 | ||
for iaf in self.iafs: | ||
receptive_field += iaf.receptive_field_size() - 1 | ||
return receptive_field | ||
return 1 + sum(iaf.receptive_field_size() - 1 for iaf in self.iafs) |
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.
Function Wavenet_Student.receptive_field
refactored with the following changes:
- Convert for loop into call to sum() (
sum-comprehension
) - Inline variable that is immediately returned (
inline-immediately-returned-variable
)
for b in range(self.num_blocks): | ||
for _ in range(self.num_blocks): |
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.
Function Wavenet_Flow.__init__
refactored with the following changes:
- Replace unused for index with underscore (
for-index-underscore
)
out = self.final_conv(skip) | ||
return out | ||
return self.final_conv(skip) |
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.
Function Wavenet_Flow.wavenet
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
master
branch, then run: