Skip to content

Commit

Permalink
Use tf.math.mod instead of % (#1931)
Browse files Browse the repository at this point in the history
  • Loading branch information
roomrys authored Aug 31, 2024
1 parent fa1c1b7 commit 35463a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sleap/nn/peak_finding.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def find_global_peaks_rough(
channels = tf.cast(tf.shape(cms)[-1], tf.int64)
total_peaks = tf.cast(tf.shape(argmax_cols)[0], tf.int64)
sample_subs = tf.range(total_peaks, dtype=tf.int64) // channels
channel_subs = tf.range(total_peaks, dtype=tf.int64) % channels
channel_subs = tf.math.mod(tf.range(total_peaks, dtype=tf.int64), channels)

# Gather subscripts.
peak_subs = tf.stack([sample_subs, argmax_rows, argmax_cols, channel_subs], axis=1)
Expand Down

0 comments on commit 35463a1

Please sign in to comment.