Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions quantus/metrics/faithfulness/road.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading