(kernel, device="cuda:0")
| 251 | |
| 252 | |
| 253 | def 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 | |
| 261 | class Blurkernel(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected