diffusers
ce7f3344 - Remove multiple if-else statement in the get_activation function. (#5446)

Commit
2 years ago
Remove multiple if-else statement in the get_activation function. (#5446) * I added a new doc string to the class. This is more flexible to understanding other developers what are doing and where it's using. * Update src/diffusers/models/unet_2d_blocks.py This changes suggest by maintener. Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * Update src/diffusers/models/unet_2d_blocks.py Add suggested text Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * Update unet_2d_blocks.py I changed the Parameter to Args text. * Update unet_2d_blocks.py proper indentation set in this file. * Update unet_2d_blocks.py a little bit of change in the act_fun argument line. * I run the black command to reformat style in the code * Update unet_2d_blocks.py similar doc-string add to have in the original diffusion repository. * I use a lower method in the activation function. * Replace multiple if-else statements with a dictionary of activation functions, and call one if statement to retrieve the appropriate function. * I am using black package to reforamted my file * I defined the ACTIVATION_FUNCTIONS variable outside of the function * activation function variable convert to lower case * First, I resolved the conflict issue. Then, I ran the Black package to reformat my file. --------- Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Author
Parents
Loading