def test_variable_numpy(self):
        """Test retrieving the value of a variable as a numpy array."""
        v = backend.Variable(initializer=np.array([1.0, 2.0, 3.0]))
        self.assertIsInstance(v.numpy(), np.ndarray)
        self.assertAllClose(v.numpy(), np.array([1.0, 2.0, 3.0]))
Test retrieving the value of a variable as a numpy array.
keras/src/backend/common/variables_test.py