Co-authored-by: aksksks<mengzichao@h-partners.com> # message auto-generated for no-merge-commit merge: !27014 merge master into master AI assist developer for python dt for master Created-by: aksksks Commit-by: aksksks Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one ` /kind <>` line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature **What does this PR do / why do we need it**: **Which issue(s) this PR fixes**: <!-- *Automatically closes linked issue when PR is merged. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> Fixes # **Special notes for your reviewers**: See merge request: Ascend/pytorch!27014
15 lines
491 B
Python
15 lines
491 B
Python
from torch_npu.testing.testcase import TestCase, run_tests
|
|
from torch_npu.utils.cpp_extension import NpuExtension
|
|
|
|
|
|
class TestCppExtension(TestCase):
|
|
|
|
def test_npu_extension_default_libraries(self):
|
|
extension = NpuExtension('test_extension', ['test.cpp'])
|
|
expected_libraries = ['c10', 'torch', 'torch_npu', 'torch_python', 'torch_npu']
|
|
for lib in expected_libraries:
|
|
self.assertIn(lib, extension.libraries)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
run_tests() |