code: def compute_doc_lens(sen_lens):
      """
      Count how many sentences in a document.
      inputs: [..., time_steps]
      doc_lens: [...]
      """
      x_binary = tf.cast(tf.cast(sen_lens, tf.bool), tf.int32)
      doc_lens = tf.reduce_sum(x_binary, axis=-1)
      return doc_lens
  
file_path: delta/delta/layers/utils.py
imports: import math
  import delta.compat
  from tensorflow.python.keras import backend
  import delta.utils
label_desc: Use image node_id 4 for calling a global function with example usage: compute_doc_lens(sen_lens) and returns: doc_lens