Hi,
The think is that the threshold operation is not differentiable wrt the threshold value.
More specificatly, if the operation it is performing for each element is:
if inp[el] <= threshold:
    out[el] = thresholded_value
else:
    out[el] = inp[el]

What is d(out)/d(threshold) here?