test_dimension_mismatch_error() — langchain Function Reference
Architecture documentation for the test_dimension_mismatch_error() function in test_utils.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 633f06a6_8f49_982a_53a1_43affd8662ba["test_dimension_mismatch_error()"] 43305d93_a58a_e7db_615b_b8a5a18284ab["TestCosineSimilarity"] 633f06a6_8f49_982a_53a1_43affd8662ba -->|defined in| 43305d93_a58a_e7db_615b_b8a5a18284ab style 633f06a6_8f49_982a_53a1_43affd8662ba fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/vectorstores/test_utils.py lines 102–110
def test_dimension_mismatch_error(self) -> None:
"""Test error when matrices have different number of columns."""
x: list[list[float]] = [[1, 2]] # 2 columns
y: list[list[float]] = [[1, 2, 3]] # 3 columns
with pytest.raises(
ValueError, match="Number of columns in X and Y must be the same"
):
_cosine_similarity(x, y)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_dimension_mismatch_error() do?
test_dimension_mismatch_error() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/vectorstores/test_utils.py.
Where is test_dimension_mismatch_error() defined?
test_dimension_mismatch_error() is defined in libs/core/tests/unit_tests/vectorstores/test_utils.py at line 102.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free