Home / Function/ test_single_empty_matrix() — langchain Function Reference

test_single_empty_matrix() — langchain Function Reference

Architecture documentation for the test_single_empty_matrix() function in test_utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  4f6c991e_02c7_a19a_c15d_255319d3a8a0["test_single_empty_matrix()"]
  43305d93_a58a_e7db_615b_b8a5a18284ab["TestCosineSimilarity"]
  4f6c991e_02c7_a19a_c15d_255319d3a8a0 -->|defined in| 43305d93_a58a_e7db_615b_b8a5a18284ab
  style 4f6c991e_02c7_a19a_c15d_255319d3a8a0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/vectorstores/test_utils.py lines 94–100

    def test_single_empty_matrix(self) -> None:
        """Test with one empty matrix."""
        x: list[list[float]] = []
        y: list[list[float]] = [[1, 2, 3]]
        result = _cosine_similarity(x, y)
        expected = np.array([[]])
        np.testing.assert_array_equal(result, expected)

Domain

Subdomains

Frequently Asked Questions

What does test_single_empty_matrix() do?
test_single_empty_matrix() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/vectorstores/test_utils.py.
Where is test_single_empty_matrix() defined?
test_single_empty_matrix() is defined in libs/core/tests/unit_tests/vectorstores/test_utils.py at line 94.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free