Skip to content

Commit

Permalink
add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jnwnlee committed Mar 29, 2024
1 parent 73f2c0b commit 772d2b3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fadtk/panns/pytorch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@


def move_data_to_device(x, device):
"""Move numpy ndarray to device after converting it to torch.Tensor.
Args:
x: np.ndarray
device: torch.device
Returns:
x: torch.Tensor
"""
if "float" in str(x.dtype):
x = torch.Tensor(x)
elif "int" in str(x.dtype):
Expand Down

0 comments on commit 772d2b3

Please sign in to comment.