@@ -6768,17 +6768,31 @@ def test_invalid_input_type(self):
67686768 F .to_cvcuda_tensor ("invalid_input" )
67696769
67706770 def test_invalid_dimensions (self ):
6771- with pytest .raises (ValueError , match = r"pic should be 3 or 4 dimensional" ):
6771+ with pytest .raises (ValueError , match = r"pic should be 4 dimensional" ):
6772+ img_data = torch .randint (
6773+ 0 ,
6774+ 256 ,
6775+ (
6776+ 3 ,
6777+ 12 ,
6778+ 34 ,
6779+ ),
6780+ dtype = torch .uint8 ,
6781+ )
6782+ img_data = img_data .cuda ()
6783+ F .to_cvcuda_tensor (img_data )
6784+
6785+ with pytest .raises (ValueError , match = r"pic should be 4 dimensional" ):
67726786 img_data = torch .randint (0 , 256 , (4 ,), dtype = torch .uint8 )
67736787 img_data = img_data .cuda ()
67746788 F .to_cvcuda_tensor (img_data )
67756789
6776- with pytest .raises (ValueError , match = r"pic should be 3 or 4 dimensional" ):
6790+ with pytest .raises (ValueError , match = r"pic should be 4 dimensional" ):
67776791 img_data = torch .randint (0 , 256 , (4 , 4 ), dtype = torch .uint8 )
67786792 img_data = img_data .cuda ()
67796793 F .to_cvcuda_tensor (img_data )
67806794
6781- with pytest .raises (ValueError , match = r"pic should be 3 or 4 dimensional" ):
6795+ with pytest .raises (ValueError , match = r"pic should be 4 dimensional" ):
67826796 img_data = torch .randint (0 , 256 , (1 , 1 , 3 , 4 , 4 ), dtype = torch .uint8 )
67836797 img_data = img_data .cuda ()
67846798 F .to_cvcuda_tensor (img_data )
0 commit comments