22import functools
33import itertools
44import math
5- import re
65
76import numpy as np
87import pytest
@@ -159,12 +158,6 @@ def sample_inputs_horizontal_flip_video():
159158 KernelInfo (
160159 F .horizontal_flip_bounding_box ,
161160 sample_inputs_fn = sample_inputs_horizontal_flip_bounding_box ,
162- test_marks = [
163- TestMark (
164- ("TestKernels" , "test_scripted_vs_eager" ),
165- pytest .mark .filterwarnings (f"ignore:{ re .escape ('operator() profile_node %72' )} :UserWarning" ),
166- )
167- ],
168161 ),
169162 KernelInfo (
170163 F .horizontal_flip_mask ,
@@ -2045,17 +2038,11 @@ def sample_inputs_convert_dtype_video():
20452038 yield ArgsKwargs (video_loader )
20462039
20472040
2048- _common_convert_dtype_marks = [
2049- TestMark (
2050- ("TestKernels" , "test_dtype_and_device_consistency" ),
2051- pytest .mark .skip (reason = "`convert_dtype_*` kernels convert the dtype by design" ),
2052- condition = lambda args_kwargs : args_kwargs .args [0 ].dtype != args_kwargs .kwargs .get ("dtype" , torch .float32 ),
2053- ),
2054- TestMark (
2055- ("TestKernels" , "test_scripted_vs_eager" ),
2056- pytest .mark .filterwarnings (f"ignore:{ re .escape ('operator() profile_node %' )} :UserWarning" ),
2057- ),
2058- ]
2041+ skip_dtype_consistency = TestMark (
2042+ ("TestKernels" , "test_dtype_and_device_consistency" ),
2043+ pytest .mark .skip (reason = "`convert_dtype_*` kernels convert the dtype by design" ),
2044+ condition = lambda args_kwargs : args_kwargs .args [0 ].dtype != args_kwargs .kwargs .get ("dtype" , torch .float32 ),
2045+ )
20592046
20602047KERNEL_INFOS .extend (
20612048 [
@@ -2065,7 +2052,7 @@ def sample_inputs_convert_dtype_video():
20652052 reference_fn = reference_convert_dtype_image_tensor ,
20662053 reference_inputs_fn = reference_inputs_convert_dtype_image_tensor ,
20672054 test_marks = [
2068- * _common_convert_dtype_marks ,
2055+ skip_dtype_consistency ,
20692056 TestMark (
20702057 ("TestKernels" , "test_against_reference" ),
20712058 pytest .mark .xfail (reason = "Conversion overflows" ),
@@ -2083,7 +2070,9 @@ def sample_inputs_convert_dtype_video():
20832070 KernelInfo (
20842071 F .convert_dtype_video ,
20852072 sample_inputs_fn = sample_inputs_convert_dtype_video ,
2086- test_marks = _common_convert_dtype_marks ,
2073+ test_marks = [
2074+ skip_dtype_consistency ,
2075+ ],
20872076 ),
20882077 ]
20892078)
0 commit comments