Download Modules/utils.py from ak36/styletts2: direct link, hf CLI and curl.
- Browser
- Download file 376 Bytes
-
https://huggingface.co/ak36/styletts2/resolve/main/Modules/utils.py
- Command line
-
hf download hf://ak36/styletts2/Modules/utils.py
-
curl -L -o utils.py https://huggingface.co/ak36/styletts2/resolve/main/Modules/utils.py
376 Bytes
| def init_weights(m, mean=0.0, std=0.01): | |
| classname = m.__class__.__name__ | |
| if classname.find("Conv") != -1: | |
| m.weight.data.normal_(mean, std) | |
| def apply_weight_norm(m): | |
| classname = m.__class__.__name__ | |
| if classname.find("Conv") != -1: | |
| weight_norm(m) | |
| def get_padding(kernel_size, dilation=1): | |
| return int((kernel_size*dilation - dilation)/2) |