code: def test_in_allow_downcast_floatX(self):
      a = theano.tensor.fscalar("a")
      b = theano.tensor.fscalar("b")
      c = theano.tensor.fscalar("c")
  
      f = theano.function(
          [
              In(a, allow_downcast=True),
              In(b, allow_downcast=False),
              In(c, allow_downcast=None),
          ],
          (a + b + c),
      )
  
      # If the values can be accurately represented, everything is OK
      assert np.all(f(0, 0, 0) == 0)
  
      # If allow_downcast is True, idem
      assert np.allclose(f(0.1, 0, 0), 0.1)
  
      # If allow_downcast is False, nope
      self.assertRaises(TypeError, f, 0, 0.1, 0)
  
      # If allow_downcast is None, it should work iff floatX=float32
      if theano.config.floatX == "float32":
          assert np.allclose(f(0, 0, 0.1), 0.1)
      else:
          self.assertRaises(TypeError, f, 0, 0, 0.1)
  
imports: from __future__ import absolute_import, print_function, division
  import six.moves.cPickle
  import os
  import shutil
  import tempfile
  import unittest
  import numpy
  import theano
  from theano.compile.io import In
label_desc: Use image node_id 9 for calling the TestFunctionIn obj's underlying member method code with example usage: obj.test_in_allow_downcast_floatX() without return types