MCPcopy
hub / github.com/Mikubill/sd-webui-controlnet / func

Function func

annotator/pidinet/model.py:277–285  ·  view source on GitHub ↗
(x, weights, bias=None, stride=1, padding=0, dilation=1, groups=1)

Source from the content-addressed store, hash-verified

275
276 if op_type == 'cd':
277 def func(x, weights, bias=None, stride=1, padding=0, dilation=1, groups=1):
278 assert dilation in [1, 2], 'dilation for cd_conv should be in 1 or 2'
279 assert weights.size(2) == 3 and weights.size(3) == 3, 'kernel size for cd_conv should be 3x3'
280 assert padding == dilation, 'padding for cd_conv set wrong'
281
282 weights_c = weights.sum(dim=[2, 3], keepdim=True)
283 yc = F.conv2d(x, weights_c, stride=stride, padding=0, groups=groups)
284 y = F.conv2d(x, weights, bias, stride=stride, padding=padding, dilation=dilation, groups=groups)
285 return y - yc
286 return func
287 elif op_type == 'ad':
288 def func(x, weights, bias=None, stride=1, padding=0, dilation=1, groups=1):

Callers 15

wrappedFunction · 0.85
wrapperFunction · 0.85
_visit_dict_configFunction · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
wrapped_funcFunction · 0.85
track_progressFunction · 0.85
wrapper_innerFunction · 0.85
wrapperFunction · 0.85
wrapperFunction · 0.85
new_forwardFunction · 0.85

Calls 2

sizeMethod · 0.45
toMethod · 0.45

Tested by 1

wrapperFunction · 0.68