Hi Ptrblck,
I solved the problem of this code. Now I have another , never finish. I need to do binary thresholding for x>value =1 and x<value=0, but in the way that after thresholding I can pass it to the backward.().
For example  for the above code zzz and zzz1 be the binary maps and use in L1 loss. How define zzz and zzz1?