code: def testScanSumWithDecaysReverseWithSeqLen(self):
      with self.test_session() as sess:
          sequence = [[3, 1, 5], [-1.7, 1.2, 2.3]]
          decays = [[0.5, 0.9, 1.0], [0.9, 0.5, 0.3]]
          sequence_lengths = [2, 0]
          # We use transpose because it is easier to define the input data in
          # BxT (batch x time) form, while scan_discounted_sum assumes TxB form.
          sequence_in = tf.transpose(
              tf.constant(sequence, dtype=tf.float32)
          )
          decays_in = tf.transpose(
              tf.constant(decays, dtype=tf.float32)
          )
          bootstrap = tf.constant([2.5, 1.5], dtype=tf.float32)
          result = sequence_ops.scan_discounted_sum(
              sequence_in,
              decays_in,
              bootstrap,
              reverse=True,
              sequence_lengths=sequence_lengths,
          )
          expected_result = tf.constant(
              [
                  [(0.9 * 2.5 + 1) * 0.5 + 3, (0.9 * 2.5 + 1), 0],
                  [0, 0, 0],
              ],
              dtype=tf.float32,
          )
          self.assertAllClose(
              sess.run(result), sess.run(tf.transpose(expected_result))
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from six.moves import xrange
  import tensorflow.compat.v1
  from trfl import sequence_ops
label_desc: Use image node_id 7 for calling the ScanDiscountedSumTest obj's underlying member method code with example usage: obj.testScanSumWithDecaysReverseWithSeqLen() without return types