I want to set INF value to matrix by mask matrix, just like pytorch code:
scores.data.masked_fill_(y_mask.data, -float('inf'))
I try to use tf.map_fn
to implement that, but the performance is too slow. So does tensorflow have any efficient function to implement that?