2021-07-19 13:02:22 +00:00
|
|
|
from pytorch_lightning.utilities import DeviceType
|
|
|
|
|
|
|
|
|
|
|
|
def test_consistency():
|
2021-07-26 11:37:35 +00:00
|
|
|
assert DeviceType.TPU not in ("GPU", "CPU")
|
|
|
|
assert DeviceType.TPU in ("TPU", "CPU")
|
|
|
|
assert DeviceType.TPU in ("tpu", "CPU")
|
|
|
|
assert DeviceType.TPU not in {"GPU", "CPU"}
|
2021-07-19 13:02:22 +00:00
|
|
|
# hash cannot be case invariant
|
2021-07-26 11:37:35 +00:00
|
|
|
assert DeviceType.TPU not in {"TPU", "CPU"}
|
|
|
|
assert DeviceType.TPU in {"tpu", "CPU"}
|