[solved] Indices with -1 for return_index of maxpool_1d

I encounter a problem as follows:
F.max_pool1d(a, a.size(2), return_indices=True) is used in my code, but some of them are -1, which is affect the torch.gather method latter.
Could anyone explain what’s the situation the indices will contain -1.


I might figure out here.
When the a contain nan, it will return -1 indices …
Just make a note here.