Umm, RTD(Read the docs)!
tf.select selects elements from positive or negative tensors based on the boolness of the elements in the condition tensor.
tf.select(condition, t, e, name=None)
Selects elements from t or e, depending on condition.
The t, and e tensors must all have the same shape, and the output will also have that shape.
(from the official docs.)
So in your case:
threshold = tf.select(input > RLSA_THRESHOLD, positive, negative)
input > RLSA_THRESHOLD will be a tensor of bool or logical values (0 or 1 symbolically), which will help choose a value from either the positive vector or the negative vector.
For example, say you have a RLSA_THRESHOLD of 0.5 and your input vector is a 4-dimensional vector of real continuous values ranging from 0 to 1. Your positive and negative vectors are essentially [1, 1, 1, 1] and [0, 0, 0, 0], respectively. input is [0.8, 0.2, 0.5, 0.6].
threshold will be [1, 0, 0, 1].
NOTE: positive and negative could be any kind of tensor as long as the dimensions agree with the condition tensor. Had positive and negative been, say, [2, 4, 6, 8] and [1, 3, 5, 7] respectively, your threshold would have been [2, 3, 5, 8].
The code snippet seems reasonably advanced for me to assume that the authors would have just used input > RLSA_THRESHOLD if there was no specific reason for the tf.select.
There is a very good reason for that. input > RLSA_THRESHOLD would simply return a tensor of logical (boolean) values. Logical values do not mix well with numerical values. You cannot use them for any realistic numerical computation. Had the positive and/or negative tensors been real valued, you might have required your threshold tensor to also have real values, in case you planned to use them further along.
Is the tf.select equivalent to input > RLSA_THRESHOLD? If not, why not?
No they are not. One is a function, the other is a tensor.
I am going to give you the benefit of doubt and assume you meant to ask:
Is the threshold equivalent to input > RLSA_THRESHOLD? If not, why not?
No they are not. As explained above, input > RLSA_THRESHOLD is a logical tensor with a data type of bool. threshold, on the other hand, is a tensor with the same data type as positive and negative.
NOTE: You can always cast your logical tensors to numerical (or any other supported data type) tensors using any of the casting methods available in tensorflow.