class_docstr: Test class for the PushOutScanOutput optimizer in the case where the inner
  function of a scan op has an output which is the result of a Dot product
  on a non-sequence matrix input to scan and a vector that is the result of
  computation in the inner function.
class_docstr_tok: ["Test","class","for","the","PushOutScanOutput","optimizer","in","the","case","where","the","inner","function","of","a","scan","op","has","an","output","which","is","the","result","of","a","Dot","product","on","a","non-sequence","matrix","input","to","scan","and","a","vector","that","is","the","result","of","computation","in","the","inner","function","."]
code: def test_dot_sitsot_output(self):
      # Test the case where the vector input to the dot is not already a
      # non-nitsot (in this case a sitsot) output of the inner function.
  
      a = T.matrix()
      b = T.matrix()
  
      def inner_fct(seq1, previous_output1, nonseq1):
          output1 = previous_output1 + seq1
          output2 = T.dot(output1, nonseq1)
          return output1, output2
  
      outputs, updates = theano.scan(
          fn=inner_fct,
          outputs_info=[a[0], None],
          sequences=a,
          non_sequences=b,
      )
  
      # Compile the function twice, once with the optimization and once
      # without
      opt_mode = mode.including("scan")
      f_opt = theano.function([a, b], outputs, mode=opt_mode)
  
      no_opt_mode = mode.excluding("scanOp_pushout_output")
      f_no_opt = theano.function([a, b], outputs, mode=no_opt_mode)
  
      # Ensure that the optimization was performed correctly in f_opt
      # The inner function of scan should have only one output and it should
      # not be the result of a Dot
      scan_node = [
          node
          for node in f_opt.maker.fgraph.toposort()
          if isinstance(node.op, Scan)
      ][0]
      assert len(scan_node.op.outputs) == 2
      assert not isinstance(scan_node.op.outputs[0], T.Dot)
  
      # Ensure that the function compiled with the optimization produces
      # the same results as the function compiled without
      a_value = np.random.random((3, 4)).astype(config.floatX)
      b_value = np.random.random((4, 5)).astype(config.floatX)
  
      output_opt = f_opt(a_value, b_value)
      output_no_opt = f_no_opt(a_value, b_value)
  
      utt.assert_allclose(output_opt[0], output_no_opt[0])
      utt.assert_allclose(output_opt[1], output_no_opt[1])
  
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 3 for calling the TestPushOutScanOutputDot obj's underlying member method code with example usage: obj.test_dot_sitsot_output() and returns: output1,  output2