(tensor, h, w, window=8, reduce='sum')
| 66 | filter = torch.from_numpy(gabor_filter).view((1, 1,) + gabor_filter.shape).repeat(1, 3, 1, 1) |
| 67 | |
| 68 | def attr_gabor(tensor, h, w, window=8, reduce='sum'): |
| 69 | after_filter = F.conv2d(tensor, filter, bias=None) |
| 70 | crop = after_filter[:, :, h: h + window, w: w + window] |
| 71 | return reduce_func(reduce)(crop) |
| 72 | |
| 73 | return attr_gabor |
| 74 |
nothing calls this directly
no test coverage detected