MCPcopy Create free account
hub / github.com/DPS2022/diffusion-posterior-sampling / init_kernel_torch

Function init_kernel_torch

util/img_utils.py:253–258  ·  view source on GitHub ↗
(kernel, device="cuda:0")

Source from the content-addressed store, hash-verified

251
252
253def init_kernel_torch(kernel, device="cuda:0"):
254 h, w = kernel.shape
255 kernel = Variable(torch.from_numpy(kernel).to(device), requires_grad=True)
256 kernel = kernel.view(1, 1, h, w)
257 kernel = kernel.repeat(1, 3, 1, 1)
258 return kernel
259
260
261class Blurkernel(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected