tf.compat.v1.scan

scan on the list of tensors unpacked from elems on dimension 0.