Skip to content

Commit

Permalink
Fix legacy tensor construction (#3145)
Browse files Browse the repository at this point in the history
  • Loading branch information
gtangg12 authored May 14, 2024
1 parent e2a9793 commit ddcbb5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nerfstudio/cameras/cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def _init_get_fc_xy(self, fc_xy: Union[float, torch.Tensor], name: str) -> torch
name: The name of the variable. Used for error messages
"""
if isinstance(fc_xy, float):
fc_xy = torch.Tensor([fc_xy], device=self.device)
fc_xy = torch.tensor([fc_xy], device=self.device)
elif isinstance(fc_xy, torch.Tensor):
if fc_xy.ndim == 0 or fc_xy.shape[-1] != 1:
fc_xy = fc_xy.unsqueeze(-1)
Expand Down

0 comments on commit ddcbb5c

Please sign in to comment.