mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[GH1] replace globs with patterns that mergebot can process (#81414)
https://github.com/pytorch/pytorch/pull/81330#issuecomment-1182345751 shouldn't have happened and should have matched the linalg rule. The reason it happened is cuz we don't treat the patterns like globs. We may follow this up with a BE change to make the patterns be treated more like globs, which I expected originally. Pull Request resolved: https://github.com/pytorch/pytorch/pull/81414 Approved by: https://github.com/malfet
This commit is contained in:
committed by
PyTorch MergeBot
parent
270069cfb9
commit
c67a4d8a65
14
.github/scripts/test_gitutils.py
vendored
14
.github/scripts/test_gitutils.py
vendored
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
from gitutils import PeekableIterator
|
||||
from gitutils import PeekableIterator, patterns_to_regex
|
||||
from unittest import TestCase, main
|
||||
|
||||
class TestPeekableIterator(TestCase):
|
||||
@ -22,6 +22,18 @@ class TestPeekableIterator(TestCase):
|
||||
self.assertTrue(iter_.peek() is None)
|
||||
|
||||
|
||||
class TestPattern(TestCase):
|
||||
def test_double_asterisks(self) -> None:
|
||||
allowed_patterns = [
|
||||
"aten/src/ATen/native/**LinearAlgebra*",
|
||||
]
|
||||
patterns_re = patterns_to_regex(allowed_patterns)
|
||||
fnames = [
|
||||
"aten/src/ATen/native/LinearAlgebra.cpp",
|
||||
"aten/src/ATen/native/cpu/LinearAlgebraKernel.cpp"]
|
||||
for filename in fnames:
|
||||
self.assertTrue(patterns_re.match(filename))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
Reference in New Issue
Block a user