summac
summac copied to clipboard
Convert histograms to nparray to avoid warning
torch throws a warning about creating a tensor from a list of arrays:
summac/model_summac.py:301: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at ../torch/csrc/utils/tensor_new.cpp:261.)
histograms = torch.FloatTensor(histograms).to(self.device)
This PR converts the list to a single nparray first to avoid this message. I've not noticed a significant change in performance as a result.