def get_output_for(self, inputs, **kwargs):
vals, ref = inputs
N, _, H, W = ref.shape
yx = tt.stack(tt.mgrid[0:H, 0:W])[np.newaxis, :, :, :]
grid = tt.alloc(tt.cast(yx, "float32"), N, 2, H, W)
stacked = tt.concatenate([grid, ref], axis=1)
return super(BilateralFilterLayer, self).get_output_for(
[vals, stacked], **kwargs)
评论列表
文章目录