Skip to content

Commit cd4a2d4

Browse files
committed
style
Signed-off-by: Staszek Pasko <[email protected]>
1 parent b578795 commit cd4a2d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vllm/v1/serial_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _encode_tensor(
140140
# this creates a copy of the tensor
141141
obj = obj.contiguous() if not obj.is_contiguous() else obj
142142
# view the tensor as a 1D array of bytes
143-
arr = obj.view((obj.numel(),)).view(torch.uint8).numpy()
143+
arr = obj.view((obj.numel(), )).view(torch.uint8).numpy()
144144
if obj.nbytes < self.size_threshold:
145145
data = msgpack.Ext(CUSTOM_TYPE_RAW_VIEW, arr.data)
146146
else:
@@ -228,7 +228,7 @@ def _decode_tensor(self, arr: Any) -> torch.Tensor:
228228
# the returned memory is non-writeable.
229229
buffer = self.aux_buffers[data] if isinstance(data, int) \
230230
else bytearray(data)
231-
arr = np.ndarray(buffer=buffer, dtype=np.uint8, shape=(len(buffer),))
231+
arr = np.ndarray(buffer=buffer, dtype=np.uint8, shape=(len(buffer), ))
232232
torch_dtype = getattr(torch, dtype)
233233
assert isinstance(torch_dtype, torch.dtype)
234234
return torch.from_numpy(arr).view(torch_dtype).view(shape)

0 commit comments

Comments
 (0)