def retrieve_seq_length_op2(data):
 return tf.reduce_sum(tf.cast(tf.greater(data, tf.zeros_like(data)), tf.int32), 1)

def retrieve_seq_length_op2 ( data ) : return tf . reduce_sum ( tf . cast ( tf . greater ( data , tf . zeros_like ( data ) ) , tf . int32 ) , 1 )
an op to compute the length of a sequence .