Skip to content

Commit 71d41ef

Browse files
author
Ashley Scillitoe
authored
Replace indexing with tf.gather (#710)
1 parent 7d6739c commit 71d41ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

alibi_detect/cd/tensorflow/mmd_online.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def _configure_thresholds(self):
167167

168168
def _update_state(self, x_t: np.ndarray): # type: ignore[override]
169169
self.t += 1
170-
kernel_col = self.kernel(self.x_ref[self.ref_inds], x_t)
170+
kernel_col = self.kernel(tf.gather(self.x_ref, self.ref_inds), x_t)
171171
self.test_window = tf.concat([self.test_window[(1 - self.window_size):], x_t], axis=0)
172172
self.k_xy = tf.concat([self.k_xy[:, (1 - self.window_size):], kernel_col], axis=1)
173173

0 commit comments

Comments
 (0)