MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / conv_nd

Function conv_nd

sat/sgm/modules/diffusionmodules/util.py:248–258  ·  view source on GitHub ↗

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

(dims, *args, **kwargs)

Source from the content-addressed store, hash-verified

246
247
248def conv_nd(dims, *args, **kwargs):
249 """
250 Create a 1D, 2D, or 3D convolution module.
251 """
252 if dims == 1:
253 return nn.Conv1d(*args, **kwargs)
254 elif dims == 2:
255 return nn.Conv2d(*args, **kwargs)
256 elif dims == 3:
257 return nn.Conv3d(*args, **kwargs)
258 raise ValueError(f"unsupported dimensions: {dims}")
259
260
261def linear(*args, **kwargs):

Callers 8

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected