class_docstr: Tests of CGemv specifically.
  
  Generic tests of Gemv-compatibility, including both dtypes are
  done below in TestCGemvFloat32 and TestCGemvFloat64
class_docstr_tok: ["Tests","of","CGemv","specifically",".","Generic","tests","of","Gemv-compatibility",",","including","both","dtypes","are","done","below","in","TestCGemvFloat32","and","TestCGemvFloat64"]
code: def test_gemv_dimensions(self, dtype="float32"):
      alpha = pytensor.shared(_asarray(1.0, dtype=dtype), name="alpha")
      beta = pytensor.shared(_asarray(1.0, dtype=dtype), name="beta")
  
      z = beta * self.y + alpha * pt.dot(self.A, self.x)
      f = pytensor.function([self.A, self.x, self.y], z, mode=self.mode)
  
      # Matrix value
      A_val = np.ones((5, 3), dtype=dtype)
      # Different vector length
      ones_3 = np.ones(3, dtype=dtype)
      ones_4 = np.ones(4, dtype=dtype)
      ones_5 = np.ones(5, dtype=dtype)
      ones_6 = np.ones(6, dtype=dtype)
  
      f(A_val, ones_3, ones_5)
      f(A_val[::-1, ::-1], ones_3, ones_5)
      with pytest.raises(ValueError):
          f(A_val, ones_4, ones_5)
      with pytest.raises(ValueError):
          f(A_val, ones_3, ones_6)
      with pytest.raises(ValueError):
          f(A_val, ones_4, ones_6)
  
imports: from warnings import warn
  import numpy
  import pytest
  import pytensor
  import pytensor.tensor
  from pytensor.misc.safe_asarray import _asarray
  from pytensor.tensor.basic import AllocEmpty
  from pytensor.tensor.blas import Ger
  from pytensor.tensor.blas_c import CGemv, CGer, check_force_gemv_init
  from pytensor.tensor.blas_scipy import ScipyGer
  from pytensor.tensor.type import dmatrix, dvector, matrix, scalar, tensor, vector
  from tests import unittest_tools
  from tests.tensor.test_blas import BaseGemv, TestBlasStrides
  from tests.unittest_tools import OptimizationTestMixin
label_desc: Use image node_id 8 for calling the TestCGemv obj's underlying member method code with example usage: obj.test_gemv_dimensions(dtype) without return types