code: def seq_len(sequence):
      """
      assume padding with zero vectors
      sequence: [batch_size, num_steps, features]
      length: [batch_size]
      """
      used = tf.sign(tf.reduce_max(tf.abs(sequence), 2))
      length = tf.reduce_sum(used, 1)
      length = tf.cast(length, tf.int32)
      return length
  
imports: import tensorflow
  from tensorflow.contrib import rnn
  from tensorflow.python.ops import array_ops
  from ..models.basic_model import BasicModel
  import numpy
  import os
label_desc: Use image node_id 3 for calling a global function with example usage: seq_len(sequence) and returns: length