MCPcopy Create free account
hub / github.com/OpenTalker/StyleHEAT / UpBlock2d

Class UpBlock2d

models/styleheat/base_function.py:328–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326
327
328class UpBlock2d(nn.Module):
329 def __init__(self, input_nc, output_nc, norm_layer=nn.BatchNorm2d, nonlinearity=nn.LeakyReLU(), use_spect=False):
330 super(UpBlock2d, self).__init__()
331 kwargs = {'kernel_size': 3, 'stride': 1, 'padding': 1}
332 conv = spectral_norm(nn.Conv2d(input_nc, output_nc, **kwargs), use_spect)
333 if type(norm_layer) == type(None):
334 self.model = nn.Sequential(conv, nonlinearity)
335 else:
336 self.model = nn.Sequential(conv, norm_layer(output_nc), nonlinearity)
337
338 def forward(self, x):
339 out = self.model(F.interpolate(x, scale_factor=2))
340 return out
341
342
343class FineADAINResBlocks(nn.Module):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected