MCPcopy Index your code
hub / github.com/apple/ml-sharp / _create_block

Function _create_block

src/sharp/models/blocks.py:97–113  ·  view source on GitHub ↗
(dim_in: int, dim_out: int)

Source from the content-addressed store, hash-verified

95 padding = (dilation * (kernel_size - 1)) // 2
96
97 def _create_block(dim_in: int, dim_out: int) -> list[nn.Module]:
98 layers = [
99 norm_layer_2d(dim_in, norm_type, num_groups=norm_num_groups),
100 actvn,
101 ]
102
103 layers.append(
104 nn.Conv2d(
105 dim_in,
106 dim_out,
107 kernel_size=kernel_size,
108 stride=1,
109 dilation=dilation,
110 padding=padding,
111 )
112 )
113 return layers
114
115 residual = nn.Sequential(
116 *_create_block(dim_in, dim_hidden),

Callers 2

residual_block_2dFunction · 0.85
_residual_blockMethod · 0.85

Calls 1

norm_layer_2dFunction · 0.85

Tested by

no test coverage detected