How to avoid RuntimeError: bool value of Tensor with more than one value is ambiguous
in this code?
import torch
import heapq
h = []
heapq.heappush(h, (1, torch.Tensor([[1,2]])))
heapq.heappush(h, (1, torch.Tensor([[3,4]])))
It happens because the comparison between tuples compares the second elements when the first ones are equal