add cpu support as default device (#43)

This commit is contained in:
Bharat Gupta 2023-10-30 04:31:51 -07:00 committed by GitHub
parent 4f297a92fe
commit 18040abf67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ from cotracker.models.core.embeddings import (
torch.manual_seed(0)
def get_points_on_a_grid(grid_size, interp_shape, grid_center=(0, 0), device="cuda"):
def get_points_on_a_grid(grid_size, interp_shape, grid_center=(0, 0), device="cpu"):
if grid_size == 1:
return torch.tensor([interp_shape[1] / 2, interp_shape[0] / 2], device=device)[
None, None

View File

@ -34,7 +34,7 @@ def normalize(d):
return out
def meshgrid2d(B, Y, X, stack=False, norm=False, device="cuda"):
def meshgrid2d(B, Y, X, stack=False, norm=False, device="cpu"):
# returns a meshgrid sized B x Y x X
grid_y = torch.linspace(0.0, Y - 1, Y, device=torch.device(device))