Download model/dgmr_official/layers/utils.py from OneScience-Group/DGMR: direct link, hf CLI and curl.
- Browser
- Download file 528 Bytes
-
https://huggingface.co/OneScience-Group/DGMR/resolve/main/model/dgmr_official/layers/utils.py
- Command line
-
hf download hf://OneScience-Group/DGMR/model/dgmr_official/layers/utils.py
-
curl -L -o utils.py https://huggingface.co/OneScience-Group/DGMR/resolve/main/model/dgmr_official/layers/utils.py
528 Bytes
| """Utilities functions for the layer submodules.""" | |
| import torch | |
| from . import CoordConv | |
| def get_conv_layer(conv_type: str = "standard") -> torch.nn.Module: | |
| """Return a conv layer based on the passed in string name.""" | |
| if conv_type == "standard": | |
| conv_layer = torch.nn.Conv2d | |
| elif conv_type == "coord": | |
| conv_layer = CoordConv | |
| elif conv_type == "3d": | |
| conv_layer = torch.nn.Conv3d | |
| else: | |
| raise ValueError(f"{conv_type} is not a recognized Conv method") | |
| return conv_layer | |