Let me introduce the problem with the example in numpy:
arr - some numpy array
a, b - constants
arr[arr < a] = b
Now, I would like to implement the same functionality but in Tensorflow where arr
would be a tensor. Tensor value is not known before runtime.
As you can see, the answer would yield clarification for both assigning values to specific positions inside tensors, and also performing conditioning on the tensor and retrieving indices which satisfy condition.