PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
21.8k stars 5.47k forks source link

[Cleanup] `to_variable` -> `paddle.to_tensor` 问题汇总 #61146

Closed gouzil closed 5 months ago

gouzil commented 5 months ago

背景

我们在单测中发现还有许多旧的to_variable API,没有被新的to_tensor API 替换,为了做到 API 统一,开始逐步清除to_variable API 的使用

具体例子

x = np.ones([2, 2], np.float32)
y = base.dygraph.to_variable(x)

修改后:

x = np.ones([2, 2], np.float32)
y = paddle.to_tensor(x)

任务列表

✅:已经完全迁移,所有单测都OK! 🟢:审核完毕待合入,合入之后完全迁移! 🔵:可认领! 🟡:当前阶段不需要人力继续跟进,下阶段推进(大部分是精度问题) 🚧:迁移中,单测还没有过,还没有审核完。

大致正常流程为: 🔵 -> 🚧 -> 🟢 -> ✅

异常流程为: 🔵 -> 🚧 -> 🟡

### 第一阶段:(整体进展:0/19) > test 目录下文件清理
序号 文件位置 认领人 PR
🔵1 check_flags_mkldnn_ops_on_off.py
check_flags_use_mkldnn.py
ifelse_simple_func.py
op_test.py
parallel_dygraph_control_flow_same.py
parallel_dygraph_mnist.py
parallel_dygraph_se_resnext.py
parallel_dygraph_shared_unused_var.py
parallel_dygraph_sparse_embedding.py
parallel_dygraph_sync_batch_norm.py
🔵2 parallel_dygraph_transformer.py
seq2seq_dygraph_model.py
simnet_dygraph_model.py
test_activation_op.py
test_adam_op.py
test_adaptive_avg_pool1d.py
test_adaptive_max_pool1d.py
test_addmm_op.py
test_affine_grid_function.py
test_array_read_write_op.py
🔵3 test_assert.py
test_basic_api_transformation.py
test_batch_norm_op.py
test_bicubic_interp_op.py
test_bicubic_interp_v2_op.py
test_bincount_op.py
test_bmm_op.py
test_bmn.py
test_cache_program.py
test_cast.py
🔵4 test_cholesky_op.py
test_chunk_op.py
test_coalesce_tensor_op.py
test_complex_elementwise_layers.py
test_complex_getitem.py
test_complex_kron.py
test_complex_matmul.py
test_complex_reshape.py
test_complex_sum_layer.py
test_complex_trace_layer.py
🔵5 test_complex_transpose.py
test_complex_variable.py
test_conv2d_api.py
test_conv2d_transpose_layer.py
test_conv3d_transpose_layer.py
test_convert_call.py
test_correlation.py
test_cross_op.py
test_cycle_gan.py
test_declarative.py
🔵6 test_detach.py
test_detection.py
test_dict.py
test_directory_migration.py
test_dot_op.py
test_dropout_op.py
test_dropout_op_xpu.py
test_dygraph_mnist_fp16.py
test_dygraph_multi_forward.py
test_dygraph_weight_norm.py
🔵7 test_egr_python_api.py
test_eig_op.py
test_elementwise_add_op.py
test_elementwise_add_op_xpu.py
test_elementwise_add_op_xpu_kp.py
test_elementwise_pow_op.py
test_elementwise_sub_op.py
test_erf_op.py
test_exception.py
test_fill_constant_op.py
🔵8 test_fleet_base.py
test_flip.py
test_for_enumerate.py
test_functional_conv1d.py
test_functional_conv1d_transpose.py
test_functional_conv2d.py
test_functional_conv2d_transpose.py
test_functional_conv3d.py
test_functional_conv3d_transpose.py
test_gather_nd_op.py
🔵9 test_gelu_op.py
test_grad_clip_minimize.py
test_gradient_clip.py
test_group_norm_op.py
test_histogram_op.py
test_ifelse.py
test_imperative_auto_mixed_precision_for_eager.py
test_imperative_container_layerlist.py
test_imperative_container_parameterlist.py
test_imperative_container_sequential.py
🔵10 test_imperative_deepcf.py
test_imperative_double_grad.py
test_imperative_framework.py
test_imperative_gan.py
test_imperative_gnn.py
test_imperative_hook_for_layer.py
test_imperative_layer_trainable.py
test_imperative_lod_tensor_to_selected_rows.py
test_imperative_mnist_sorted_gradient.py
test_imperative_named_members.py
🔵11 test_imperative_ocr_attention_model.py
test_imperative_optimizer.py
test_imperative_optimizer_v2.py
test_imperative_parallel_coalesce_split.py
test_imperative_partitial_backward.py
test_imperative_ptb_rnn.py
test_imperative_ptb_rnn_sorted_gradient.py
test_imperative_recurrent_usage.py
test_imperative_reinforcement.py
test_imperative_resnet.py
🔵12 test_imperative_resnet_sorted_gradient.py
test_imperative_save_load_v2.py
test_imperative_selected_rows.py
test_imperative_selected_rows_to_lod_tensor.py
test_imperative_star_gan_with_gradient_penalty.py
test_imperative_trace_non_persistable_inputs.py
test_imperative_transformer_sorted_gradient.py
test_imperative_triple_grad.py
test_imperative_using_non_zero_gpu.py
test_index_select_op.py
🔵13 test_index_select_op_xpu.py
test_instance_norm_op.py
test_instance_norm_op_v2.py
test_inverse_op.py
test_inverse_op_xpu.py
test_jit_save_load.py
test_kron_op.py
test_label_smooth_functional.py
test_lac.py
test_learning_rate_scheduler.py
🔵14 test_legacy_error.py
test_linear_interp_op.py
test_linear_interp_v2_op.py
test_list.py
test_loop.py
test_matmul_op.py
test_matmul_op_xpu.py
test_matrix_power_op.py
test_mean_op.py
test_merged_adam_op.py
🔵15 test_merged_adam_op_xpu.py
test_meshgrid_op.py
test_mnist.py
test_mobile_net.py
test_mse_loss.py
test_nansum_api.py
test_nn_functional_hot_op.py
test_nonzero_api.py
test_one_hot_v2_op.py
test_one_hot_v2_op_xpu.py
🔵16 test_op_function_generator.py
test_optimizer_in_control_flow.py
test_paddle_imperative_double_grad.py
test_partial_program.py
test_pylayer.py
test_reduce_op.py
test_regularizer.py
test_regularizer_api.py
test_reinforcement_learning.py
test_repeat_interleave_op.py
🔵17 test_roll_op.py
test_rot90_op.py
test_save_load.py
test_scatter_nd_op.py
test_scatter_op.py
test_se_resnet.py
test_sentiment.py
test_slice_op.py
test_smooth_l1_loss.py
test_softmax_mask_fuse_op.py
🔵18 test_softmax_mask_fuse_upper_triangle_op.py
test_solve_op.py
test_stack_op.py
test_tensor_shape.py
test_traced_layer_err_msg.py
test_transpose_op.py
test_tril_triu_op.py
test_unfold_op.py
test_unfold_op_xpu.py
test_unstack_op.py
🔵19 test_where_op.py
test_where_op_xpu.py
test_word2vec.py
transformer_dygraph_model.py

认领方式

请大家以 comment 的形式认领任务,如:

【报名】:1、3、12-13

多个任务之间需要使用顿号分隔,报名多个连续任务可用横线表示,如 2-5 PR 提交格式:在 PR 的标题中以 【Cleanup to_variable No.】 开头,注明任务编号

看板信息

任务数量 🔵可认领 🚧迁移中 🟢待合入 ✅完成 🟡下阶段推进 完成率
19 19 0 0 0 0 0.0%
gouzil commented 5 months ago

任务合并至 https://github.com/PaddlePaddle/Paddle/issues/61385