-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
todoNot as important as medium or high priority tasks, but we will work on these.Not as important as medium or high priority tasks, but we will work on these.
Description
Do you think it is a good idea that torch.Device support hashing ?
hash(torch.device("cpu"))
TypeError: unhashable type: 'torch.Device'On my side, it would be useful for cached functions like
@lru_cache()
def big_constant_tensor(x, y, device):
return torch.tensor((1000, 1000), math.pi, device=device)Currently I do this to avoid the problem
@lru_cache()
def big_constant_tensor(x, y, device_type, device_index):
return torch.tensor((1000, 1000), math.pi, device=torch.device(device_type, device_index))Metadata
Metadata
Assignees
Labels
todoNot as important as medium or high priority tasks, but we will work on these.Not as important as medium or high priority tasks, but we will work on these.