Unverified Commit ea8364e5 authored by Chi's avatar Chi Committed by GitHub
Browse files

I Added Doc-String Into The class. (#5293)



* 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: default avatarSayak Paul <spsayakpaul@gmail.com>

* Update src/diffusers/models/unet_2d_blocks.py

Add suggested text
Co-authored-by: default avatarSayak 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

---------
Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
parent e00df25a
...@@ -466,6 +466,18 @@ def get_up_block( ...@@ -466,6 +466,18 @@ def get_up_block(
class AutoencoderTinyBlock(nn.Module): class AutoencoderTinyBlock(nn.Module):
"""
Tiny Autoencoder block used in [`AutoencoderTiny`]. It is a mini residual module consisting of plain conv + ReLU blocks.
Args:
in_channels (`int`): The number of input channels.
out_channels (`int`): The number of output channels.
act_fn (`str`):` The activation function to use. Supported values are `"swish"`, `"mish"`, `"gelu"`, and `"relu"`.
Returns:
`torch.FloatTensor`: A tensor with the same shape as the input tensor, but with the number of channels equal to `out_channels`.
"""
def __init__(self, in_channels: int, out_channels: int, act_fn: str): def __init__(self, in_channels: int, out_channels: int, act_fn: str):
super().__init__() super().__init__()
act_fn = get_activation(act_fn) act_fn = get_activation(act_fn)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment