I have a matrix of shape (batch_size, N, N) and a masking tensor of shape (batch_size, N).
I want to put -infinity values only for the columns (and not rows) of the matrix, according to the given mask.
I have a matrix of shape (batch_size, N, N) and a masking tensor of shape (batch_size, N).
I want to put -infinity values only for the columns (and not rows) of the matrix, according to the given mask.
Copyright © 2021 Jogjafile Inc.
The solution is via repeating the mask in the correct dimension: