pytorch/test/test_itt.py
Yuanyuan Chen 0e083942cc Enable PLW0127 in ruff (#165851)
This PR enables `PLW0127` in ruff, which checks self-assignment of variables with the form `var=var`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/165851
Approved by: https://github.com/Lucaskabela
2025-10-21 03:30:57 +00:00

21 lines
658 B
Python

# Owner(s): ["module: intel"]
import torch
import unittest
from torch.testing._internal.common_utils import TestCase, run_tests, load_tests
# load_tests from common_utils is used to automatically filter tests for
# sharding on sandcastle. This line silences flake warnings
load_tests = load_tests # noqa: PLW0127
@unittest.skipIf(not torch.profiler.itt.is_available(), "ITT is required")
class TestItt(TestCase):
def test_itt(self):
# Just making sure we can see the symbols
torch.profiler.itt.range_push("foo")
torch.profiler.itt.mark("bar")
torch.profiler.itt.range_pop()
if __name__ == '__main__':
run_tests()