code: def test_convert_variable():
      test_type = TensorType(config.floatX, shape=(None, None))
      test_var = test_type()
  
      test_type2 = TensorType(config.floatX, shape=(1, None))
      test_var2 = test_type2()
  
      res = test_type.convert_variable(test_var)
      assert res is test_var
  
      res = test_type.convert_variable(test_var2)
      assert res is test_var2
  
      res = test_type2.convert_variable(test_var)
      assert res.type == test_type2
  
      test_type3 = TensorType(config.floatX, shape=(1, None, 1))
      test_var3 = test_type3()
  
      res = test_type2.convert_variable(test_var3)
      assert res is None
  
      const_var = pt.as_tensor([[1, 2], [3, 4]], dtype=config.floatX)
      res = test_type.convert_variable(const_var)
      assert res is const_var
  
imports: import os.path
  from tempfile import mkdtemp
  import numpy
  import pytest
  import pytensor.tensor
  from pytensor.configdefaults import config
  from pytensor.tensor.shape import SpecifyShape
  from pytensor.tensor.type import TensorType, col, matrix, row, scalar, tensor, tensor3, tensor4, tensor5, tensor6, tensor7, vector
label_desc: Use image node_id 4 for calling a global function with example usage: test_convert_variable() without return types