Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Backend Checking #21005

Open
FNICKE opened this issue Mar 7, 2025 · 3 comments
Open

Improved Backend Checking #21005

FNICKE opened this issue Mar 7, 2025 · 3 comments
Assignees

Comments

@FNICKE
Copy link

FNICKE commented Mar 7, 2025

Before :

requires_trainable_backend = pytest.mark.skipif(
    backend() == "numpy" or backend() == "openvino",
    reason="Trainer not implemented for NumPy and OpenVINO backend.",
)

After :

requires_trainable_backend = pytest.mark.skipif(
    backend() in ["numpy", "openvino"],
    reason="Trainer not implemented for NumPy and OpenVINO backend.",
)
@sachinprasadhs
Copy link
Collaborator

@FNICKE , Please create a PR with the suggested changes.

Copy link

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Mar 25, 2025
@FNICKE
Copy link
Author

FNICKE commented Mar 29, 2025

Refactor requires_trainable_backend Condition

Description:
This PR updates the requires_trainable_backend decorator to use a more concise syntax with the in operator for checking backend values.

Before:
python
Copy
Edit
requires_trainable_backend = pytest.mark.skipif(
backend() == "numpy" or backend() == "openvino",
reason="Trainer not implemented for NumPy and OpenVINO backend.",
)

After:
python
Copy
Edit
requires_trainable_backend = pytest.mark.skipif(
backend() in ["numpy", "openvino"],
reason="Trainer not implemented for NumPy and OpenVINO backend.",
)
Why this change?
Improves readability and maintainability.

Uses a more Pythonic approach with in for multiple condition checks.

Checklist:
Code change tested and verified.

No functionality changes, only refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants