mirror of
https://github.com/kvcache-ai/sglang.git
synced 2026-07-01 04:08:10 +00:00
10 lines
180 B
Python
10 lines
180 B
Python
import torch
|
|
|
|
|
|
def weak_ref_tensor(tensor):
|
|
return (
|
|
torch.ops.sgl_kernel.weak_ref_tensor(tensor)
|
|
if isinstance(tensor, torch.Tensor)
|
|
else tensor
|
|
)
|