Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
6a8847f3
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 2 年 前同步成功
通知
2325
Star
20933
Fork
5424
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6a8847f3
编写于
6月 30, 2023
作者:
Z
zhangjingwei
提交者:
GitHub
6月 30, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CodeStyle][CINN] format import region in python code via isort (#54963)
Co-authored-by:
N
SigureMo
<
sigure.qaq@gmail.com
>
上级
4d7ddb49
变更
206
显示空白变更内容
内联
并排
Showing
206 changed file
with
805 addition
and
581 deletion
+805
-581
paddle/cinn/backends/llvm/generate_runtime_llvm_ir.py
paddle/cinn/backends/llvm/generate_runtime_llvm_ir.py
+1
-1
pyproject.toml
pyproject.toml
+0
-3
python/cinn/backends.py
python/cinn/backends.py
+1
-2
python/cinn/common.py
python/cinn/common.py
+12
-5
python/cinn/lang.py
python/cinn/lang.py
+1
-3
python/cinn/optim.py
python/cinn/optim.py
+1
-2
test/cinn/auto_schedule/cost_model/test_cost_model.py
test/cinn/auto_schedule/cost_model/test_cost_model.py
+2
-3
test/cinn/conv2d_utils.py
test/cinn/conv2d_utils.py
+2
-1
test/cinn/fake_model/naive_mul.py
test/cinn/fake_model/naive_mul.py
+4
-1
test/cinn/fake_model/naive_multi_fc.py
test/cinn/fake_model/naive_multi_fc.py
+4
-1
test/cinn/fake_model/resnet_model.py
test/cinn/fake_model/resnet_model.py
+5
-2
test/cinn/fusion/test_cast_broadcast_reduce_max.py
test/cinn/fusion/test_cast_broadcast_reduce_max.py
+1
-0
test/cinn/fusion/test_reduce_cast.py
test/cinn/fusion/test_reduce_cast.py
+1
-0
test/cinn/fusion/test_select_reduce.py
test/cinn/fusion/test_select_reduce.py
+1
-0
test/cinn/op_mappers/op_mapper_test.py
test/cinn/op_mappers/op_mapper_test.py
+7
-8
test/cinn/op_mappers/test_argmax_op.py
test/cinn/op_mappers/test_argmax_op.py
+5
-3
test/cinn/op_mappers/test_argmin_op.py
test/cinn/op_mappers/test_argmin_op.py
+5
-3
test/cinn/op_mappers/test_argsort_op.py
test/cinn/op_mappers/test_argsort_op.py
+2
-0
test/cinn/op_mappers/test_assign_value_op.py
test/cinn/op_mappers/test_assign_value_op.py
+2
-0
test/cinn/op_mappers/test_atan2_op.py
test/cinn/op_mappers/test_atan2_op.py
+2
-0
test/cinn/op_mappers/test_batch_norm_op.py
test/cinn/op_mappers/test_batch_norm_op.py
+2
-0
test/cinn/op_mappers/test_bitwise_op.py
test/cinn/op_mappers/test_bitwise_op.py
+2
-0
test/cinn/op_mappers/test_cholesky_op.py
test/cinn/op_mappers/test_cholesky_op.py
+3
-1
test/cinn/op_mappers/test_clip_op.py
test/cinn/op_mappers/test_clip_op.py
+3
-1
test/cinn/op_mappers/test_compare_op.py
test/cinn/op_mappers/test_compare_op.py
+2
-0
test/cinn/op_mappers/test_conv2d_op.py
test/cinn/op_mappers/test_conv2d_op.py
+2
-0
test/cinn/op_mappers/test_cumsum_op.py
test/cinn/op_mappers/test_cumsum_op.py
+2
-0
test/cinn/op_mappers/test_elementwise_op.py
test/cinn/op_mappers/test_elementwise_op.py
+2
-0
test/cinn/op_mappers/test_expand_op.py
test/cinn/op_mappers/test_expand_op.py
+2
-0
test/cinn/op_mappers/test_expand_v2_op.py
test/cinn/op_mappers/test_expand_v2_op.py
+2
-0
test/cinn/op_mappers/test_fill_constant_op.py
test/cinn/op_mappers/test_fill_constant_op.py
+2
-0
test/cinn/op_mappers/test_flip_op.py
test/cinn/op_mappers/test_flip_op.py
+2
-0
test/cinn/op_mappers/test_gather_nd_op.py
test/cinn/op_mappers/test_gather_nd_op.py
+2
-0
test/cinn/op_mappers/test_gather_op.py
test/cinn/op_mappers/test_gather_op.py
+2
-0
test/cinn/op_mappers/test_gaussian_random_op.py
test/cinn/op_mappers/test_gaussian_random_op.py
+2
-0
test/cinn/op_mappers/test_layer_norm_op.py
test/cinn/op_mappers/test_layer_norm_op.py
+3
-1
test/cinn/op_mappers/test_log1p_op.py
test/cinn/op_mappers/test_log1p_op.py
+2
-0
test/cinn/op_mappers/test_logical_op.py
test/cinn/op_mappers/test_logical_op.py
+2
-0
test/cinn/op_mappers/test_lookup_table_op.py
test/cinn/op_mappers/test_lookup_table_op.py
+2
-0
test/cinn/op_mappers/test_mul_op.py
test/cinn/op_mappers/test_mul_op.py
+2
-0
test/cinn/op_mappers/test_norm_op.py
test/cinn/op_mappers/test_norm_op.py
+2
-0
test/cinn/op_mappers/test_one_hot_op.py
test/cinn/op_mappers/test_one_hot_op.py
+2
-0
test/cinn/op_mappers/test_pool2d_op.py
test/cinn/op_mappers/test_pool2d_op.py
+4
-2
test/cinn/op_mappers/test_pow_op.py
test/cinn/op_mappers/test_pow_op.py
+2
-0
test/cinn/op_mappers/test_randint_op.py
test/cinn/op_mappers/test_randint_op.py
+2
-0
test/cinn/op_mappers/test_reduce_op.py
test/cinn/op_mappers/test_reduce_op.py
+2
-0
test/cinn/op_mappers/test_reverse_op.py
test/cinn/op_mappers/test_reverse_op.py
+2
-0
test/cinn/op_mappers/test_roll_op.py
test/cinn/op_mappers/test_roll_op.py
+2
-0
test/cinn/op_mappers/test_scale_op.py
test/cinn/op_mappers/test_scale_op.py
+2
-0
test/cinn/op_mappers/test_scatter_op.py
test/cinn/op_mappers/test_scatter_op.py
+4
-2
test/cinn/op_mappers/test_sign_op.py
test/cinn/op_mappers/test_sign_op.py
+2
-0
test/cinn/op_mappers/test_split_op.py
test/cinn/op_mappers/test_split_op.py
+2
-0
test/cinn/op_mappers/test_squeeze_op.py
test/cinn/op_mappers/test_squeeze_op.py
+2
-0
test/cinn/op_mappers/test_stack_op.py
test/cinn/op_mappers/test_stack_op.py
+2
-0
test/cinn/op_mappers/test_strided_slice_op.py
test/cinn/op_mappers/test_strided_slice_op.py
+2
-0
test/cinn/op_mappers/test_take_along_axis_op.py
test/cinn/op_mappers/test_take_along_axis_op.py
+2
-0
test/cinn/op_mappers/test_tile_op.py
test/cinn/op_mappers/test_tile_op.py
+2
-0
test/cinn/op_mappers/test_transpose2_op.py
test/cinn/op_mappers/test_transpose2_op.py
+2
-0
test/cinn/op_mappers/test_triangular_solve_op.py
test/cinn/op_mappers/test_triangular_solve_op.py
+2
-0
test/cinn/op_mappers/test_unary_op.py
test/cinn/op_mappers/test_unary_op.py
+2
-0
test/cinn/op_mappers/test_uniform_random_op.py
test/cinn/op_mappers/test_uniform_random_op.py
+2
-0
test/cinn/op_mappers/test_where_op.py
test/cinn/op_mappers/test_where_op.py
+2
-0
test/cinn/ops/op_test.py
test/cinn/ops/op_test.py
+8
-7
test/cinn/ops/op_test_helper.py
test/cinn/ops/op_test_helper.py
+3
-4
test/cinn/ops/test_abs_op.py
test/cinn/ops/test_abs_op.py
+4
-2
test/cinn/ops/test_acos_op.py
test/cinn/ops/test_acos_op.py
+5
-3
test/cinn/ops/test_acosh_op.py
test/cinn/ops/test_acosh_op.py
+5
-3
test/cinn/ops/test_add_op.py
test/cinn/ops/test_add_op.py
+2
-1
test/cinn/ops/test_arange_op.py
test/cinn/ops/test_arange_op.py
+3
-2
test/cinn/ops/test_argsort_op.py
test/cinn/ops/test_argsort_op.py
+5
-3
test/cinn/ops/test_asin_op.py
test/cinn/ops/test_asin_op.py
+4
-3
test/cinn/ops/test_asinh_op.py
test/cinn/ops/test_asinh_op.py
+5
-3
test/cinn/ops/test_atan2_op.py
test/cinn/ops/test_atan2_op.py
+3
-2
test/cinn/ops/test_atan_op.py
test/cinn/ops/test_atan_op.py
+5
-3
test/cinn/ops/test_atanh_op.py
test/cinn/ops/test_atanh_op.py
+5
-3
test/cinn/ops/test_batch_norm_op.py
test/cinn/ops/test_batch_norm_op.py
+7
-4
test/cinn/ops/test_binary_elementwise_op.py
test/cinn/ops/test_binary_elementwise_op.py
+5
-3
test/cinn/ops/test_bitcast_convert_op.py
test/cinn/ops/test_bitcast_convert_op.py
+6
-5
test/cinn/ops/test_bitwise_op.py
test/cinn/ops/test_bitwise_op.py
+3
-2
test/cinn/ops/test_broadcast_to_op.py
test/cinn/ops/test_broadcast_to_op.py
+6
-4
test/cinn/ops/test_broadcast_to_op_new.py
test/cinn/ops/test_broadcast_to_op_new.py
+3
-2
test/cinn/ops/test_cast_op.py
test/cinn/ops/test_cast_op.py
+5
-3
test/cinn/ops/test_cbrt_op.py
test/cinn/ops/test_cbrt_op.py
+2
-1
test/cinn/ops/test_ceil_op.py
test/cinn/ops/test_ceil_op.py
+2
-1
test/cinn/ops/test_cholesky_op.py
test/cinn/ops/test_cholesky_op.py
+2
-1
test/cinn/ops/test_clz_op.py
test/cinn/ops/test_clz_op.py
+2
-1
test/cinn/ops/test_comparison_op.py
test/cinn/ops/test_comparison_op.py
+3
-2
test/cinn/ops/test_concat_op.py
test/cinn/ops/test_concat_op.py
+2
-1
test/cinn/ops/test_constant_op.py
test/cinn/ops/test_constant_op.py
+2
-1
test/cinn/ops/test_conv2d_op.py
test/cinn/ops/test_conv2d_op.py
+5
-4
test/cinn/ops/test_cos_op.py
test/cinn/ops/test_cos_op.py
+4
-3
test/cinn/ops/test_cosh_op.py
test/cinn/ops/test_cosh_op.py
+4
-3
test/cinn/ops/test_depthwise_conv2d_op.py
test/cinn/ops/test_depthwise_conv2d_op.py
+4
-3
test/cinn/ops/test_divide_op.py
test/cinn/ops/test_divide_op.py
+3
-2
test/cinn/ops/test_dropout_infer_op.py
test/cinn/ops/test_dropout_infer_op.py
+5
-3
test/cinn/ops/test_erf_op.py
test/cinn/ops/test_erf_op.py
+4
-3
test/cinn/ops/test_exp_op.py
test/cinn/ops/test_exp_op.py
+4
-3
test/cinn/ops/test_expand_dims.py
test/cinn/ops/test_expand_dims.py
+3
-2
test/cinn/ops/test_fill_constant_op.py
test/cinn/ops/test_fill_constant_op.py
+2
-1
test/cinn/ops/test_floor_divide_op.py
test/cinn/ops/test_floor_divide_op.py
+5
-3
test/cinn/ops/test_floor_op.py
test/cinn/ops/test_floor_op.py
+4
-3
test/cinn/ops/test_gather_nd_op.py
test/cinn/ops/test_gather_nd_op.py
+8
-6
test/cinn/ops/test_gather_op.py
test/cinn/ops/test_gather_op.py
+8
-6
test/cinn/ops/test_gaussian_random_op.py
test/cinn/ops/test_gaussian_random_op.py
+4
-3
test/cinn/ops/test_gelu_op.py
test/cinn/ops/test_gelu_op.py
+5
-3
test/cinn/ops/test_identity_op.py
test/cinn/ops/test_identity_op.py
+4
-2
test/cinn/ops/test_is_finite_op.py
test/cinn/ops/test_is_finite_op.py
+5
-3
test/cinn/ops/test_is_inf_op.py
test/cinn/ops/test_is_inf_op.py
+5
-3
test/cinn/ops/test_is_nan_op.py
test/cinn/ops/test_is_nan_op.py
+5
-3
test/cinn/ops/test_isclose_op.py
test/cinn/ops/test_isclose_op.py
+4
-3
test/cinn/ops/test_left_shift_op.py
test/cinn/ops/test_left_shift_op.py
+5
-3
test/cinn/ops/test_log_op.py
test/cinn/ops/test_log_op.py
+4
-3
test/cinn/ops/test_logical_and_op.py
test/cinn/ops/test_logical_and_op.py
+5
-3
test/cinn/ops/test_logical_not_op.py
test/cinn/ops/test_logical_not_op.py
+5
-3
test/cinn/ops/test_logical_or_op.py
test/cinn/ops/test_logical_or_op.py
+5
-3
test/cinn/ops/test_logical_right_shift_op.py
test/cinn/ops/test_logical_right_shift_op.py
+4
-3
test/cinn/ops/test_logical_xor_op.py
test/cinn/ops/test_logical_xor_op.py
+5
-3
test/cinn/ops/test_lookup_table_op.py
test/cinn/ops/test_lookup_table_op.py
+4
-3
test/cinn/ops/test_matmul_op.py
test/cinn/ops/test_matmul_op.py
+5
-3
test/cinn/ops/test_max_op.py
test/cinn/ops/test_max_op.py
+3
-2
test/cinn/ops/test_min_op.py
test/cinn/ops/test_min_op.py
+3
-2
test/cinn/ops/test_mod_op.py
test/cinn/ops/test_mod_op.py
+5
-3
test/cinn/ops/test_mul_op.py
test/cinn/ops/test_mul_op.py
+6
-4
test/cinn/ops/test_multiply_op.py
test/cinn/ops/test_multiply_op.py
+3
-2
test/cinn/ops/test_negative_op.py
test/cinn/ops/test_negative_op.py
+4
-3
test/cinn/ops/test_one_hot_op.py
test/cinn/ops/test_one_hot_op.py
+5
-3
test/cinn/ops/test_pool2d_op.py
test/cinn/ops/test_pool2d_op.py
+3
-2
test/cinn/ops/test_popc_op.py
test/cinn/ops/test_popc_op.py
+2
-1
test/cinn/ops/test_pow_op.py
test/cinn/ops/test_pow_op.py
+4
-3
test/cinn/ops/test_randint_op.py
test/cinn/ops/test_randint_op.py
+6
-4
test/cinn/ops/test_reciprocal_op.py
test/cinn/ops/test_reciprocal_op.py
+5
-3
test/cinn/ops/test_reduce_op.py
test/cinn/ops/test_reduce_op.py
+5
-3
test/cinn/ops/test_reduce_op_new.py
test/cinn/ops/test_reduce_op_new.py
+5
-3
test/cinn/ops/test_relu6_op.py
test/cinn/ops/test_relu6_op.py
+5
-3
test/cinn/ops/test_relu_op.py
test/cinn/ops/test_relu_op.py
+4
-3
test/cinn/ops/test_remainder_op.py
test/cinn/ops/test_remainder_op.py
+4
-3
test/cinn/ops/test_repeat_op.py
test/cinn/ops/test_repeat_op.py
+3
-2
test/cinn/ops/test_reshape_op.py
test/cinn/ops/test_reshape_op.py
+3
-2
test/cinn/ops/test_resize_op.py
test/cinn/ops/test_resize_op.py
+5
-3
test/cinn/ops/test_reverse_op.py
test/cinn/ops/test_reverse_op.py
+2
-1
test/cinn/ops/test_right_shift_op.py
test/cinn/ops/test_right_shift_op.py
+5
-3
test/cinn/ops/test_round_op.py
test/cinn/ops/test_round_op.py
+4
-3
test/cinn/ops/test_rsqrt_op.py
test/cinn/ops/test_rsqrt_op.py
+4
-3
test/cinn/ops/test_scale_op.py
test/cinn/ops/test_scale_op.py
+5
-3
test/cinn/ops/test_scatter_add.py
test/cinn/ops/test_scatter_add.py
+3
-2
test/cinn/ops/test_scatter_assign_op.py
test/cinn/ops/test_scatter_assign_op.py
+3
-2
test/cinn/ops/test_select_op.py
test/cinn/ops/test_select_op.py
+3
-2
test/cinn/ops/test_sigmoid_op.py
test/cinn/ops/test_sigmoid_op.py
+4
-3
test/cinn/ops/test_sign_op.py
test/cinn/ops/test_sign_op.py
+3
-2
test/cinn/ops/test_sin_op.py
test/cinn/ops/test_sin_op.py
+4
-3
test/cinn/ops/test_sinh_op.py
test/cinn/ops/test_sinh_op.py
+4
-3
test/cinn/ops/test_slice_assign_op.py
test/cinn/ops/test_slice_assign_op.py
+3
-2
test/cinn/ops/test_slice_op.py
test/cinn/ops/test_slice_op.py
+3
-2
test/cinn/ops/test_softmax_op.py
test/cinn/ops/test_softmax_op.py
+4
-3
test/cinn/ops/test_sort_op.py
test/cinn/ops/test_sort_op.py
+3
-2
test/cinn/ops/test_split_op.py
test/cinn/ops/test_split_op.py
+3
-2
test/cinn/ops/test_sqrt_op.py
test/cinn/ops/test_sqrt_op.py
+4
-3
test/cinn/ops/test_squeeze_op.py
test/cinn/ops/test_squeeze_op.py
+3
-2
test/cinn/ops/test_subtract_op.py
test/cinn/ops/test_subtract_op.py
+3
-2
test/cinn/ops/test_sum_op.py
test/cinn/ops/test_sum_op.py
+3
-2
test/cinn/ops/test_tan_op.py
test/cinn/ops/test_tan_op.py
+4
-3
test/cinn/ops/test_tanh_op.py
test/cinn/ops/test_tanh_op.py
+4
-3
test/cinn/ops/test_top_k_op.py
test/cinn/ops/test_top_k_op.py
+3
-2
test/cinn/ops/test_transpose_op.py
test/cinn/ops/test_transpose_op.py
+3
-2
test/cinn/ops/test_triangular_solve_op.py
test/cinn/ops/test_triangular_solve_op.py
+3
-2
test/cinn/ops/test_trunc_op.py
test/cinn/ops/test_trunc_op.py
+4
-3
test/cinn/ops/test_unary_elementwise_op.py
test/cinn/ops/test_unary_elementwise_op.py
+5
-3
test/cinn/ops/test_uniform_random_op.py
test/cinn/ops/test_uniform_random_op.py
+4
-3
test/cinn/ops/test_zero_dim_tensor.py
test/cinn/ops/test_zero_dim_tensor.py
+5
-3
test/cinn/passes/pass_test.py
test/cinn/passes/pass_test.py
+7
-2
test/cinn/passes/test_auto_cast_pass.py
test/cinn/passes/test_auto_cast_pass.py
+3
-2
test/cinn/passes/test_expand_zero_dim_pass.py
test/cinn/passes/test_expand_zero_dim_pass.py
+4
-3
test/cinn/passes/test_transpose_floding_input_pass.py
test/cinn/passes/test_transpose_floding_input_pass.py
+3
-2
test/cinn/passes/test_transpose_floding_output_pass.py
test/cinn/passes/test_transpose_floding_output_pass.py
+3
-2
test/cinn/pool_utils.py
test/cinn/pool_utils.py
+2
-1
test/cinn/test_common.py
test/cinn/test_common.py
+2
-4
test/cinn/test_computation.py
test/cinn/test_computation.py
+10
-11
test/cinn/test_efficientnet.py
test/cinn/test_efficientnet.py
+10
-11
test/cinn/test_facedet.py
test/cinn/test_facedet.py
+10
-11
test/cinn/test_frontend.py
test/cinn/test_frontend.py
+9
-10
test/cinn/test_hlir_framework.py
test/cinn/test_hlir_framework.py
+2
-1
test/cinn/test_ir.py
test/cinn/test_ir.py
+3
-5
test/cinn/test_matmul.py
test/cinn/test_matmul.py
+3
-6
test/cinn/test_mobilenetv1.py
test/cinn/test_mobilenetv1.py
+10
-11
test/cinn/test_mobilenetv2.py
test/cinn/test_mobilenetv2.py
+10
-11
test/cinn/test_netbuilder.py
test/cinn/test_netbuilder.py
+9
-10
test/cinn/test_op_benchmark.py
test/cinn/test_op_benchmark.py
+9
-10
test/cinn/test_op_broadcast.py
test/cinn/test_op_broadcast.py
+5
-9
test/cinn/test_op_nn.py
test/cinn/test_op_nn.py
+9
-12
test/cinn/test_op_transform.py
test/cinn/test_op_transform.py
+7
-10
test/cinn/test_packed_func.py
test/cinn/test_packed_func.py
+4
-4
test/cinn/test_paddle_model_convertor.py
test/cinn/test_paddle_model_convertor.py
+9
-7
test/cinn/test_pe_elementwise.py
test/cinn/test_pe_elementwise.py
+4
-7
test/cinn/test_pe_reduction.py
test/cinn/test_pe_reduction.py
+2
-5
test/cinn/test_pe_transform.py
test/cinn/test_pe_transform.py
+3
-6
test/cinn/test_resnet.py
test/cinn/test_resnet.py
+9
-10
test/cinn/test_resnet18.py
test/cinn/test_resnet18.py
+10
-11
test/cinn/test_resnet50.py
test/cinn/test_resnet50.py
+10
-11
test/cinn/test_squeezenet.py
test/cinn/test_squeezenet.py
+10
-11
test/cinn/test_utils.py
test/cinn/test_utils.py
+5
-9
tools/cinn/gen_c++_tutorial.py
tools/cinn/gen_c++_tutorial.py
+1
-1
tools/cinn/paddle_benchmark/paddle_save_model.py
tools/cinn/paddle_benchmark/paddle_save_model.py
+4
-1
tools/cinn/paddle_benchmark/paddle_test_benchmark.py
tools/cinn/paddle_benchmark/paddle_test_benchmark.py
+3
-2
tools/cinn/paddle_benchmark/test_paddle_ops.py
tools/cinn/paddle_benchmark/test_paddle_ops.py
+7
-5
tools/cinn/tvm_benchmark/test_topi_default.py
tools/cinn/tvm_benchmark/test_topi_default.py
+6
-6
tools/cinn/tvm_benchmark/tvm_graph_with_single_op.py
tools/cinn/tvm_benchmark/tvm_graph_with_single_op.py
+3
-6
未找到文件。
paddle/cinn/backends/llvm/generate_runtime_llvm_ir.py
浏览文件 @
6a8847f3
...
@@ -14,8 +14,8 @@
...
@@ -14,8 +14,8 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
sys
import
subprocess
import
subprocess
import
sys
def
main
():
def
main
():
...
...
pyproject.toml
浏览文件 @
6a8847f3
...
@@ -18,9 +18,6 @@ extend_skip_glob = [
...
@@ -18,9 +18,6 @@ extend_skip_glob = [
# see .flake8 for more details
# see .flake8 for more details
"python/paddle/fluid/**"
,
"python/paddle/fluid/**"
,
"python/paddle/utils/gast/**"
,
"python/paddle/utils/gast/**"
,
# Temporarily ignore CINN files, it will fix later
"python/cinn/**"
,
"test/cinn/**"
,
]
]
[tool.ruff]
[tool.ruff]
...
...
python/cinn/backends.py
浏览文件 @
6a8847f3
...
@@ -12,5 +12,4 @@
...
@@ -12,5 +12,4 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
.core_api.backends
import
ExecutionOptions
from
.core_api.backends
import
ExecutionEngine
,
ExecutionOptions
from
.core_api.backends
import
ExecutionEngine
python/cinn/common.py
浏览文件 @
6a8847f3
...
@@ -12,9 +12,16 @@
...
@@ -12,9 +12,16 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
.core_api.common
import
make_const
from
.core_api.common
import
Target
from
.core_api.common
import
Type
from
.core_api.common
import
CINNValue
from
.core_api.common
import
Void
,
Int
,
UInt
,
Float
,
Bool
,
String
from
.core_api.common
import
*
from
.core_api.common
import
*
from
.core_api.common
import
(
Bool
,
CINNValue
,
Float
,
Int
,
String
,
Target
,
Type
,
UInt
,
Void
,
make_const
,
)
python/cinn/lang.py
浏览文件 @
6a8847f3
...
@@ -12,7 +12,5 @@
...
@@ -12,7 +12,5 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
.core_api.lang
import
Buffer
from
.core_api.lang
import
lower
from
.core_api.lang
import
compute
from
.core_api.lang
import
*
from
.core_api.lang
import
*
from
.core_api.lang
import
Buffer
,
compute
,
lower
python/cinn/optim.py
浏览文件 @
6a8847f3
...
@@ -12,5 +12,4 @@
...
@@ -12,5 +12,4 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
.core_api.optim
import
simplify
from
.core_api.optim
import
ir_copy
,
simplify
from
.core_api.optim
import
ir_copy
test/cinn/auto_schedule/cost_model/test_cost_model.py
浏览文件 @
6a8847f3
...
@@ -12,13 +12,12 @@
...
@@ -12,13 +12,12 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
os
import
os
import
shutil
import
shutil
import
numpy
as
np
import
unittest
import
unittest
import
cinn
import
numpy
as
np
from
cinn.auto_schedule.cost_model
import
CostModel
from
cinn.auto_schedule.cost_model
import
CostModel
...
...
test/cinn/conv2d_utils.py
浏览文件 @
6a8847f3
...
@@ -14,9 +14,10 @@
...
@@ -14,9 +14,10 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
paddle
import
paddle
import
paddle.static
as
static
import
paddle.static
as
static
import
numpy
as
np
def
conv2d_native
(
inputs_data
,
input_shape
,
filter_size
,
attrs
,
is_depthwise
):
def
conv2d_native
(
inputs_data
,
input_shape
,
filter_size
,
attrs
,
is_depthwise
):
...
...
test/cinn/fake_model/naive_mul.py
浏览文件 @
6a8847f3
...
@@ -12,9 +12,12 @@
...
@@ -12,9 +12,12 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
os
import
sys
import
numpy
import
numpy
import
sys
,
os
import
numpy
as
np
import
numpy
as
np
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle.static
as
static
import
paddle.static
as
static
...
...
test/cinn/fake_model/naive_multi_fc.py
浏览文件 @
6a8847f3
...
@@ -14,9 +14,12 @@
...
@@ -14,9 +14,12 @@
"""
"""
A fake model with multiple FC layers to test CINN on a more complex model.
A fake model with multiple FC layers to test CINN on a more complex model.
"""
"""
import
os
import
sys
import
numpy
import
numpy
import
sys
,
os
import
numpy
as
np
import
numpy
as
np
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle.static
as
static
import
paddle.static
as
static
...
...
test/cinn/fake_model/resnet_model.py
浏览文件 @
6a8847f3
...
@@ -12,10 +12,13 @@
...
@@ -12,10 +12,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
os
import
sys
import
numpy
import
numpy
import
paddle
import
sys
,
os
import
numpy
as
np
import
numpy
as
np
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle.static
as
static
import
paddle.static
as
static
...
...
test/cinn/fusion/test_cast_broadcast_reduce_max.py
浏览文件 @
6a8847f3
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
fusion_test
import
FusionTest
from
fusion_test
import
FusionTest
...
...
test/cinn/fusion/test_reduce_cast.py
浏览文件 @
6a8847f3
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
fusion_test
import
FusionTest
from
fusion_test
import
FusionTest
...
...
test/cinn/fusion/test_select_reduce.py
浏览文件 @
6a8847f3
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
fusion_test
import
FusionTest
from
fusion_test
import
FusionTest
...
...
test/cinn/op_mappers/op_mapper_test.py
浏览文件 @
6a8847f3
...
@@ -14,19 +14,18 @@
...
@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
ast
import
arg
import
os
import
logging
import
logging
import
os
import
sys
from
ast
import
arg
import
paddle
from
paddle.static
import
Variable
as
PaddleVariable
from
paddle.fluid.layer_helper
import
LayerHelper
from
cinn.frontend
import
NetBuilder
,
PaddleModelConvertor
from
cinn.common
import
is_compiled_with_cuda
from
cinn.common
import
is_compiled_with_cuda
from
cinn.framework
import
Scope
from
cinn.framework
import
Scope
from
cinn.frontend
import
NetBuilder
,
PaddleModelConvertor
import
sys
import
paddle
from
paddle.fluid.layer_helper
import
LayerHelper
from
paddle.static
import
Variable
as
PaddleVariable
sys
.
path
.
append
(
"/work/dev_CINN/build/python/tests"
)
sys
.
path
.
append
(
"/work/dev_CINN/build/python/tests"
)
from
test.cinn.ops.op_test
import
OpTest
,
OpTestTool
from
test.cinn.ops.op_test
import
OpTest
,
OpTestTool
...
...
test/cinn/op_mappers/test_argmax_op.py
浏览文件 @
6a8847f3
...
@@ -14,11 +14,13 @@
...
@@ -14,11 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
unittest
import
unittest
from
op_mapper_test
import
OpMapperTest
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_mapper_test
import
OpMapperTest
import
paddle
class
TestArgmaxOp
(
OpMapperTest
):
class
TestArgmaxOp
(
OpMapperTest
):
...
...
test/cinn/op_mappers/test_argmin_op.py
浏览文件 @
6a8847f3
...
@@ -14,11 +14,13 @@
...
@@ -14,11 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
unittest
import
unittest
from
op_mapper_test
import
OpMapperTest
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_mapper_test
import
OpMapperTest
import
paddle
class
TestArgminOp
(
OpMapperTest
):
class
TestArgminOp
(
OpMapperTest
):
...
...
test/cinn/op_mappers/test_argsort_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_assign_value_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_atan2_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_batch_norm_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_bitwise_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_cholesky_op.py
浏览文件 @
6a8847f3
...
@@ -13,8 +13,10 @@
...
@@ -13,8 +13,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
op_mapper_test
import
OpMapperTest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_clip_op.py
浏览文件 @
6a8847f3
...
@@ -14,11 +14,13 @@
...
@@ -14,11 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
random
import
random
import
unittest
import
unittest
from
op_mapper_test
import
OpMapperTest
from
op_mapper_test
import
OpMapperTest
import
paddle
class
TestClipOp
(
OpMapperTest
):
class
TestClipOp
(
OpMapperTest
):
def
init_input_data
(
self
):
def
init_input_data
(
self
):
...
...
test/cinn/op_mappers/test_compare_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_conv2d_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_cumsum_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_elementwise_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_expand_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_expand_v2_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_fill_constant_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_flip_op.py
浏览文件 @
6a8847f3
...
@@ -15,7 +15,9 @@
...
@@ -15,7 +15,9 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
op_mapper_test
import
OpMapperTest
from
op_mapper_test
import
OpMapperTest
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_gather_nd_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_gather_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_gaussian_random_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_layer_norm_op.py
浏览文件 @
6a8847f3
...
@@ -14,11 +14,13 @@
...
@@ -14,11 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
functools
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
import
functools
class
TestLayerNormOp
(
OpMapperTest
):
class
TestLayerNormOp
(
OpMapperTest
):
...
...
test/cinn/op_mappers/test_log1p_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_logical_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_lookup_table_op.py
浏览文件 @
6a8847f3
...
@@ -13,8 +13,10 @@
...
@@ -13,8 +13,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_mul_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_norm_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_one_hot_op.py
浏览文件 @
6a8847f3
...
@@ -13,8 +13,10 @@
...
@@ -13,8 +13,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_pool2d_op.py
浏览文件 @
6a8847f3
...
@@ -13,9 +13,11 @@
...
@@ -13,9 +13,11 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
paddle
from
op_mapper_test
import
OpMapperTest
from
cinn.common
import
*
from
cinn.common
import
*
from
op_mapper_test
import
OpMapperTest
import
paddle
@
unittest
.
skipIf
(
@
unittest
.
skipIf
(
...
...
test/cinn/op_mappers/test_pow_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_randint_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_reduce_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_reverse_op.py
浏览文件 @
6a8847f3
...
@@ -15,7 +15,9 @@
...
@@ -15,7 +15,9 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
op_mapper_test
import
OpMapperTest
from
op_mapper_test
import
OpMapperTest
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_roll_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_scale_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_scatter_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,14 @@
...
@@ -14,12 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
paddle
import
random
import
random
import
unittest
import
unittest
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
from
op_mapper_test
import
OpMapperTest
import
paddle
class
TestScatterOp
(
OpMapperTest
):
class
TestScatterOp
(
OpMapperTest
):
def
init_input_data
(
self
):
def
init_input_data
(
self
):
...
...
test/cinn/op_mappers/test_sign_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_split_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_squeeze_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_stack_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_strided_slice_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_take_along_axis_op.py
浏览文件 @
6a8847f3
...
@@ -13,8 +13,10 @@
...
@@ -13,8 +13,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
from
op_mapper_test
import
OpMapperTest
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_tile_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_transpose2_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_triangular_solve_op.py
浏览文件 @
6a8847f3
...
@@ -15,7 +15,9 @@
...
@@ -15,7 +15,9 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
op_mapper_test
import
OpMapperTest
from
op_mapper_test
import
OpMapperTest
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_unary_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_uniform_random_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/op_mappers/test_where_op.py
浏览文件 @
6a8847f3
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
op_mapper_test
import
OpMapperTest
,
logger
from
op_mapper_test
import
OpMapperTest
,
logger
import
paddle
import
paddle
...
...
test/cinn/ops/op_test.py
浏览文件 @
6a8847f3
...
@@ -12,18 +12,19 @@
...
@@ -12,18 +12,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
logging
import
os
import
struct
import
unittest
import
unittest
from
contextlib
import
contextmanager
import
numpy
as
np
from
cinn
import
Target
from
cinn
import
Target
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.runtime
import
seed
as
cinn_seed
from
cinn.runtime
import
seed
as
cinn_seed
import
numpy
as
np
import
paddle
import
logging
from
contextlib
import
contextmanager
import
os
import
struct
import
paddle
logging
.
basicConfig
(
level
=
os
.
environ
.
get
(
'LOG_LEVEL'
,
'INFO'
).
upper
())
logging
.
basicConfig
(
level
=
os
.
environ
.
get
(
'LOG_LEVEL'
,
'INFO'
).
upper
())
logger
=
logging
.
getLogger
(
name
=
"op_test"
)
logger
=
logging
.
getLogger
(
name
=
"op_test"
)
...
...
test/cinn/ops/op_test_helper.py
浏览文件 @
6a8847f3
...
@@ -12,14 +12,13 @@
...
@@ -12,14 +12,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
sys
import
argparse
import
argparse
import
itertools
import
itertools
import
unittest
import
re
import
re
import
sys
import
unittest
from
typing
import
List
,
Union
from
unittest
import
suite
from
unittest
import
suite
from
typing
import
Union
,
List
parser
=
argparse
.
ArgumentParser
(
description
=
"Argparse for op test helper"
)
parser
=
argparse
.
ArgumentParser
(
description
=
"Argparse for op test helper"
)
parser
.
add_argument
(
parser
.
add_argument
(
...
...
test/cinn/ops/test_abs_op.py
浏览文件 @
6a8847f3
...
@@ -15,11 +15,13 @@
...
@@ -15,11 +15,13 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_acos_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_acosh_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_add_op.py
浏览文件 @
6a8847f3
...
@@ -13,12 +13,13 @@
...
@@ -13,12 +13,13 @@
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
numpy
as
np
import
paddle
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_arange_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_argsort_op.py
浏览文件 @
6a8847f3
...
@@ -15,13 +15,15 @@
...
@@ -15,13 +15,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
import
paddle
import
paddle
import
paddle.nn.functional
as
F
import
paddle.nn.functional
as
F
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_asin_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_asinh_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_atan2_op.py
浏览文件 @
6a8847f3
...
@@ -12,11 +12,12 @@
...
@@ -12,11 +12,12 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_atan_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_atanh_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_batch_norm_op.py
浏览文件 @
6a8847f3
...
@@ -14,14 +14,17 @@
...
@@ -14,14 +14,17 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
unittest
,
sys
import
sys
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_binary_elementwise_op.py
浏览文件 @
6a8847f3
...
@@ -15,12 +15,14 @@
...
@@ -15,12 +15,14 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_bitcast_convert_op.py
浏览文件 @
6a8847f3
...
@@ -13,14 +13,15 @@
...
@@ -13,14 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
from
struct
import
pack
,
unpack
from
op_test
import
OpTest
,
OpTestTool
import
paddle
import
cinn
import
cinn
from
cinn.frontend
import
*
import
numpy
as
np
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
struct
import
pack
,
unpack
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_bitwise_op.py
浏览文件 @
6a8847f3
...
@@ -13,11 +13,12 @@
...
@@ -13,11 +13,12 @@
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_broadcast_to_op.py
浏览文件 @
6a8847f3
...
@@ -14,14 +14,16 @@
...
@@ -14,14 +14,16 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
sys
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
import
sys
class
TestBroadcastToOp
(
OpTest
):
class
TestBroadcastToOp
(
OpTest
):
...
...
test/cinn/ops/test_broadcast_to_op_new.py
浏览文件 @
6a8847f3
...
@@ -14,11 +14,12 @@
...
@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_cast_op.py
浏览文件 @
6a8847f3
...
@@ -15,13 +15,15 @@
...
@@ -15,13 +15,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_cbrt_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_ceil_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_cholesky_op.py
浏览文件 @
6a8847f3
...
@@ -15,12 +15,13 @@
...
@@ -15,12 +15,13 @@
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
numpy
as
np
import
paddle
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_clz_op.py
浏览文件 @
6a8847f3
...
@@ -15,12 +15,13 @@
...
@@ -15,12 +15,13 @@
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
numpy
as
np
import
paddle
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
INT32_MAX
=
(
1
<<
31
)
-
1
INT32_MAX
=
(
1
<<
31
)
-
1
INT32_MIN
=
-
(
1
<<
31
)
INT32_MIN
=
-
(
1
<<
31
)
INT64_MAX
=
(
1
<<
63
)
-
1
INT64_MAX
=
(
1
<<
63
)
-
1
...
...
test/cinn/ops/test_comparison_op.py
浏览文件 @
6a8847f3
...
@@ -12,12 +12,13 @@
...
@@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_concat_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_constant_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_conv2d_op.py
浏览文件 @
6a8847f3
...
@@ -13,17 +13,18 @@
...
@@ -13,17 +13,18 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
paddle
import
unittest
import
unittest
from
cinn.frontend
import
*
import
cinn
import
numpy
as
np
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.runtime
import
*
from
cinn.runtime
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
set_cinn_cudnn_deterministic
(
True
)
set_cinn_cudnn_deterministic
(
True
)
paddle
.
fluid
.
set_flags
({
'FLAGS_cudnn_deterministic'
:
1
})
paddle
.
fluid
.
set_flags
({
'FLAGS_cudnn_deterministic'
:
1
})
...
...
test/cinn/ops/test_cos_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_cosh_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_depthwise_conv2d_op.py
浏览文件 @
6a8847f3
...
@@ -12,13 +12,14 @@
...
@@ -12,13 +12,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
paddle.nn
as
nn
import
paddle.nn
as
nn
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_divide_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_dropout_infer_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_erf_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_exp_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_expand_dims.py
浏览文件 @
6a8847f3
...
@@ -14,11 +14,12 @@
...
@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_fill_constant_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_floor_divide_op.py
浏览文件 @
6a8847f3
...
@@ -15,14 +15,16 @@
...
@@ -15,14 +15,16 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
paddle.nn.functional
as
F
import
paddle.nn.functional
as
F
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_floor_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_gather_nd_op.py
浏览文件 @
6a8847f3
...
@@ -14,16 +14,18 @@
...
@@ -14,16 +14,18 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
logging
import
os
import
unittest
import
unittest
from
itertools
import
product
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
import
logging
import
os
from
itertools
import
product
logging
.
basicConfig
(
level
=
os
.
environ
.
get
(
'LOG_LEVEL'
,
'INFO'
).
upper
())
logging
.
basicConfig
(
level
=
os
.
environ
.
get
(
'LOG_LEVEL'
,
'INFO'
).
upper
())
logger
=
logging
.
getLogger
(
name
=
"gather_nd"
)
logger
=
logging
.
getLogger
(
name
=
"gather_nd"
)
...
...
test/cinn/ops/test_gather_op.py
浏览文件 @
6a8847f3
...
@@ -14,17 +14,19 @@
...
@@ -14,17 +14,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
logging
import
os
import
unittest
import
unittest
from
itertools
import
product
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
import
logging
import
os
from
itertools
import
product
logging
.
basicConfig
(
level
=
os
.
environ
.
get
(
'LOG_LEVEL'
,
'INFO'
).
upper
())
logging
.
basicConfig
(
level
=
os
.
environ
.
get
(
'LOG_LEVEL'
,
'INFO'
).
upper
())
logger
=
logging
.
getLogger
(
name
=
"gather"
)
logger
=
logging
.
getLogger
(
name
=
"gather"
)
...
...
test/cinn/ops/test_gaussian_random_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_gelu_op.py
浏览文件 @
6a8847f3
...
@@ -15,14 +15,16 @@
...
@@ -15,14 +15,16 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
paddle.nn.functional
as
F
import
paddle.nn.functional
as
F
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_identity_op.py
浏览文件 @
6a8847f3
...
@@ -15,11 +15,13 @@
...
@@ -15,11 +15,13 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_is_finite_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,15 @@
...
@@ -14,13 +14,15 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
unittest
import
unittest
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_is_inf_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,15 @@
...
@@ -14,13 +14,15 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
unittest
import
unittest
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_is_nan_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,15 @@
...
@@ -14,13 +14,15 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
unittest
import
unittest
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_isclose_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_left_shift_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_log_op.py
浏览文件 @
6a8847f3
...
@@ -12,12 +12,13 @@
...
@@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
from
op_test
import
OpTest
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
class
TestLogOp
(
OpTest
):
class
TestLogOp
(
OpTest
):
...
...
test/cinn/ops/test_logical_and_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_logical_not_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_logical_or_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_logical_right_shift_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_logical_xor_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_lookup_table_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
paddle.nn.functional
as
F
import
paddle.nn.functional
as
F
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_matmul_op.py
浏览文件 @
6a8847f3
...
@@ -15,14 +15,16 @@
...
@@ -15,14 +15,16 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
paddle.nn.functional
as
F
import
paddle.nn.functional
as
F
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_max_op.py
浏览文件 @
6a8847f3
...
@@ -14,11 +14,12 @@
...
@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_min_op.py
浏览文件 @
6a8847f3
...
@@ -14,11 +14,12 @@
...
@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_mod_op.py
浏览文件 @
6a8847f3
...
@@ -15,13 +15,15 @@
...
@@ -15,13 +15,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_mul_op.py
浏览文件 @
6a8847f3
...
@@ -14,15 +14,17 @@
...
@@ -14,15 +14,17 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
sys
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
import
paddle
import
paddle
import
paddle.nn.functional
as
F
import
paddle.nn.functional
as
F
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
import
sys
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_multiply_op.py
浏览文件 @
6a8847f3
...
@@ -15,11 +15,12 @@
...
@@ -15,11 +15,12 @@
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_negative_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_one_hot_op.py
浏览文件 @
6a8847f3
...
@@ -15,14 +15,16 @@
...
@@ -15,14 +15,16 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
paddle.nn.functional
as
F
import
paddle.nn.functional
as
F
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_pool2d_op.py
浏览文件 @
6a8847f3
...
@@ -14,11 +14,12 @@
...
@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
paddle
import
_C_ops
from
paddle
import
_C_ops
...
...
test/cinn/ops/test_popc_op.py
浏览文件 @
6a8847f3
...
@@ -15,12 +15,13 @@
...
@@ -15,12 +15,13 @@
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
numpy
as
np
import
paddle
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
INT32_MAX
=
(
1
<<
31
)
-
1
INT32_MAX
=
(
1
<<
31
)
-
1
INT32_MIN
=
-
(
1
<<
31
)
INT32_MIN
=
-
(
1
<<
31
)
INT64_MAX
=
(
1
<<
63
)
-
1
INT64_MAX
=
(
1
<<
63
)
-
1
...
...
test/cinn/ops/test_pow_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_randint_op.py
浏览文件 @
6a8847f3
...
@@ -14,14 +14,16 @@
...
@@ -14,14 +14,16 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
random
import
seed
import
unittest
import
unittest
from
random
import
seed
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_reciprocal_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
class
TestReciprocalOp
(
OpTest
):
class
TestReciprocalOp
(
OpTest
):
...
...
test/cinn/ops/test_reduce_op.py
浏览文件 @
6a8847f3
...
@@ -15,12 +15,14 @@
...
@@ -15,12 +15,14 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
paddle
.
seed
(
2
)
paddle
.
seed
(
2
)
np
.
random
.
seed
(
2
)
np
.
random
.
seed
(
2
)
...
...
test/cinn/ops/test_reduce_op_new.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_relu6_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_relu_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
paddle.nn.functional
as
F
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle.nn.functional
as
F
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_remainder_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_repeat_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
numpy
as
np
import
numpy
as
np
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_reshape_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_resize_op.py
浏览文件 @
6a8847f3
...
@@ -15,12 +15,14 @@
...
@@ -15,12 +15,14 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
from
paddle.vision.transforms
import
functional
as
F
from
paddle.vision.transforms
import
functional
as
F
# paddle resize is based on cv2 module
# paddle resize is based on cv2 module
...
...
test/cinn/ops/test_reverse_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_right_shift_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_round_op.py
浏览文件 @
6a8847f3
...
@@ -12,12 +12,13 @@
...
@@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_rsqrt_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_scale_op.py
浏览文件 @
6a8847f3
...
@@ -13,13 +13,15 @@
...
@@ -13,13 +13,15 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_scatter_add.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
,
run_test
from
op_test_helper
import
TestCaseHelper
,
run_test
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_scatter_assign_op.py
浏览文件 @
6a8847f3
...
@@ -15,12 +15,13 @@
...
@@ -15,12 +15,13 @@
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
numpy
as
np
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_select_op.py
浏览文件 @
6a8847f3
...
@@ -12,12 +12,13 @@
...
@@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_sigmoid_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
paddle.nn.functional
as
F
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle.nn.functional
as
F
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_sign_op.py
浏览文件 @
6a8847f3
...
@@ -15,12 +15,13 @@
...
@@ -15,12 +15,13 @@
# limitations under the License.
# limitations under the License.
import
numpy
as
np
import
numpy
as
np
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_sin_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_sinh_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_slice_assign_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
numpy
as
np
import
numpy
as
np
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
def
paddle_slice_assign
(
data
,
update
,
axes
,
starts
,
ends
,
strides
):
def
paddle_slice_assign
(
data
,
update
,
axes
,
starts
,
ends
,
strides
):
assert
len
(
axes
)
==
len
(
starts
)
==
len
(
ends
)
==
len
(
strides
)
assert
len
(
axes
)
==
len
(
starts
)
==
len
(
ends
)
==
len
(
strides
)
...
...
test/cinn/ops/test_slice_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_softmax_op.py
浏览文件 @
6a8847f3
...
@@ -12,13 +12,14 @@
...
@@ -12,13 +12,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
paddle.nn.functional
as
F
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle.nn.functional
as
F
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_sort_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
from
op_test
import
OpTest
from
op_test_helper
import
TestCaseHelper
,
run_test
from
op_test_helper
import
TestCaseHelper
,
run_test
import
paddle
class
TestSortOp
(
OpTest
):
class
TestSortOp
(
OpTest
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
test/cinn/ops/test_split_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_sqrt_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_squeeze_op.py
浏览文件 @
6a8847f3
...
@@ -12,12 +12,13 @@
...
@@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
from
op_test
import
OpTest
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
class
TestSqueezeOp
(
OpTest
):
class
TestSqueezeOp
(
OpTest
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
test/cinn/ops/test_subtract_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_sum_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_tan_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_tanh_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_top_k_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
,
run_test
from
op_test_helper
import
TestCaseHelper
,
run_test
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_transpose_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
not
is_compiled_with_cuda
(),
"x86 test will be skipped due to timeout."
...
...
test/cinn/ops/test_triangular_solve_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
,
run_test
from
op_test_helper
import
TestCaseHelper
,
run_test
import
paddle
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
not
is_compiled_with_cuda
(),
"triangular solve op support GPU only now."
not
is_compiled_with_cuda
(),
"triangular solve op support GPU only now."
...
...
test/cinn/ops/test_trunc_op.py
浏览文件 @
6a8847f3
...
@@ -14,13 +14,14 @@
...
@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_unary_elementwise_op.py
浏览文件 @
6a8847f3
...
@@ -15,12 +15,14 @@
...
@@ -15,12 +15,14 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_uniform_random_op.py
浏览文件 @
6a8847f3
...
@@ -14,12 +14,13 @@
...
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
cinn
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
from
op_test_helper
import
TestCaseHelper
from
op_test_helper
import
TestCaseHelper
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
@
OpTestTool
.
skip_if
(
@
OpTestTool
.
skip_if
(
...
...
test/cinn/ops/test_zero_dim_tensor.py
浏览文件 @
6a8847f3
...
@@ -15,12 +15,14 @@
...
@@ -15,12 +15,14 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
op_test
import
OpTest
,
OpTestTool
from
op_test
import
OpTest
,
OpTestTool
import
paddle
import
paddle
import
cinn
from
cinn.frontend
import
*
from
cinn.common
import
*
def
cinn_dtype_convert
(
dtype_str
):
def
cinn_dtype_convert
(
dtype_str
):
...
...
test/cinn/passes/pass_test.py
浏览文件 @
6a8847f3
...
@@ -12,12 +12,17 @@
...
@@ -12,12 +12,17 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
cinn.frontend
import
NetBuilder
,
Variable
from
cinn.frontend
import
get_default_program_pass
,
get_default_graph_pass
import
logging
import
logging
import
os
import
os
from
test.cinn.ops.op_test
import
OpTest
from
test.cinn.ops.op_test
import
OpTest
from
cinn.frontend
import
(
NetBuilder
,
Variable
,
get_default_graph_pass
,
get_default_program_pass
,
)
logging
.
basicConfig
(
level
=
os
.
environ
.
get
(
'LOG_LEVEL'
,
'INFO'
).
upper
())
logging
.
basicConfig
(
level
=
os
.
environ
.
get
(
'LOG_LEVEL'
,
'INFO'
).
upper
())
logger
=
logging
.
getLogger
(
name
=
"pass_test"
)
logger
=
logging
.
getLogger
(
name
=
"pass_test"
)
...
...
test/cinn/passes/test_auto_cast_pass.py
浏览文件 @
6a8847f3
...
@@ -15,9 +15,10 @@
...
@@ -15,9 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
pass_test
import
PassTest
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
pass_test
import
PassTest
class
TestAutoCastPass
(
PassTest
):
class
TestAutoCastPass
(
PassTest
):
...
...
test/cinn/passes/test_expand_zero_dim_pass.py
浏览文件 @
6a8847f3
...
@@ -15,10 +15,11 @@
...
@@ -15,10 +15,11 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
pass_test
import
PassTest
from
cinn.frontend
import
*
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
from
cinn.common
import
*
from
cinn.frontend
import
*
from
pass_test
import
PassTest
class
TestExpandZeroDimPass
(
PassTest
):
class
TestExpandZeroDimPass
(
PassTest
):
...
...
test/cinn/passes/test_transpose_floding_input_pass.py
浏览文件 @
6a8847f3
...
@@ -15,9 +15,10 @@
...
@@ -15,9 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
pass_test
import
PassTest
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
pass_test
import
PassTest
class
TestTransposeFoldingInputPass
(
PassTest
):
class
TestTransposeFoldingInputPass
(
PassTest
):
...
...
test/cinn/passes/test_transpose_floding_output_pass.py
浏览文件 @
6a8847f3
...
@@ -15,9 +15,10 @@
...
@@ -15,9 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
from
pass_test
import
PassTest
from
cinn.frontend
import
*
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.frontend
import
*
from
pass_test
import
PassTest
class
TestTransposeFoldingOutputPass
(
PassTest
):
class
TestTransposeFoldingOutputPass
(
PassTest
):
...
...
test/cinn/pool_utils.py
浏览文件 @
6a8847f3
...
@@ -15,9 +15,10 @@
...
@@ -15,9 +15,10 @@
# limitations under the License.
# limitations under the License.
import
math
import
math
import
numpy
as
np
import
sys
import
sys
import
numpy
as
np
def
pool2d
(
np_data
,
attrs
,
dtype
=
"float32"
):
def
pool2d
(
np_data
,
attrs
,
dtype
=
"float32"
):
pool_type
=
"max"
pool_type
=
"max"
...
...
test/cinn/test_common.py
浏览文件 @
6a8847f3
...
@@ -15,11 +15,9 @@
...
@@ -15,11 +15,9 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
Target
,
ir
,
lang
,
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn
import
Target
from
cinn.common
import
*
from
cinn.common
import
*
...
...
test/cinn/test_computation.py
浏览文件 @
6a8847f3
...
@@ -14,20 +14,19 @@
...
@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
sys
import
paddle.fluid
as
fluid
import
paddle.static
as
static
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
import
paddle.fluid
as
fluid
import
paddle.static
as
static
assert
len
(
sys
.
argv
)
==
3
assert
len
(
sys
.
argv
)
==
3
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_efficientnet.py
浏览文件 @
6a8847f3
...
@@ -14,20 +14,19 @@
...
@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
as
paddle
import
sys
import
paddle.fluid
as
fluid
import
time
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
import
time
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
as
paddle
import
paddle.fluid
as
fluid
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_facedet.py
浏览文件 @
6a8847f3
...
@@ -14,20 +14,19 @@
...
@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
as
paddle
import
sys
import
paddle.fluid
as
fluid
import
time
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
import
time
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
as
paddle
import
paddle.fluid
as
fluid
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_frontend.py
浏览文件 @
6a8847f3
...
@@ -14,19 +14,18 @@
...
@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
sys
import
paddle.fluid
as
fluid
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
import
paddle.fluid
as
fluid
assert
len
(
sys
.
argv
)
==
1
+
2
+
1
# model and enable_gpu count
assert
len
(
sys
.
argv
)
==
1
+
2
+
1
# model and enable_gpu count
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_hlir_framework.py
浏览文件 @
6a8847f3
...
@@ -12,9 +12,10 @@
...
@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
cinn.framework
import
*
import
unittest
import
unittest
import
numpy
as
np
import
numpy
as
np
from
cinn.framework
import
*
class
TensorTest
(
unittest
.
TestCase
):
class
TensorTest
(
unittest
.
TestCase
):
...
...
test/cinn/test_ir.py
浏览文件 @
6a8847f3
...
@@ -15,14 +15,12 @@
...
@@ -15,14 +15,12 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
Target
,
ir
,
lang
,
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.optim
import
*
from
cinn
import
Target
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.ir
import
*
from
cinn.ir
import
*
from
cinn.optim
import
*
class
TestIR
(
unittest
.
TestCase
):
class
TestIR
(
unittest
.
TestCase
):
...
...
test/cinn/test_matmul.py
浏览文件 @
6a8847f3
...
@@ -15,13 +15,10 @@
...
@@ -15,13 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
cinn
import
cinn
from
cinn
import
runtime
import
numpy
as
np
from
cinn
import
ir
from
cinn
import
Target
,
ir
,
lang
,
runtime
,
utils
from
cinn
import
lang
from
cinn
import
Target
from
cinn
import
utils
from
cinn.poly
import
create_stages
from
cinn.poly
import
create_stages
...
...
test/cinn/test_mobilenetv1.py
浏览文件 @
6a8847f3
...
@@ -14,20 +14,19 @@
...
@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
as
paddle
import
sys
import
paddle.fluid
as
fluid
import
time
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
import
time
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
as
paddle
import
paddle.fluid
as
fluid
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_mobilenetv2.py
浏览文件 @
6a8847f3
...
@@ -14,20 +14,19 @@
...
@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
as
paddle
import
sys
import
paddle.fluid
as
fluid
import
time
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
import
time
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
as
paddle
import
paddle.fluid
as
fluid
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_netbuilder.py
浏览文件 @
6a8847f3
...
@@ -14,19 +14,18 @@
...
@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
sys
import
paddle.static
as
static
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
import
paddle.static
as
static
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_op_benchmark.py
浏览文件 @
6a8847f3
...
@@ -14,19 +14,18 @@
...
@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
import
sys
import
paddle.static
as
static
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
import
paddle.static
as
static
assert
len
(
sys
.
argv
)
==
2
assert
len
(
sys
.
argv
)
==
2
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_op_broadcast.py
浏览文件 @
6a8847f3
...
@@ -14,18 +14,14 @@
...
@@ -14,18 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
unittest
import
logging
import
math
import
math
import
numpy
as
np
import
unittest
import
cinn
import
cinn
from
cinn
import
frontend
import
numpy
as
np
from
cinn
import
runtime
from
cinn
import
common
,
framework
,
frontend
,
ir
,
lang
,
runtime
from
cinn
import
lang
from
cinn
import
framework
from
cinn
import
ir
from
cinn
import
common
from
cinn.poly
import
create_stages
from
cinn.poly
import
create_stages
import
logging
from
test_utils
import
SingleOpTester
from
test_utils
import
SingleOpTester
...
...
test/cinn/test_op_nn.py
浏览文件 @
6a8847f3
...
@@ -14,22 +14,19 @@
...
@@ -14,22 +14,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
as
paddle
import
logging
import
numpy
as
np
import
unittest
import
math
import
math
import
unittest
import
cinn
import
cinn
from
cinn
import
frontend
import
conv2d_utils
from
cinn
import
runtime
import
numpy
as
np
from
cinn
import
lang
import
pool_utils
from
cinn
import
framework
from
cinn
import
common
,
framework
,
frontend
,
ir
,
lang
,
runtime
from
cinn
import
ir
from
cinn
import
common
from
cinn.poly
import
create_stages
from
cinn.poly
import
create_stages
import
logging
from
test_utils
import
SingleOpTester
from
test_utils
import
SingleOpTester
import
pool_utils
import
conv2d_utils
import
paddle
as
paddle
class
OpTest_relu
(
SingleOpTester
):
class
OpTest_relu
(
SingleOpTester
):
...
...
test/cinn/test_op_transform.py
浏览文件 @
6a8847f3
...
@@ -14,22 +14,19 @@
...
@@ -14,22 +14,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
unittest
import
logging
import
math
import
math
import
numpy
as
np
import
os
import
unittest
import
cinn
import
cinn
from
cinn
import
frontend
import
numpy
as
np
from
cinn
import
runtime
from
cinn
import
common
,
framework
,
frontend
,
ir
,
lang
,
runtime
from
cinn
import
lang
from
cinn
import
framework
from
cinn
import
ir
from
cinn
import
common
from
cinn.poly
import
create_stages
from
cinn.poly
import
create_stages
import
logging
from
test_utils
import
SingleOpTester
from
test_utils
import
SingleOpTester
import
paddle
import
paddle
import
paddle.static
as
static
import
paddle.static
as
static
import
os
os
.
environ
[
"KMP_DUPLICATE_LIB_OK"
]
=
"TRUE"
os
.
environ
[
"KMP_DUPLICATE_LIB_OK"
]
=
"TRUE"
...
...
test/cinn/test_packed_func.py
浏览文件 @
6a8847f3
...
@@ -15,12 +15,12 @@
...
@@ -15,12 +15,12 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
numpy
as
np
import
cinn
from
cinn
import
ir
from
cinn
import
CINNValue
from
math
import
isclose
from
math
import
isclose
import
cinn
import
numpy
as
np
from
cinn
import
CINNValue
,
ir
class
TestPackedFunc
(
unittest
.
TestCase
):
class
TestPackedFunc
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
test/cinn/test_paddle_model_convertor.py
浏览文件 @
6a8847f3
...
@@ -14,18 +14,20 @@
...
@@ -14,18 +14,20 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
os
,
sys
import
argparse
import
numpy
as
np
import
logging
import
os
import
sys
import
unittest
import
unittest
import
logging
,
argparse
import
paddle
import
numpy
as
np
from
cinn.common
import
DefaultNVGPUTarget
,
is_compiled_with_cuda
from
cinn.frontend
import
PaddleModelConvertor
from
cinn.frontend
import
PaddleModelConvertor
from
cinn.common
import
is_compiled_with_cuda
,
DefaultNVGPUTarget
from
cinn.runtime
import
seed
as
cinn_seed
from
cinn.runtime
import
seed
as
cinn_seed
from
ops.op_test
import
OpTestTool
from
op_mappers.op_mapper_test
import
OpMapperTest
from
op_mappers.op_mapper_test
import
OpMapperTest
from
ops.op_test
import
OpTestTool
import
paddle
logging
.
basicConfig
(
level
=
os
.
environ
.
get
(
'LOG_LEVEL'
,
'INFO'
).
upper
())
logging
.
basicConfig
(
level
=
os
.
environ
.
get
(
'LOG_LEVEL'
,
'INFO'
).
upper
())
logger
=
logging
.
getLogger
(
name
=
"paddle_model_convertor"
)
logger
=
logging
.
getLogger
(
name
=
"paddle_model_convertor"
)
...
...
test/cinn/test_pe_elementwise.py
浏览文件 @
6a8847f3
...
@@ -15,16 +15,13 @@
...
@@ -15,16 +15,13 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn
import
runtime
from
cinn
import
ir
from
cinn.poly
import
create_stages
from
cinn
import
lang
from
cinn
import
Target
from
cinn
import
pe
from
cinn.common
import
*
import
scipy
import
scipy
from
cinn
import
Target
,
ir
,
lang
,
pe
,
runtime
from
cinn.common
import
*
from
cinn.poly
import
create_stages
from
scipy
import
special
from
scipy
import
special
...
...
test/cinn/test_pe_reduction.py
浏览文件 @
6a8847f3
...
@@ -15,13 +15,10 @@
...
@@ -15,13 +15,10 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn
import
runtime
from
cinn
import
Target
,
ir
,
lang
,
pe
,
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn
import
Target
from
cinn
import
pe
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.poly
import
create_stages
from
cinn.poly
import
create_stages
...
...
test/cinn/test_pe_transform.py
浏览文件 @
6a8847f3
...
@@ -15,15 +15,12 @@
...
@@ -15,15 +15,12 @@
# limitations under the License.
# limitations under the License.
import
unittest
import
unittest
import
cinn
import
cinn
import
numpy
as
np
import
numpy
as
np
from
cinn
import
runtime
from
cinn
import
Target
,
ir
,
lang
,
pe
,
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn
import
Target
from
cinn
import
pe
from
cinn.poly
import
create_stages
from
cinn.common
import
*
from
cinn.common
import
*
from
cinn.poly
import
create_stages
class
TestPETransform
(
unittest
.
TestCase
):
class
TestPETransform
(
unittest
.
TestCase
):
...
...
test/cinn/test_resnet.py
浏览文件 @
6a8847f3
...
@@ -14,19 +14,18 @@
...
@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
as
paddle
import
sys
import
paddle.fluid
as
fluid
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
as
paddle
import
paddle.fluid
as
fluid
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_resnet18.py
浏览文件 @
6a8847f3
...
@@ -14,20 +14,19 @@
...
@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
as
paddle
import
sys
import
paddle.fluid
as
fluid
import
time
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
import
time
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
as
paddle
import
paddle.fluid
as
fluid
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_resnet50.py
浏览文件 @
6a8847f3
...
@@ -14,20 +14,19 @@
...
@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
as
paddle
import
sys
import
paddle.fluid
as
fluid
import
time
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
import
time
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
as
paddle
import
paddle.fluid
as
fluid
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_squeezenet.py
浏览文件 @
6a8847f3
...
@@ -14,20 +14,19 @@
...
@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
paddle
as
paddle
import
sys
import
paddle.fluid
as
fluid
import
time
from
cinn.frontend
import
*
from
cinn
import
Target
from
cinn.framework
import
*
import
unittest
import
unittest
import
cinn
import
cinn
from
cinn
import
runtime
from
cinn
import
ir
from
cinn
import
lang
from
cinn.common
import
*
import
numpy
as
np
import
numpy
as
np
import
sys
from
cinn
import
Target
,
ir
,
lang
,
runtime
import
time
from
cinn.common
import
*
from
cinn.framework
import
*
from
cinn.frontend
import
*
import
paddle
as
paddle
import
paddle.fluid
as
fluid
enable_gpu
=
sys
.
argv
.
pop
()
enable_gpu
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
model_dir
=
sys
.
argv
.
pop
()
...
...
test/cinn/test_utils.py
浏览文件 @
6a8847f3
...
@@ -14,18 +14,14 @@
...
@@ -14,18 +14,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
unittest
import
logging
import
math
import
math
import
numpy
as
np
import
unittest
import
cinn
import
cinn
from
cinn
import
frontend
import
numpy
as
np
from
cinn
import
runtime
from
cinn
import
common
,
framework
,
frontend
,
ir
,
lang
,
runtime
from
cinn
import
lang
from
cinn
import
framework
from
cinn
import
ir
from
cinn
import
common
from
cinn.poly
import
create_stages
from
cinn.poly
import
create_stages
import
logging
class
SingleOpTester
(
unittest
.
TestCase
):
class
SingleOpTester
(
unittest
.
TestCase
):
...
...
tools/cinn/gen_c++_tutorial.py
浏览文件 @
6a8847f3
...
@@ -23,9 +23,9 @@ This script helps to extract the tutorial content from a C++ source file.
...
@@ -23,9 +23,9 @@ This script helps to extract the tutorial content from a C++ source file.
# - @ROC, the code block inside a C++ multi-line string guard `ROC()ROC`,
# - @ROC, the code block inside a C++ multi-line string guard `ROC()ROC`,
# display as a markdown code block.
# display as a markdown code block.
import
logging
import
sys
import
sys
from
typing
import
List
from
typing
import
List
import
logging
class
Markdown
(
object
):
class
Markdown
(
object
):
...
...
tools/cinn/paddle_benchmark/paddle_save_model.py
浏览文件 @
6a8847f3
...
@@ -12,9 +12,12 @@
...
@@ -12,9 +12,12 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
os
import
sys
import
numpy
import
numpy
import
sys
,
os
import
numpy
as
np
import
numpy
as
np
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle.static
as
static
import
paddle.static
as
static
...
...
tools/cinn/paddle_benchmark/paddle_test_benchmark.py
浏览文件 @
6a8847f3
...
@@ -14,10 +14,11 @@
...
@@ -14,10 +14,11 @@
import
argparse
import
argparse
import
time
import
time
import
numpy
as
np
import
numpy
as
np
from
paddle.fluid.core
import
AnalysisConfig
from
paddle.fluid.core
import
create_paddle_predictor
import
paddle.inference
as
paddle_infer
import
paddle.inference
as
paddle_infer
from
paddle.fluid.core
import
AnalysisConfig
,
create_paddle_predictor
def
main
():
def
main
():
...
...
tools/cinn/paddle_benchmark/test_paddle_ops.py
浏览文件 @
6a8847f3
...
@@ -12,15 +12,17 @@
...
@@ -12,15 +12,17 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
sys
,
os
import
argparse
import
os
import
sys
import
time
import
numpy
as
np
import
numpy
as
np
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle.static
as
static
import
paddle.static
as
static
import
time
from
paddle.fluid.core
import
AnalysisConfig
,
create_paddle_predictor
import
argparse
from
paddle.fluid.core
import
AnalysisConfig
from
paddle.fluid.core
import
create_paddle_predictor
def
set_config
(
op_name
,
input_shapes
,
enable_gpu
=
False
):
def
set_config
(
op_name
,
input_shapes
,
enable_gpu
=
False
):
...
...
tools/cinn/tvm_benchmark/test_topi_default.py
浏览文件 @
6a8847f3
...
@@ -12,14 +12,14 @@
...
@@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
os
import
timeit
import
numpy
import
tvm
import
tvm
import
tvm.testing
import
tvm.testing
from
tvm
import
te
from
tvm
import
te
,
topi
import
numpy
from
tvm.contrib
import
ndk
,
tar
import
timeit
from
tvm.contrib
import
tar
,
ndk
import
os
from
tvm
import
topi
dtype
=
[
"float32"
,
"float32"
,
"float32"
,
"float32"
]
dtype
=
[
"float32"
,
"float32"
,
"float32"
,
"float32"
]
target
=
"llvm"
target
=
"llvm"
...
...
tools/cinn/tvm_benchmark/tvm_graph_with_single_op.py
浏览文件 @
6a8847f3
...
@@ -15,15 +15,12 @@
...
@@ -15,15 +15,12 @@
import
os
import
os
import
numpy
as
np
import
numpy
as
np
import
tvm
import
tvm
from
tvm
import
te
import
tvm.contrib.graph_runtime
as
runtime
from
tvm
import
autotvm
from
tvm
import
relay
import
tvm.relay.testing
import
tvm.relay.testing
from
tvm.autotvm.tuner
import
XGBTuner
,
GATuner
,
RandomTuner
,
GridSearchTuner
from
tvm
import
autotvm
,
relay
,
te
from
tvm.autotvm.tuner
import
GATuner
,
GridSearchTuner
,
RandomTuner
,
XGBTuner
from
tvm.contrib.utils
import
tempdir
from
tvm.contrib.utils
import
tempdir
import
tvm.contrib.graph_runtime
as
runtime
# To test different ops, change this single-op network.
# To test different ops, change this single-op network.
# See https://github.com/apache/incubator-tvm/blob/main/docs/langref/relay_op.rst to get the op list.
# See https://github.com/apache/incubator-tvm/blob/main/docs/langref/relay_op.rst to get the op list.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录