@@ -3758,12 +3758,18 @@ def test_transform_errors_warnings(self):
3758
3758
with pytest .raises (ValueError , match = "provide only two dimensions" ):
3759
3759
transforms .RandomResizedCrop (size = (1 , 2 , 3 ))
3760
3760
3761
- with pytest .raises (TypeError , match = "Scale should be a sequence" ):
3761
+ with pytest .raises (TypeError , match = "Scale should be a sequence of two floats. " ):
3762
3762
transforms .RandomResizedCrop (size = self .INPUT_SIZE , scale = 123 )
3763
3763
3764
- with pytest .raises (TypeError , match = "Ratio should be a sequence" ):
3764
+ with pytest .raises (TypeError , match = "Ratio should be a sequence of two floats. " ):
3765
3765
transforms .RandomResizedCrop (size = self .INPUT_SIZE , ratio = 123 )
3766
3766
3767
+ with pytest .raises (TypeError , match = "Ratio should be a sequence of two floats." ):
3768
+ transforms .RandomResizedCrop (size = self .INPUT_SIZE , ratio = [1 , 2 , 3 ])
3769
+
3770
+ with pytest .raises (TypeError , match = "Scale should be a sequence of two floats." ):
3771
+ transforms .RandomResizedCrop (size = self .INPUT_SIZE , scale = [1 , 2 , 3 ])
3772
+
3767
3773
for param in ["scale" , "ratio" ]:
3768
3774
with pytest .warns (match = "Scale and ratio should be of kind" ):
3769
3775
transforms .RandomResizedCrop (size = self .INPUT_SIZE , ** {param : [1 , 0 ]})
0 commit comments