From e053a8dc99f4e62b69ad5ed05ede7d393e44f6b0 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 11 Jun 2024 13:31:06 -0700 Subject: [PATCH] Add exir/program/test (#3935) Summary: In exir/program/test/test_program.py, changed the library name to `exir_program_test_op` to avoid duplicated name between tests Pull Request resolved: https://github.com/pytorch/executorch/pull/3935 Test Plan: CI Reviewed By: JacobSzwejbka Differential Revision: D58424315 Pulled By: kirklandsign fbshipit-source-id: 17eb98630e5f5e4bdfa1c98cc3e1150d4a51abcd --- exir/program/test/test_program.py | 4 ++-- pytest.ini | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/exir/program/test/test_program.py b/exir/program/test/test_program.py index 73057feec3..8779f6a306 100644 --- a/exir/program/test/test_program.py +++ b/exir/program/test/test_program.py @@ -47,7 +47,7 @@ def forward(self, *args, **kwargs): return self.fn(*args, **kwargs) -lib = Library("test_op", "DEF") +lib = Library("exir_program_test_op", "DEF") # Fake a operator for testing. # This operator takes two tensors as input and returns the first one. @@ -474,7 +474,7 @@ def _test_edge_dialect_verifier(self, callable, validate_ir=True): def test_edge_dialect_custom_op(self): def _use_foo_add(a: torch.Tensor, b: torch.Tensor): - return torch.ops.test_op.foo(a, b) + return torch.ops.exir_program_test_op.foo(a, b) from torch._export.verifier import SpecViolationError diff --git a/pytest.ini b/pytest.ini index 3bd7f8bfb4..a37bcbb28f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -26,6 +26,7 @@ addopts = exir/dialects/backend/test exir/dialects/edge/test exir/dialects/test + exir/program/test exir/tests/test_arg_validator.py exir/tests/test_capture.py exir/tests/test_delegate.py