    def _seeded_random_tensor(self, *shape: int, device) -> torch.FloatTensor:
        """PyTorch's random functions can't take a random seed. There is only one global
        random seed in torch, but that's not deterministic enough for us. So we use Python's
        random source to make random tensors."""
        result = torch.zeros(*shape, dtype=torch.float32, device=device)
        for coordinates in itertools.product(*(range(size) for size in result.shape)):
            result[coordinates] = self.random.uniform(-1, 1)
        return result
PyTorch's random functions can't take a random seed. There is only one global
random seed in torch, but that's not deterministic enough for us. So we use Python's
random source to make random tensors.
allennlp/modules/vision/region_detector.py