MCPcopy Create free account
hub / github.com/OpenGVLab/DragGAN / make_kernel

Function make_kernel

draggan/deprecated/stylegan2/model.py:37–45  ·  view source on GitHub ↗
(k)

Source from the content-addressed store, hash-verified

35
36
37def make_kernel(k):
38 k = torch.tensor(k, dtype=torch.float32)
39
40 if k.ndim == 1:
41 k = k[None, :] * k[:, None]
42
43 k /= k.sum()
44
45 return k
46
47
48class Upsample(nn.Module):

Callers 3

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected