From 9bb1d1c0745ac5ca6ed6dbbdde41562841a83144 Mon Sep 17 00:00:00 2001 From: braceletboy Date: Wed, 10 Jun 2026 21:14:39 -0400 Subject: [PATCH] Fix shape mismatch error in ROAD --- quantus/metrics/faithfulness/road.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/quantus/metrics/faithfulness/road.py b/quantus/metrics/faithfulness/road.py index d9b34856..1015adbc 100644 --- a/quantus/metrics/faithfulness/road.py +++ b/quantus/metrics/faithfulness/road.py @@ -313,14 +313,9 @@ def evaluate_batch( scores_batch: The evaluation results. """ - # Prepare shapes. Expand a_batch if not the same shape - if x_batch.shape != a_batch.shape: - a_batch = np.broadcast_to(a_batch, x_batch.shape) - # Flatten the attributions. batch_size = a_batch.shape[0] a_batch = a_batch.reshape(batch_size, -1) - n_features = a_batch.shape[-1] # Get indices of sorted attributions (descending). ordered_indices = np.argsort(-a_batch, axis=1)