mirror of
https://github.com/kvcache-ai/sglang.git
synced 2026-07-11 09:47:59 +00:00
17 lines
351 B
Python
17 lines
351 B
Python
import pytest
|
|
import torch
|
|
|
|
|
|
def test_change_torch_defaults():
|
|
torch.set_default_device("cpu:0")
|
|
torch.set_default_dtype(torch.float16)
|
|
|
|
|
|
def test_check_torch_defaults():
|
|
assert torch.get_default_device() == torch.device("cpu")
|
|
assert torch.get_default_dtype() == torch.float32
|
|
|
|
|
|
if __name__ == "__main__":
|
|
pytest.main([__file__])
|