test_identical_vectors() — langchain Function Reference
Architecture documentation for the test_identical_vectors() function in test_utils.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD f53a0cd5_81c3_2a36_2017_9b764a80c9f4["test_identical_vectors()"] 43305d93_a58a_e7db_615b_b8a5a18284ab["TestCosineSimilarity"] f53a0cd5_81c3_2a36_2017_9b764a80c9f4 -->|defined in| 43305d93_a58a_e7db_615b_b8a5a18284ab style f53a0cd5_81c3_2a36_2017_9b764a80c9f4 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/vectorstores/test_utils.py lines 25–31
def test_identical_vectors(self) -> None:
"""Test cosine similarity of identical vectors."""
x: list[list[float]] = [[1, 2, 3]]
y: list[list[float]] = [[1, 2, 3]]
result = _cosine_similarity(x, y)
expected = np.array([[1.0]])
np.testing.assert_array_almost_equal(result, expected)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_identical_vectors() do?
test_identical_vectors() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/vectorstores/test_utils.py.
Where is test_identical_vectors() defined?
test_identical_vectors() is defined in libs/core/tests/unit_tests/vectorstores/test_utils.py at line 25.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free