MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / _make_scratch

Function _make_scratch

ldm/modules/midas/midas/blocks.py:49–75  ·  view source on GitHub ↗
(in_shape, out_shape, groups=1, expand=False)

Source from the content-addressed store, hash-verified

47
48
49def _make_scratch(in_shape, out_shape, groups=1, expand=False):
50 scratch = nn.Module()
51
52 out_shape1 = out_shape
53 out_shape2 = out_shape
54 out_shape3 = out_shape
55 out_shape4 = out_shape
56 if expand==True:
57 out_shape1 = out_shape
58 out_shape2 = out_shape*2
59 out_shape3 = out_shape*4
60 out_shape4 = out_shape*8
61
62 scratch.layer1_rn = nn.Conv2d(
63 in_shape[0], out_shape1, kernel_size=3, stride=1, padding=1, bias=False, groups=groups
64 )
65 scratch.layer2_rn = nn.Conv2d(
66 in_shape[1], out_shape2, kernel_size=3, stride=1, padding=1, bias=False, groups=groups
67 )
68 scratch.layer3_rn = nn.Conv2d(
69 in_shape[2], out_shape3, kernel_size=3, stride=1, padding=1, bias=False, groups=groups
70 )
71 scratch.layer4_rn = nn.Conv2d(
72 in_shape[3], out_shape4, kernel_size=3, stride=1, padding=1, bias=False, groups=groups
73 )
74
75 return scratch
76
77
78def _make_pretrained_efficientnet_lite3(use_pretrained, exportable=False):

Callers 1

_make_encoderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected