def METHOD_NAME(self):
    mask = np.array([True, False, True, True])
    y_true = np.array([1.0, 0.0, 1.0, 0.0])
    y_pred = np.array([0.1, 0.2, 0.3, 0.4])
    masked_y_true = np.array([1.0, 1.0, 0.0])
    masked_y_pred = np.array([0.1, 0.3, 0.4])
    mask = ops.convert_to_tensor(mask)
    y_true = ops.convert_to_tensor(y_true)
    y_pred = ops.convert_to_tensor(y_pred)
    y_pred._keras_mask = mask
    loss_fn = ExampleLoss()
    loss = loss_fn(y_true, y_pred)
    self.assertEqual(backend.standardize_dtype(loss.dtype), "float32")
    self.assertAllClose(
        np.sum((masked_y_true - masked_y_pred) ** 2) / 3, loss
    )
    # Test edge case where everything is masked.
    mask = np.array([False, False, False, False])
    y_pred._keras_mask = mask
    loss = loss_fn(y_true, y_pred)
    self.assertEqual(backend.standardize_dtype(loss.dtype), "float32")
    self.assertAllClose(loss, 0)  # No NaN.