Constraints to kernels during training

Hello,
is it possible to put constraints to layer’s kernel…
For example: in last layer I used 5x5 kernel, but I want to make it symmetric.

like this:
1 2 3 2 1
2 4 5 4 2
3 5 6 5 3
2 4 5 4 2
1 2 3 2 1

if I try to change weight manually, I got error about “something related to gradient”…
is there any way to make kernel shape symmetric?