layers: add TernaryDense — ternary-weight dense layer {-1, 0, +1} (#22960)