Trying to mask tensor with another tensor of same dimension getting "index 1 is out of bounds for dimension 0 with size 1"
    attn_weights = F.softmax(self.attn(torch.cat((input, hidden_cat), 2)), dim=2)
    attn_weights[mask] = float('-inf')
    attn_applied = torch.bmm(attn_weights.transpose(0,1),encoder_outputs.transpose(0,1)).transpose(0,1)
    attn_output = torch.cat((input, attn_applied), 2)


So I'm trying to set all the indexes in mask that are equal 1 to negative infinity, but that line

attn_weights[mask] = float('-inf')


keeps throwing this exception "index 1 is out of bounds for dimension 0 with size 1" not really sure what's going on attn_weights and mask both have the same dimension, which is 1 x 2048 x 40.

turns out the dtype for mask tensor had to be torch.uint8 or torch.bool I had it torch.long
