class_docstr: Test case for the PushOutScanOutput optimizer in the case where the scan
  is used to compute the sum over the dot products between the corresponding
  elements of two list of matrices.
class_docstr_tok: ["Test","case","for","the","PushOutScanOutput","optimizer","in","the","case","where","the","scan","is","used","to","compute","the","sum","over","the","dot","products","between","the","corresponding","elements","of","two","list","of","matrices","."]
code: def test_non_zero_init(self):
      # Test the case where the initial value for the nitsot output is non-zero
  
      input1 = T.tensor3()
      input2 = T.tensor3()
      input3 = T.tensor3()
  
      W = theano.shared(np.random.normal(size=(4, 5))).astype(
          config.floatX
      )
      U = theano.shared(np.random.normal(size=(6, 7))).astype(
          config.floatX
      )
  
      def inner_fct(seq1, seq2, seq3, previous_output):
          temp1 = T.dot(seq1, W) + seq3
          temp2 = T.dot(seq2, U)
          dot_output = T.dot(temp1, temp2)
          return previous_output + dot_output
  
      init = T.as_tensor_variable(np.random.normal(size=(3, 7)))
  
      # Compile the function twice, once with the optimization and once
      # without
      opt_mode = mode.including("scan")
      h, _ = theano.scan(
          inner_fct,
          sequences=[input1, input2, input3],
          outputs_info=init,
          mode=opt_mode,
      )
      output = h[-1]
      f_opt = theano.function(
          [input1, input2, input3], output, mode=opt_mode
      )
  
      no_opt_mode = mode.excluding("scanOp_pushout_output")
      h, _ = theano.scan(
          inner_fct,
          sequences=[input1, input2, input3],
          outputs_info=init,
          mode=no_opt_mode,
      )
      output = h[-1]
      f_no_opt = theano.function(
          [input1, input2, input3], output, mode=no_opt_mode
      )
  
      # Ensure that the optimization has been applied for f_opt
      # TODO
  
      # Compare the outputs of the 2 functions
      input1_value = np.random.random((2, 3, 4)).astype(config.floatX)
      input2_value = np.random.random((2, 5, 6)).astype(config.floatX)
      input3_value = np.random.random((2, 3, 5)).astype(config.floatX)
  
      output_opt = f_opt(input1_value, input2_value, input3_value)
      output_no_opt = f_no_opt(input1_value, input2_value, input3_value)
  
      utt.assert_allclose(output_opt, output_no_opt)
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import unittest
  import theano
  from theano import config
  from theano import tensor
  from theano.scan_module.scan_op import Scan
  from theano.tests import unittest_tools
label_desc: Use image node_id 2 for calling the TestPushOutSumOfDot obj's underlying member method code with example usage: obj.test_non_zero_init() and returns: unknown