code
stringlengths
3
6.57k
print(f'Loading "{pkl}"... ', end='', flush=True)
dnnlib.util.open_url(pkl, verbose=False)
legacy.load_network_pkl(f)
print('Done.')
CapturedException()
print('Failed!')
self._ignore_timing()
isinstance(data, CapturedException)
tuple(sorted(tweak_kwargs.items()
self._networks.get(cache_key, None)
copy.deepcopy(orig_net)
self._tweak_network(net, **tweak_kwargs)
net.to(self._device)
CapturedException()
self._ignore_timing()
isinstance(net, CapturedException)
_tweak_network(self, net)
misc.named_params_and_buffers(net)
name.endswith('.magnitude_ema')
value.rsqrt()
numpy()
print(f'{name:<50s}{np.min(value)
np.max(value)
name.endswith('.weight')
value.square()
mean([1,2,3])
sqrt()
numpy()
print(f'{name:<50s}{np.min(value)
np.max(value)
_get_pinned_buf(self, ref)
tuple(ref.shape)
self._pinned_bufs.get(key, None)
torch.empty(ref.shape, dtype=ref.dtype)
pin_memory()
to_device(self, buf)
self._get_pinned_buf(buf)
copy_(buf)
to(self._device)
to_cpu(self, buf)
self._get_pinned_buf(buf)
copy_(buf)
clone()
_ignore_timing(self)
_apply_cmap(self, x, name='viridis')
self._cmaps.get(name, None)
matplotlib.cm.get_cmap(name)
cmap(np.linspace(0, 1, num=1024)
self.to_device(torch.from_numpy(cmap)
clamp(0, hi)
to(torch.int64)
torch.nn.functional.embedding(x, cmap)
self.get_network(pkl, 'G_ema')
any('noise_const' in name for name, _buf in G.synthesis.named_buffers()
hasattr(G.synthesis, 'input')
hasattr(G.synthesis.input, 'transform')
np.eye(3)
np.linalg.inv(np.asarray(input_transform)
CapturedException()
G.synthesis.input.transform.copy_(torch.from_numpy(m)
list(set(all_seeds)
np.zeros([len(all_seeds)
np.zeros([len(all_seeds)
enumerate(all_seeds)
np.random.RandomState(seed)
rnd.randn(G.z_dim)
rnd.randint(G.c_dim)
self.to_device(torch.from_numpy(all_zs)
self.to_device(torch.from_numpy(all_cs)
G.mapping(z=all_zs, c=all_cs, truncation_psi=trunc_psi, truncation_cutoff=trunc_cutoff)
dict(zip(all_seeds, all_ws)
torch.stack([all_ws[seed] * weight for seed, weight in w0_seeds])
sum(dim=0, keepdim=True)
len(stylemix_idx)
dnnlib.EasyDict(noise_mode=noise_mode, force_fp32=force_fp32)
torch.manual_seed(random_seed)
self.run_synthesis_net(G.synthesis, w, capture_layer=layer_name, **synthesis_kwargs)
tuple(sorted(synthesis_kwargs.items()
torch.manual_seed(random_seed)
self.run_synthesis_net(G.synthesis, w, **synthesis_kwargs)
_apply_affine_transformation(out.to(torch.float32)
to(torch.float32)
max(min(base_channel, out.shape[0] - sel_channels)
out.mean()
sel.mean()
out.std()
sel.std()
out.norm(float('inf')
sel.norm(float('inf')
img.norm(float('inf')
clip(1e-8, 1e8)
clamp(0, 255)
to(torch.uint8)
permute(1, 2, 0)
sig.to(torch.float32)
sig.mean(dim=[1,2], keepdim=True)
torch.kaiser_window(sig.shape[1], periodic=False, beta=fft_beta, device=self._device)
torch.kaiser_window(sig.shape[2], periodic=False, beta=fft_beta, device=self._device)
torch.fft.fftn(sig, dim=[1,2])
abs()