code: def test_scalar_strict(self):
      def f(var, val):
          var.set_value(val)
  
      b = shared(np.int64(7), strict=True)
      assert b.type == theano.tensor.lscalar
      self.assertRaises(TypeError, f, b, 8.23)
  
      b = shared(np.int32(7), strict=True)
      assert b.type == theano.tensor.iscalar
      self.assertRaises(TypeError, f, b, 8.23)
  
      b = shared(np.int16(7), strict=True)
      assert b.type == theano.tensor.wscalar
      self.assertRaises(TypeError, f, b, 8.23)
  
      b = shared(np.int8(7), strict=True)
      assert b.type == theano.tensor.bscalar
      self.assertRaises(TypeError, f, b, 8.23)
  
      b = shared(np.float64(7.234), strict=True)
      assert b.type == theano.tensor.dscalar
      self.assertRaises(TypeError, f, b, 8)
  
      b = shared(np.float32(7.234), strict=True)
      assert b.type == theano.tensor.fscalar
      self.assertRaises(TypeError, f, b, 8)
  
      b = shared(np.float(7.234), strict=True)
      assert b.type == theano.tensor.dscalar
      self.assertRaises(TypeError, f, b, 8)
  
      b = shared(7.234, strict=True)
      assert b.type == theano.tensor.dscalar
      self.assertRaises(TypeError, f, b, 8)
  
      b = shared(np.zeros((5, 5), dtype="float32"))
      self.assertRaises(TypeError, f, b, np.random.rand(5, 5))
  
file_path: Theano/theano/compile/tests/test_shared.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import unittest
  import theano
  from theano.tensor import Tensor, TensorType
  from theano.compile.sharedvalue import shared
  from theano.compile.sharedvalue import SharedVariable
  from theano.compile.sharedvalue import generic
label_desc: Use image node_id 5 for calling the Test_SharedVariable obj's underlying member method code with example usage: obj.test_scalar_strict() without return types