Hi @KFrank
Thanks for your reply and thorough explanation.
However, values in the seq_len dimension are some integers which are basically word_indices.
let me clarify what I want to do:
Lets say seq_len = 128
consider X = myTensor[0,:].  # this would be of size [1, 128].
for example: X = [4,121,4,501,100, …,125, 90,92, 100, …,125]
I want all values between (including) 100 and 125 which I showed with …, set to -1. And I want to do that for all rows of myTensor (#row = batch_size)
I hope I could clarify this. Thanks again
Is there anyway I can use masked_fill_() for this but not with respect to actual values?