def METHOD_NAME(self):
    with self.cached_session():
        metric = metrics.sparse_categorical_accuracy
        y_true = backend.variable(np.random.random((6,)))
        y_pred = backend.variable(np.random.random((6, 7)))
        self.assertEqual(backend.eval(metric(y_true, y_pred)).shape, (6,))