MCPcopy Create free account
hub / github.com/Vchitect/Latte / conv_nd

Function conv_nd

models/utils.py:141–151  ·  view source on GitHub ↗

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

(dims, *args, **kwargs)

Source from the content-addressed store, hash-verified

139 return super().forward(x.float()).type(x.dtype)
140
141def conv_nd(dims, *args, **kwargs):
142 """
143 Create a 1D, 2D, or 3D convolution module.
144 """
145 if dims == 1:
146 return nn.Conv1d(*args, **kwargs)
147 elif dims == 2:
148 return nn.Conv2d(*args, **kwargs)
149 elif dims == 3:
150 return nn.Conv3d(*args, **kwargs)
151 raise ValueError(f"unsupported dimensions: {dims}")
152
153
154def linear(*args, **kwargs):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected