The size of tensor is [4,884736].

I am doing the summation with torch.sum(dim=1)

I have checked whether the tensor has float(‘-inf’) value with :-

1] torch.where(tensor == float(‘-inf’), 1, 0) → count the non_zero → output is zero

2] torch.where(tensor < -7, 1, 0) → count the non_zero → output is zero. Thus specifying the no element is lesser than -7

3] tensor[tensor == float(‘-inf’)] == 0. Still the result is -inf.

Kindly suggest.