Skip to content

Commit

Permalink
Udpate ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkLight1337 committed Jul 18, 2024
1 parent bc616e6 commit 64382b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vllm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,11 @@ def make_tensor_with_pad(
np_dtype = TORCH_DTYPE_TO_NUMPY_DTYPE[dtype]
padded_x = make_array_with_pad(x, max_len, pad, np_dtype)

tensor = torch.from_numpy(padded_x)
tensor = torch.from_numpy(padded_x).to(device)
if pin_memory:
tensor = tensor.pin_memory()
return tensor.to(device)

return tensor


def async_tensor_h2d(
Expand Down

0 comments on commit 64382b3

Please sign in to comment.