Module neuralops.tests.test_generalization_hardcoded_scan

Verification: Hardcoded String / Shape Scan.

Functions

def test_no_hardcoded_roberta_in_core()
Expand source code
def test_no_hardcoded_roberta_in_core():
    root = Path(__file__).resolve().parent.parent / "core"
    for py_file in root.glob("*.py"):
        text = py_file.read_text()
        # Verify get_attention_modules does not use string matching on model family
        if py_file.name == "architecture.py":
            assert 'family == "roberta"' not in text
            assert 'family == "gpt2"' not in text