code: def test_tensor_floatX(self):
      def f(var, val):
          var.set_value(val)
  
      b = shared(np.int64([7]), allow_downcast=True)
      assert b.type == lvector
      f(b, [8.23])
      assert b.get_value() == 8
  
      b = shared(np.int32([7]), allow_downcast=True)
      assert b.type == ivector
      f(b, [8.23])
      assert b.get_value() == 8
  
      b = shared(np.int16([7]), allow_downcast=True)
      assert b.type == wvector
      f(b, [8.23])
      assert b.get_value() == 8
  
      b = shared(np.int8([7]), allow_downcast=True)
      assert b.type == bvector
      f(b, [8.23])
      assert b.get_value() == 8
  
      b = shared(np.float64([7.234]), allow_downcast=True)
      assert b.type == dvector
      f(b, [8])
      assert b.get_value() == 8
  
      b = shared(np.float32([7.234]), allow_downcast=True)
      assert b.type == fvector
      f(b, [8])
      assert b.get_value() == 8
  
      # float([7.234]) don't work
      #        b = shared(float([7.234]))
      #        assert b.type == dvector
      #        f(b,[8])
  
      # This generate a generic type. Should we cast? I don't think.
      #        b = shared([7.234])
      #        assert b.type == dvector
      #        f(b,[8])
  
      b = shared(
          np.asarray([7.234], dtype=config.floatX), allow_downcast=True
      )
      assert b.dtype == config.floatX
      f(b, [8])
      assert b.get_value() == 8
  
      b = shared(np.zeros((5, 5), dtype="float32"))
      with pytest.raises(TypeError):
          f(b, np.random.random((5, 5)))
  
file_path: pytensor/tests/compile/test_shared.py
imports: import numpy
  import pytest
  import pytensor.tensor
  from pytensor.compile.sharedvalue import SharedVariable, shared
  from pytensor.configdefaults import config
  from pytensor.link.c.type import generic
  from pytensor.misc.safe_asarray import _asarray
  from pytensor.tensor.type import TensorType, bscalar, bvector, dscalar, dvector, fscalar, fvector, iscalar, ivector, lscalar, lvector, wscalar, wvector
  from pytensor.utils import PYTHON_INT_BITWIDTH
label_desc: Use image node_id 8 for calling the TestSharedVariable obj's underlying member method code with example usage: obj.test_tensor_floatX() without return types