code: def test_use_numpy_strict_false(self):
      # here the value is perfect, and we're not strict about it,
      # so creation should work
      u = SharedVariable(
          name="u",
          type=TensorType(dtype="float64", shape=(None,)),
          value=np.asarray([1.0, 2.0]),
          strict=False,
      )
  
      # check that assignments to value are cast properly
      u.set_value([3, 4])
      assert type(u.get_value()) is np.ndarray
      assert str(u.get_value(borrow=True).dtype) == "float64"
      assert np.all(u.get_value() == [3, 4])
  
      # check that assignments of nonsense fail
      try:
          u.set_value("adsf")
          assert 0
      except ValueError:
          pass
  
      # check that an assignment of a perfect value results in no copying
      uval = _asarray([5, 6, 7, 8], dtype="float64")
      u.set_value(uval, borrow=True)
      assert u.get_value(borrow=True) is uval
  
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 4 for calling the TestSharedVariable obj's underlying member method code with example usage: obj.test_use_numpy_strict_false() without return types