MCPcopy Index your code
hub / github.com/CompVis/diff2flow / conv_nd

Function conv_nd

diff2flow/models/unet/util.py:115–125  ·  view source on GitHub ↗

Create a 1D, 2D, or 3D convolution module.

(dims, *args, **kwargs)

Source from the content-addressed store, hash-verified

113
114
115def conv_nd(dims, *args, **kwargs):
116 """
117 Create a 1D, 2D, or 3D convolution module.
118 """
119 if dims == 1:
120 return nn.Conv1d(*args, **kwargs)
121 elif dims == 2:
122 return nn.Conv2d(*args, **kwargs)
123 elif dims == 3:
124 return nn.Conv3d(*args, **kwargs)
125 raise ValueError(f"unsupported dimensions: {dims}")
126
127
128def linear(*args, **kwargs):

Callers 6

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected