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