code: def test_allow_input_downcast_int(self):
      a = wvector("a")  # int16
      b = bvector("b")  # int8
      c = bscalar("c")  # int8
  
      f = pfunc([a, b, c], (a + b + c), allow_input_downcast=True)
      # Value too big for a, b, or c, silently ignored
      assert f([2**20], [1], 0) == 1
      assert f([3], [312], 0) == 59
      assert f([3], [1], 806) == 42
  
      g = pfunc([a, b, c], (a + b + c), allow_input_downcast=False)
      # All values are in range. Since they're not ndarrays (but lists
      # or scalars), they will be converted, and their value checked.
      assert np.all(g([3], [6], 0) == 9)
  
      # Values are in range, but a dtype too large has explicitly been given
      # For performance reasons, no check of the data is explicitly performed
      # (It might be OK to change this in the future.)
      with pytest.raises(TypeError):
          g([3], np.array([6], dtype="int16"), 0)
  
      # Value too big for b, raises TypeError
      with pytest.raises(TypeError):
          g([3], [312], 0)
  
      h = pfunc(
          [a, b, c], (a + b + c)
      )  # Default: allow_input_downcast=None
      # Everything here should behave like with False
      assert np.all(h([3], [6], 0) == 9)
      with pytest.raises(TypeError):
          h([3], np.array([6], dtype="int16"), 0)
      with pytest.raises(TypeError):
          h([3], [312], 0)
  
imports: import numpy
  import pytest
  import pytensor.tensor
  from pytensor.compile import UnusedInputError, get_mode
  from pytensor.compile.function import function, pfunc
  from pytensor.compile.function.pfunc import rebuild_collect_shared
  from pytensor.compile.io import In
  from pytensor.compile.sharedvalue import shared
  from pytensor.configdefaults import config
  from pytensor.graph.utils import MissingInputError
  from pytensor.misc.safe_asarray import _asarray
  from pytensor.tensor.math import sum
  from pytensor.tensor.type import bscalar, bvector, dmatrices, dmatrix, dscalar, dvector, fscalar, fvector, imatrix, iscalar, ivector, ivectors, lscalar, wvector
  from pytensor.utils import PYTHON_INT_BITWIDTH
label_desc: Use image node_id 13 for calling the TestPfunc obj's underlying member method code with example usage: obj.test_allow_input_downcast_int() without return types