code: def test_gpu3_mixture_dtype_outputs(self):
      def f_rnn(u_t, x_tm1, W_in, W):
          return (
              u_t * W_in + x_tm1 * W,
              theano.tensor.cast(u_t + x_tm1, "int64"),
          )
  
      u = theano.tensor.fvector("u")
      x0 = theano.tensor.fscalar("x0")
      W_in = theano.tensor.fscalar("win")
      W = theano.tensor.fscalar("w")
      output, updates = theano.scan(
          f_rnn,
          u,
          [x0, None],
          [W_in, W],
          n_steps=None,
          truncate_gradient=-1,
          go_backwards=False,
          mode=mode_with_gpu,
      )
  
      f2 = theano.function(
          [u, x0, W_in, W],
          output,
          updates=updates,
          allow_input_downcast=True,
          mode=mode_with_gpu,
      )
  
      # get random initial values
      rng = np.random.RandomState(utt.fetch_seed())
      v_u = rng.uniform(size=(4,), low=-5.0, high=5.0)
      v_x0 = rng.uniform()
      W = rng.uniform()
      W_in = rng.uniform()
  
      # compute the output in numpy
      v_out1 = np.zeros((4,))
      v_out2 = np.zeros((4,), dtype="int64")
      v_out1[0] = v_u[0] * W_in + v_x0 * W
      v_out2[0] = v_u[0] + v_x0
      for step in xrange(1, 4):
          v_out1[step] = v_u[step] * W_in + v_out1[step - 1] * W
          v_out2[step] = np.int64(v_u[step] + v_out1[step - 1])
  
      theano_out1, theano_out2 = f2(v_u, v_x0, W_in, W)
      utt.assert_allclose(theano_out1, v_out1)
      utt.assert_allclose(theano_out2, v_out2)
  
      topo = f2.maker.fgraph.toposort()
      scan_node = [
          node
          for node in topo
          if isinstance(node.op, theano.scan_module.scan_op.Scan)
      ]
      assert len(scan_node) == 1
      scan_node = scan_node[0]
      assert scan_node.op.gpua
  
      scan_node_topo = scan_node.op.fn.maker.fgraph.toposort()
  
      # check that there is no gpu transfer in the inner loop.
      assert not any(
          [isinstance(node.op, HostFromGpu) for node in scan_node_topo]
      )
      assert not any(
          [isinstance(node.op, GpuFromHost) for node in scan_node_topo]
      )
  
file_path: Theano/theano/gpuarray/tests/test_scan.py
imports: from __future__ import absolute_import, print_function, division
  from unittest import TestCase
  import numpy
  from six.moves import xrange
  import theano
  from theano.tests import unittest_tools
  import theano.sandbox.rng_mrg
  from ..basic_ops import GpuFromHost, HostFromGpu
  from ..elemwise import GpuElemwise
  from .config import mode_with_gpu, test_ctx_name
label_desc: Use image node_id 4 for calling the T_Scan obj's underlying member method code with example usage: obj.test_gpu3_mixture_dtype_outputs() and returns: unknown,  theano