Specifically given a 2-D matrix, how to find median for every column's positive elements?

Mathematically speaking: return B, where `B[i] = median({A[j, i] | A[j, i] > 0})`

I know that median can by computed by 　`tf.contrib.distributions.percentile`

`tf.boolean_mask(A, tf.greater(A, 0))` outputs a 1-D list instead of a matrix.