code: def test_compute_sen_lens(self):
      sentences = tf.placeholder(dtype=tf.int32)
      lens = compute_sen_lens(sentences)
  
      with self.cached_session(use_gpu=False, force_gpu=False) as sess:
          # test for 1d
          res = sess.run(lens, feed_dict={sentences: [1, 2, 0, 0]})
          self.assertEqual(res, 2)
  
          # test for 2d
          res = sess.run(
              lens, feed_dict={sentences: [[1, 2, 0, 0], [1, 2, 3, 4]]}
          )
          self.assertAllEqual(res, [2, 4])
  
          # test for 3d
          res = sess.run(
              lens,
              feed_dict={
                  sentences: [
                      [[1, 2, 0, 0]],
                      [[1, 2, 3, 4]],
                      [[1, 0, 0, 0]],
                  ]
              },
          )
          self.assertAllEqual(res, [[2], [4], [1]])
  
file_path: delta/delta/layers/utils_test.py
imports: from absl import logging
  import delta.compat
  from delta.layers import utils
  from delta.layers.utils import cut_or_padding
  from delta.layers.utils import compute_sen_lens
  from delta.layers.utils import compute_doc_lens
  from delta.layers.utils import split_one_doc_to_true_len_sens
label_desc: Use image node_id 5 for calling the LayerUtilsTest obj's underlying member method code with example usage: obj.test_compute_sen_lens() without return types