def test_variable_array(self):
        """Test converting a variable to an array."""
        v = backend.Variable(initializer=np.array([1.0, 2.0, 3.0]))
        self.assertAllClose(v.__array__(), np.array([1.0, 2.0, 3.0]))
Test converting a variable to an array.
keras/src/backend/common/variables_test.py