Skip to content

Commit

Permalink
- Removed unnecessary padding op
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaspi committed Aug 2, 2022
1 parent 50690b0 commit 26c133e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions tensorflow_addons/metrics/kendalls_tau.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,9 @@ def update_state(self, y_true, y_pred, sample_weight=None):

def result(self):
m = tf.cast(self.m, tf.float32)
n_cap = tf.cumsum(
tf.cumsum(
tf.slice(tf.pad(m, [[1, 0], [1, 0]]), [0, 0], self.m.shape),
axis=0,
),
axis=1,
)
n_cap = tf.cumsum(tf.cumsum(m, axis=0), axis=1)
# Number of concordant pairs.
p = tf.math.reduce_sum(tf.multiply(n_cap, m))
p = tf.math.reduce_sum(tf.multiply(n_cap[:-1, :-1], m[1:, 1:]))
sum_m_squard = tf.math.reduce_sum(tf.math.square(m))
# Ties in x.
t = (
Expand Down

0 comments on commit 26c133e

Please sign in to comment.