[diffusion] fix: fix pytorch non-writable array warning (#15017)

This commit is contained in:
Lancer
2025-12-15 20:18:54 +08:00
committed by GitHub
parent 92c29d43ac
commit abd3e048f2

View File

@@ -32,7 +32,7 @@ def broadcast_pyobj(
size = len(serialized_data)
tensor_data = torch.ByteTensor(
np.frombuffer(serialized_data, dtype=np.uint8)
np.frombuffer(serialized_data, dtype=np.uint8).copy()
).to(device)
tensor_size = torch.tensor([size], dtype=torch.long, device=device)