diff --git a/python/conformance/conformance_test.py b/python/conformance/conformance_test.py index 8a0d0b5..1b91db5 100644 --- a/python/conformance/conformance_test.py +++ b/python/conformance/conformance_test.py @@ -223,6 +223,7 @@ def test_multinomial(input, num_samples, replacement): assert has_duplicates is False, "failed to execute multinomial" out_numpy = out_numpy.flatten() assert len(out_numpy) % num_samples == 0, "failed to execute multinomial" + assert np.all(out_numpy < input.shape[-1]), "failed to execute multinomial" def config_to_format_string(data, indent=0): diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index 99e61ca..ac24a04 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -73,6 +73,45 @@ ), ), + 'baddbmm_without_inplace': dict( + name=["baddbmm"], + interface=["torch"], + dtype=[Dtype.float32, Dtype.float16, Dtype.float64], + para=dict( + beta=[1, -0.34, 0, + 2, 0, -1.33, + 1, 0.5, 0.1], + alpha=[1, 1.33, 2, + 0, -2, 3.2, + 0.1, 0.2, -0.5], + ), + tensor_para=dict( + args=[ + { + "ins": ["input"], + "shape": ((32, 64, 16), (32, 64, 32), (168, 52, 64), + (16,), (64, 32), (1, 52, 64), + (32, 1, 16), (32, 64, 1), (64,)), + "gen_fn": Genfunc.randn, + }, + { + "ins": ["batch1"], + "shape": ((32, 64, 32), (32, 64, 8), (168, 52, 38), + (32, 64, 32), (32, 64, 8), (168, 52, 38), + (32, 64, 32), (32, 64, 8), (168, 52, 38),), + "gen_fn": Genfunc.randn, + }, + { + "ins": ["batch2"], + "shape": ((32, 32, 16), (32, 8, 32), (168, 38, 64), + (32, 32, 16), (32, 8, 32), (168, 38, 64), + (32, 32, 16), (32, 8, 32), (168, 38, 64)), + "gen_fn": Genfunc.randn, + }, + ] + ), + ), + 'conv_2d': dict( name=["conv2d"], atol=1e-3, @@ -89,12 +128,14 @@ { "ins": ["input"], "requires_grad": [True], - "shape": ((2, 256, 200, 304), (2, 2048, 64, 64), (2, 2048, 1, 1), (2, 256, 200, 304)), + "shape": ((2, 256, 200, 304), (2, 2048, 64, 64), + (2, 2048, 1, 1), (2, 256, 200, 304)), }, { "ins": ["weight"], "requires_grad": [True], - "shape": ((12, 256, 1, 1), (2048, 1, 3, 3), (512, 2048, 1, 1), (12, 256, 1, 1)), + "shape": ((12, 256, 1, 1), (2048, 1, 3, 3), + (512, 2048, 1, 1), (12, 256, 1, 1)), }, { "ins": ["bias"], @@ -149,16 +190,34 @@ args=[ { "ins": ['input'], - "shape": ((2, 4096), (64, 28, 28), + "shape": ((), (1024,), (2, 4096), (64, 28, 28), (32, 64, 112, 112), (64, 3, 7, 28, 28)), "requires_grad": [True], - "dtype": [Dtype.float32, Dtype.float64], + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], "gen_fn": Genfunc.randn, }, ], ), ), + # 生成小于-3和大于3的测例 + 'hardswish_domain': dict( + name=["hardswish"], + is_inplace=True, + tensor_para=dict( + args=[ + { + "ins": ['input'], + "shape": ((), (1024,), (2, 4096), (64, 28, 28), + (32, 64, 112, 112), (64, 3, 7, 28, 28)), + "requires_grad": [True], + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], + "gen_fn": dict(fn=Genfunc.randint, low=-6, high=6), + }, + ], + ), + ), + 'threshold': dict( name=["threshold"], is_inplace=True, @@ -410,7 +469,8 @@ 'pointwise_op_mask': dict( name=['logical_not', 'bitwise_not'], interface=['torch'], - dtype=[Dtype.int16, Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + dtype=[Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.uint8, Dtype.int8, Dtype.bool], tensor_para=dict( gen_fn=dict(fn=Genfunc.randint, low=0, high=2), args=[ @@ -425,7 +485,7 @@ ), 'pointwise_op_bool': dict( - name=['cos', 'erf', 'exp', 'sin', 'sqrt', 'rsqrt'], + name=['abs', 'cos', 'erf', 'exp', 'sin', 'sqrt', 'rsqrt'], interface=['torch'], dtype=[Dtype.bool], tensor_para=dict( @@ -494,6 +554,25 @@ ), ), + 'log_zero_input': dict( + name=['log', 'log2', 'log10'], + interface=['torch'], + dtype=[Dtype.float16, Dtype.float32, Dtype.float64, + Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.uint8, Dtype.int8], + tensor_para=dict( + gen_fn=Genfunc.zeros, + args=[ + { + "ins": ['input'], + "shape": ((1, ), (1024,), (364800, 4), (2, 128, 3072), + (256, 128, 3, 3), + (2, 31, 512, 6, 40)), + }, + ], + ), + ), + 'tanh': dict( name=['tanh'], interface=['torch'], @@ -517,7 +596,8 @@ 'tanh_not_float': dict( name=['tanh'], interface=['torch'], - dtype=[Dtype.int16, Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + dtype=[Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.uint8, Dtype.int8, Dtype.bool], tensor_para=dict( gen_fn=Genfunc.randn, args=[ @@ -594,8 +674,8 @@ "ins": ['input'], "requires_grad": [True], "shape": ((182400,), (20267, 80), (8, 200, 304), - (32, 16, 1, 1), (16, 32, 130, 130)), - "dtype": [Dtype.float32, Dtype.float64], + (32, 16, 1, 1), (16, 32, 130, 130), ()), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], "gen_fn": Genfunc.randn, }, ], @@ -753,7 +833,29 @@ 'lt', 'gt', 'ge', 'logical_and', 'logical_or'], interface=['torch'], is_inplace=True, - dtype=[Dtype.float64, Dtype.float32, Dtype.float16, Dtype.int64, Dtype.int32, Dtype.int16, Dtype.int8, Dtype.uint8], + dtype=[Dtype.float64, Dtype.float32, Dtype.float16, Dtype.int64, + Dtype.int32, Dtype.int16, Dtype.int8, Dtype.uint8], + tensor_para=dict( + gen_fn=Genfunc.randn, + args=[ + { + "ins": ['input'], + "shape": ((1024, ), (384, 128), + (128, 64, 3, 3), + (2, 32, 130, 130)), + }, + { + "ins": ['other'], + "shape": ((1024, ), (384, 128), + (1, ), (2, 32, 1, 1)), + }, + ], + ), + ), + + 'pointwise_binary_diff_dtype': dict( + name=['logical_and', 'logical_or'], + interface=['torch'], tensor_para=dict( gen_fn=Genfunc.randn, args=[ @@ -762,11 +864,17 @@ "shape": ((1024, ), (384, 128), (128, 64, 3, 3), (2, 32, 130, 130)), + "dtype":[Dtype.float64, Dtype.float32, Dtype.float16, + Dtype.int64, Dtype.int32, Dtype.int16, + Dtype.int8, Dtype.uint8, Dtype.bool], }, { "ins": ['other'], "shape": ((1024, ), (384, 128), (1, ), (2, 32, 1, 1)), + "dtype":[Dtype.int32, Dtype.uint8, Dtype.bool, + Dtype.int64, Dtype.float64, Dtype.float32, + Dtype.int16, Dtype.float16, Dtype.int8], }, ], ), @@ -914,7 +1022,8 @@ 'div_dtype_int_and_bool': dict( name=['div'], interface=['torch'], - dtype=[Dtype.int8, Dtype.int16, Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.bool], + dtype=[Dtype.int8, Dtype.int16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.bool], tensor_para=dict( gen_fn=Genfunc.randn, args=[ @@ -1198,7 +1307,7 @@ { "ins": ['other'], "shape": ((128, 384), (5,), (128, 4, 32, 49), - (2, 1, 3136, 64), (2, 64, 784), (512, 1)), + (2, 3, 3136, 64), (2, 64, 784), (512, 1)), }, ], ), @@ -1259,7 +1368,6 @@ atol=1e-4, rtol=1e-5, tensor_para=dict( - dtype=[Dtype.float32, Dtype.float64], gen_fn=Genfunc.randn, args=[ { @@ -1267,15 +1375,24 @@ "shape": ((182, ), (384, 128), (1, 242991, 2), (2, 4, 100, 152)), + "dtype":[Dtype.float32, Dtype.float64, Dtype.float16, + Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.int8, Dtype.uint8, Dtype.float32], }, { "ins": ['min'], "shape": ((182, ), (384, 1), None, (2, 4, 100, 152)), + "dtype":[Dtype.bool, Dtype.float32, Dtype.float16, + Dtype.int16, Dtype.int64, Dtype.int32, + Dtype.int8, Dtype.int64, Dtype.uint8], }, { "ins": ['max'], "shape": (None, (384, 128), (1, 1, 2), None), + "dtype":[Dtype.float32, Dtype.bool, Dtype.float16, + Dtype.uint8, Dtype.int32, Dtype.int64, + Dtype.int32, Dtype.int8, Dtype.int16], }, ], ), @@ -1733,7 +1850,8 @@ { "ins": ['mask'], "shape": ((16,), (12, 13), (12, 13, 14), (12, 13, 14, 1), (1, 4)), - "dtype": [Dtype.bool], + "dtype": [Dtype.uint8, Dtype.bool, Dtype.uint8, Dtype.bool, + Dtype.uint8, Dtype.bool, Dtype.uint8, Dtype.bool, Dtype.bool], "gen_fn": Genfunc.mask }, { @@ -1889,7 +2007,8 @@ para=dict( max_norm=[1.0, 5, 2.0, 10, 8], norm_type=[2.0, 3.0, 2.0, 2.0, float("inf")], - error_if_nonfinite=[True, False, False, True, True], # 1.7 not support + error_if_nonfinite=[True, False, False, + True, True], # 1.7 not support ), tensor_para=dict( args=[ @@ -1974,7 +2093,8 @@ atol=1e-4, rtol=1e-5, para=dict( - split_size_or_sections=[[1, 1, 1, 1], [15200, 3800, 950, 247, 70], 3], + split_size_or_sections=[[1, 1, 1, 1], + [15200, 3800, 950, 247, 70], 3], dim=[-1, 0, 1] ), tensor_para=dict( @@ -1998,7 +2118,8 @@ atol=1e-4, rtol=1e-5, para=dict( - split_size_or_sections=[[1, 1, 1, 1], [15200, 3800, 950, 247, 70], 3], + split_size_or_sections=[[1, 1, 1, 1], + [15200, 3800, 950, 247, 70], 3], dim=[-1, 0, 1] ), tensor_para=dict( @@ -2379,7 +2500,8 @@ interface=["CustomizedTest"], dtype=[Dtype.float32, Dtype.float64], para=dict( - index=(slice(0, 3, 1), slice(0, 3, 1), slice(0, 4, 2), slice(-3, -2, 1)), + index=(slice(0, 3, 1), slice(0, 3, 1), + slice(0, 4, 2), slice(-3, -2, 1)), dim=[0, 1, 2, 0], ), tensor_para=dict( @@ -2487,7 +2609,8 @@ interface=["torch"], is_inplace=True, para=dict( - value=[-100, 0.0, float("-inf"), -100, 0.0, float("-inf"), 23.4, 5, float("nan")], + value=[-100, 0.0, float("-inf"), -100, 0.0, + float("-inf"), 23.4, 5, float("nan")], ), tensor_para=dict( args=[ @@ -2762,6 +2885,41 @@ ), ), + 'cdist_compute_mode': dict( + name=['cdist'], + interface=['torch'], + saved_args=dict(output=0), + para=dict( + p=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], + compute_mode=['use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', + 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', + 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist'] + ), + tensor_para=dict( + args=[ + { + "ins": ['x1'], + "requires_grad": [True], + "shape": ((5, 4), (2, 256, 256), (2, 16, 256), (5, 4, 256, 256), + (3, 5, 4), (2, 256, 256), (3, + 2, 16, 256), (5, 4, 26, 256), + (5, 4), (2, 256, 256), (2, 16, 256), (5, 4, 256, 256),), + "dtype": [Dtype.float32, Dtype.float64], + "gen_fn": Genfunc.randn, + }, + { + "ins": ['x2'], + "shape": ((3, 4), (2, 16, 256), (2, 26, 256), (2, 5, 4, 256, 256), + (3, 4), (2, 16, 256), (2, 26, + 256), (2, 5, 4, 256, 256), + (4, 3, 4), (2, 16, 256), (4, 2, 26, 256), (2, 5, 4, 256, 256),), + "dtype": [Dtype.float32, Dtype.float64], + "gen_fn": Genfunc.randn, + }, + ], + ), + ), + 'bitwise_not': dict( name=['bitwise_not'], interface=['torch'], @@ -3240,7 +3398,8 @@ name=['permute'], interface=['torch'], para=dict( - dims=[(0, 1, 3, 2, 4, 5), (2, 0, 1), (0, 2, 3, 1), (1, 0), (0, -2, -1), (0,), (0,)], + dims=[(0, 1, 3, 2, 4, 5), (2, 0, 1), (0, 2, 3, 1), + (1, 0), (0, -2, -1), (0,), (0,)], ), tensor_para=dict( args=[ @@ -3367,6 +3526,30 @@ ), ), + 'norm_p': dict( + name=['norm'], + interface=['torch'], + para=dict( + p=['fro', 0., 2, -1, None, + 0.231, -1.234, 'fro', 'fro', 'fro', + 'nuc', 'nuc', 'nuc', float('inf'), float('-inf'), ], + dim=[None, None, None, [1, -1, 0], None, + 0, None, None, 0, [0, 1], + None, [0, 1], [-1, 1], None, [0, 1, 2, 3]], + ), + tensor_para=dict( + args=[ + { + "shape": ((), (3,), (3, 4), (3, 4, 5), (6, 3, 4, 5), + (3, 4, 5, 6), (3, 4, 5), (), (3,), (6, 3,), + (6, 3,), (3, 4), (3, 4, 5), (), (6, 3, 4, 5)), + "dtype": [Dtype.float32, Dtype.float64], + "gen_fn": Genfunc.randn, + }, + ], + ), + ), + 'group_norm': dict( name=['group_norm'], interface=['torch'], @@ -3557,6 +3740,32 @@ ), ), + 'remainder_other_zero': dict( + name=['remainder'], + interface=['torch'], + atol=1e-4, + rtol=1e-5, + tensor_para=dict( + gen_fn=Genfunc.randn, + args=[ + { + "ins": ['input'], + "shape": ((6, ), (4, 5)), + "dtype": [Dtype.float32, Dtype.float64, Dtype.float16, Dtype.int16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.float32], + "gen_fn": Genfunc.randn, + }, + { + "ins": ['other'], + "shape": ((6, ), (4, 1)), + "dtype": [Dtype.float32, Dtype.float64, Dtype.float16, Dtype.int16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + "gen_fn": Genfunc.zeros, + }, + ], + ), + ), + 'remainder_scalar': dict( name=['remainder'], interface=['torch'], @@ -3873,6 +4082,38 @@ ), ), + 'index_put_acc_bool_indices': dict( + name=['index_put'], + interface=['CustomizedTest'], + is_inplace=True, + para=dict( + accumulate=[True, False, False] + ), + tensor_para=dict( + gen_fn=Genfunc.randn, + args=[ + { + "ins": ['input'], + "shape": ((16, 4, 4), (64, 4, 14, 14), (4, 4)), + "dtype": [Dtype.float32, Dtype.float64, Dtype.float16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + }, + { + "ins": ['indices1'], + "shape": ((16, 4), (64, 4), (4, 4)), + "dtype": [Dtype.bool], + "gen_fn": Genfunc.ones, + }, + { + "ins": ['values'], + "shape": ((64, 4), (256, 14, 14), (16,)), + "dtype": [Dtype.float32, Dtype.float64, Dtype.float16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool] + }, + ] + ), + ), + 'index_put_one_indices': dict( name=['index_put'], interface=['CustomizedTest'], @@ -4076,9 +4317,12 @@ name=["interpolate"], dtype=[Dtype.float32, Dtype.float64, Dtype.float16], para=dict( - mode=['nearest', 'bilinear', 'nearest', 'bicubic', 'trilinear', 'linear', 'nearest', 'nearest'], - size=[(50, 76), (25, 38), (4, 224, 224), (64, 64), (4, 224, 112), (64, ), None, 32], - scale_factor=[None, None, None, None, None, None, (3.0, 3.0), None], + mode=['nearest', 'bilinear', 'nearest', 'bicubic', + 'trilinear', 'linear', 'nearest', 'nearest'], + size=[(50, 76), (25, 38), (4, 224, 224), + (64, 64), (4, 224, 112), (64, ), None, 32], + scale_factor=[None, None, None, None, + None, None, (3.0, 3.0), None], align_corners=[None, False, None, True, True, False, None, None], # recompute_scale_factor=[False, False, False, False, False, False, True, False] @@ -4168,15 +4412,15 @@ name=['cholesky_ex'], interface=['torch.linalg'], para=dict( - upper=[True, False], - check_errors=[True, False], + upper=[True, False, True, False], + check_errors=[True, False, True, False], ), tensor_para=dict( args=[ { "ins": ['input'], "requires_grad": [True], - "shape": ((2, 3, 3), (2, 3, 3)), + "shape": ((3, 4), (2, 3, 3), (2, 3, 4), (6, 3, 4, 5)), "dtype": [Dtype.float32, Dtype.float64], "gen_fn": Genfunc.sym_mat, }, @@ -4242,9 +4486,10 @@ name=["normal"], no_output_ref=True, para=dict( - mean=[0, 0.1], - std=[1, 2], - size=[(32, 8), (32, 2, 3, 3)], + mean=[-1, -0.5, 0, 0.1, 2, True, False], + std=[0.1, 0.5, 1, 2.3, 3, True, True], + size=[(), (128,), (32, 16), (32, 8), + (32, 8), (2, 2, 2, 16), (32, 2, 3, 3)], ), ), @@ -4252,16 +4497,17 @@ name=["normal_"], no_output_ref=True, para=dict( - mean=[0, 0.1], - std=[1, 2], + mean=[0, 2, 0.1, 0.5, True, False], + std=[0.5, 1, 2, 3.14, True, True], ), tensor_para=dict( gen_fn=Genfunc.randn, args=[ { "ins": ['input'], - "shape": [(32, 8), (16, 64, 32)], - "dtype": [Dtype.float32, Dtype.float64], + "shape": [(), (128,), (32, 8), (32, 8), + (32, 8), (16, 64, 32)], + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, ] ), @@ -4271,15 +4517,16 @@ name=["normal"], no_output_ref=True, para=dict( - mean=[0, 0.5], + mean=[-1, -0.5, 0, 0.1, 2], ), tensor_para=dict( gen_fn=Genfunc.positive, args=[ { "ins": ['std'], - "shape": ((256, 256, 3, 3), (256, 128, 1, 1)), - "dtype": [Dtype.float32, Dtype.float64], + "shape": ((), (16,), (8, 4), + (256, 256, 3, 3), (256, 128, 1, 1)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, ] ), @@ -4289,15 +4536,15 @@ name=["normal"], no_output_ref=True, para=dict( - std=[0.1, 0.024056261216234408], + std=[0.5, 0.1, 0.054056261216234408, 2, 5], ), tensor_para=dict( gen_fn=Genfunc.randn, args=[ { "ins": ['mean'], - "shape": ((256, 256, 3, 3), (256, 128, 1, 1)), - "dtype": [Dtype.float32, Dtype.float64], + "shape": ((), (16,), (8, 4), (256, 256, 3, 3), (256, 128, 1, 1)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, ] ), @@ -4311,13 +4558,17 @@ args=[ { "ins": ['mean'], - "shape": ((256, 256, 3, 3), (256, 128, 1, 1)), - "dtype": [Dtype.float32, Dtype.float64], + # (3, 4), (4,16,),will be removed in version 1.6 release + "shape": ((8, 8, 16), (256, 256, 3, 3), (256, 128, 3, 1)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, { "ins": ['std'], - "shape": ((256, 256, 3, 3), (256, 128, 1, 1)), - "dtype": [Dtype.float32, Dtype.float64], + # (12,), (2,4,4,2), will be removed in version 1.6 release + "shape": ((8, 16), (256, 256, 3, 3), (256, 128, 1, 1)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, + Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.int8, Dtype.uint8, Dtype.bool], "gen_fn": Genfunc.positive, }, ] @@ -4330,9 +4581,13 @@ tensor_para=dict( args=[ { - "ins": ['tensor'], - "shape": ((8,), (16,), (32,)), - "dtype": [Dtype.float32, Dtype.float64, Dtype.int64], + "ins": ['tensors'], + "shape": (((8,), (8,), (8,)), + ((16,), (8,), ()), + ((32,), (16,)), ((8,),)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, + Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.int8, Dtype.uint8, Dtype.bool], "gen_fn": Genfunc.randn, "gen_num_range": [1, 5], }, @@ -4346,16 +4601,19 @@ interface=['torch'], no_output_ref=True, para=dict( - num_samples=[6, 60, 200, 128], - replacement=[True, True, False, False], + num_samples=[7, 8, 9, + 63, 257, 128], + replacement=[False, False, True, + True, True, True], ), tensor_para=dict( gen_fn=Genfunc.positive, args=[ { "ins": ['input'], - "shape": ((8, ), (16, 64,), (128, 256,), (256, 128,)), - "dtype": [Dtype.float32, Dtype.float64, Dtype.float64, Dtype.float64], + "shape": ((8, ), (8, ), (8, ), + (16, 64,), (128, 256,), (256, 128,)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, ], ), @@ -4370,12 +4628,14 @@ { "ins": ['input'], "shape": [(32, 64,), (128, 24, 32), (16, 8,), (24, 12,)], - "dtype": [Dtype.float32, Dtype.int64, Dtype.int8, Dtype.uint8], + "dtype": [Dtype.float32, Dtype.int64, + Dtype.int8, Dtype.uint8], }, { "ins": ['out'], "shape": [(32, 64,), (128, 24, 32), (16, 8,), (24, 12,)], - "dtype": [Dtype.int64, Dtype.float64, Dtype.bool, Dtype.float16], + "dtype": [Dtype.int64, Dtype.float64, + Dtype.bool, Dtype.float16], }, ] ), diff --git a/python/conformance/gen_data.py b/python/conformance/gen_data.py index 59722f4..5767482 100644 --- a/python/conformance/gen_data.py +++ b/python/conformance/gen_data.py @@ -227,7 +227,7 @@ def gen_tensor(arg: dict, cfg_dict: dict) -> np.ndarray: elif gen_fn == Genfunc.positive: value = np.abs(np.array(np.random.randn(*shape)).astype(dtype)) elif gen_fn == Genfunc.sym_mat: - axis = (0, 2, 1) if len(shape) == 3 else (0, 1) + axis = [i for i in range(len(shape)-2)] + [-1, -2] mat = np.random.randn(*shape).astype(dtype) value = mat @ mat.transpose(axis) else: