Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
27e31f64
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
27e31f64
编写于
1月 16, 2018
作者:
T
typhoonzero
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/PaddlePaddle/Paddle
into dist_train_benchmark_vgg16
上级
373f8ba0
052c05be
变更
399
显示空白变更内容
内联
并排
Showing
399 changed file
with
5581 addition
and
127 deletion
+5581
-127
.copyright.hook
.copyright.hook
+106
-0
.pre-commit-config.yaml
.pre-commit-config.yaml
+8
-0
adversarial/advbox/attacks/base.py
adversarial/advbox/attacks/base.py
+13
-0
adversarial/advbox/attacks/gradientsign.py
adversarial/advbox/attacks/gradientsign.py
+13
-0
adversarial/advbox/models/base.py
adversarial/advbox/models/base.py
+13
-0
adversarial/advbox/models/paddle.py
adversarial/advbox/models/paddle.py
+13
-0
adversarial/fluid_mnist.py
adversarial/fluid_mnist.py
+13
-0
adversarial/mnist_tutorial_fgsm.py
adversarial/mnist_tutorial_fgsm.py
+13
-0
benchmark/paddle/image/alexnet.py
benchmark/paddle/image/alexnet.py
+13
-0
benchmark/paddle/image/googlenet.py
benchmark/paddle/image/googlenet.py
+13
-0
benchmark/paddle/image/provider.py
benchmark/paddle/image/provider.py
+13
-0
benchmark/paddle/image/resnet.py
benchmark/paddle/image/resnet.py
+13
-0
benchmark/paddle/image/smallnet_mnist_cifar.py
benchmark/paddle/image/smallnet_mnist_cifar.py
+13
-0
benchmark/paddle/image/vgg.py
benchmark/paddle/image/vgg.py
+13
-0
benchmark/paddle/rnn/provider.py
benchmark/paddle/rnn/provider.py
+13
-0
benchmark/paddle/rnn/rnn.py
benchmark/paddle/rnn/rnn.py
+13
-0
benchmark/tensorflow/image/alexnet.py
benchmark/tensorflow/image/alexnet.py
+13
-0
benchmark/tensorflow/image/alexnet_multi_gpu.py
benchmark/tensorflow/image/alexnet_multi_gpu.py
+13
-0
benchmark/tensorflow/image/googlenet.py
benchmark/tensorflow/image/googlenet.py
+13
-0
benchmark/tensorflow/image/smallnet_mnist_cifar.py
benchmark/tensorflow/image/smallnet_mnist_cifar.py
+13
-0
benchmark/tensorflow/rnn/reader.py
benchmark/tensorflow/rnn/reader.py
+13
-0
benchmark/tensorflow/rnn/rnn.py
benchmark/tensorflow/rnn/rnn.py
+13
-0
benchmark/tensorflow/rnn/rnn_multi_gpu.py
benchmark/tensorflow/rnn/rnn_multi_gpu.py
+13
-0
cmake/external/grpc.cmake
cmake/external/grpc.cmake
+1
-1
cmake/make_resource.py
cmake/make_resource.py
+13
-0
doc/api/v1/data_provider/src/mnist_config.py
doc/api/v1/data_provider/src/mnist_config.py
+13
-0
doc/api/v1/data_provider/src/mnist_provider.dict.py
doc/api/v1/data_provider/src/mnist_provider.dict.py
+13
-0
doc/api/v1/data_provider/src/sentimental_config.py
doc/api/v1/data_provider/src/sentimental_config.py
+13
-0
doc/api/v1/data_provider/src/sentimental_provider.py
doc/api/v1/data_provider/src/sentimental_provider.py
+13
-0
doc/api/v2/fluid/layers.rst
doc/api/v2/fluid/layers.rst
+6
-0
doc/api/v2/fluid/nets.rst
doc/api/v2/fluid/nets.rst
+5
-0
doc/faq/local/src/reduce_min_pool_size.py
doc/faq/local/src/reduce_min_pool_size.py
+13
-0
doc/faq/local/src/word2vec_config.py
doc/faq/local/src/word2vec_config.py
+13
-0
doc/faq/local/src/word2vec_dataprovider.py
doc/faq/local/src/word2vec_dataprovider.py
+13
-0
doc/getstarted/concepts/src/train.py
doc/getstarted/concepts/src/train.py
+13
-0
doc/howto/usage/cluster/src/k8s_train/start_paddle.py
doc/howto/usage/cluster/src/k8s_train/start_paddle.py
+13
-0
doc/howto/usage/cluster/src/word2vec/api_train_v2.py
doc/howto/usage/cluster/src/word2vec/api_train_v2.py
+13
-0
doc/howto/usage/cluster/src/word2vec/api_train_v2_cluster.py
doc/howto/usage/cluster/src/word2vec/api_train_v2_cluster.py
+13
-0
go/pserver/client/c/test/test_mnist.py
go/pserver/client/c/test/test_mnist.py
+13
-0
go/pserver/client/c/test/test_train.py
go/pserver/client/c/test/test_train.py
+13
-0
paddle/api/test/testTrainConfig.py
paddle/api/test/testTrainConfig.py
+13
-0
paddle/capi/examples/model_inference/common/common.h
paddle/capi/examples/model_inference/common/common.h
+13
-0
paddle/capi/examples/model_inference/dense/merge_v2_model.py
paddle/capi/examples/model_inference/dense/merge_v2_model.py
+13
-0
paddle/capi/examples/model_inference/dense/mnist_v2.py
paddle/capi/examples/model_inference/dense/mnist_v2.py
+13
-0
paddle/capi/examples/model_inference/dense/trainer_config.py
paddle/capi/examples/model_inference/dense/trainer_config.py
+13
-0
paddle/capi/examples/model_inference/sequence/trainer_config.py
.../capi/examples/model_inference/sequence/trainer_config.py
+13
-0
paddle/capi/tests/test_predict_network.py
paddle/capi/tests/test_predict_network.py
+13
-0
paddle/cuda/src/avx_mathfun.h
paddle/cuda/src/avx_mathfun.h
+13
-0
paddle/framework/backward_test.cc
paddle/framework/backward_test.cc
+13
-13
paddle/framework/dim.h
paddle/framework/dim.h
+13
-0
paddle/framework/dim_test.cu
paddle/framework/dim_test.cu
+13
-0
paddle/framework/eigen_test.cc
paddle/framework/eigen_test.cc
+13
-0
paddle/framework/lod_tensor_test.cc
paddle/framework/lod_tensor_test.cc
+13
-0
paddle/framework/lod_tensor_test.cu
paddle/framework/lod_tensor_test.cu
+13
-0
paddle/framework/tensor_test.cc
paddle/framework/tensor_test.cc
+13
-0
paddle/framework/tensor_util.h
paddle/framework/tensor_util.h
+2
-3
paddle/framework/tensor_util_test.cc
paddle/framework/tensor_util_test.cc
+13
-0
paddle/framework/variable.h
paddle/framework/variable.h
+13
-0
paddle/gserver/tests/img_conv_cudnn.py
paddle/gserver/tests/img_conv_cudnn.py
+13
-0
paddle/gserver/tests/img_conv_exconv.py
paddle/gserver/tests/img_conv_exconv.py
+13
-0
paddle/gserver/tests/sequence_recurrent.py
paddle/gserver/tests/sequence_recurrent.py
+13
-0
paddle/gserver/tests/sequence_rnn_matched_inputs.py
paddle/gserver/tests/sequence_rnn_matched_inputs.py
+13
-0
paddle/gserver/tests/sequence_rnn_mixed_inputs.py
paddle/gserver/tests/sequence_rnn_mixed_inputs.py
+13
-0
paddle/gserver/tests/sequence_rnn_multi_unequalength_inputs.py
...e/gserver/tests/sequence_rnn_multi_unequalength_inputs.py
+13
-0
paddle/operators/CMakeLists.txt
paddle/operators/CMakeLists.txt
+1
-1
paddle/operators/detail/grpc_client.cc
paddle/operators/detail/grpc_client.cc
+11
-5
paddle/operators/detail/grpc_client.h
paddle/operators/detail/grpc_client.h
+1
-1
paddle/operators/detail/grpc_server.cc
paddle/operators/detail/grpc_server.cc
+28
-20
paddle/operators/detail/grpc_server.h
paddle/operators/detail/grpc_server.h
+4
-2
paddle/operators/elementwise_add_op.h
paddle/operators/elementwise_add_op.h
+0
-18
paddle/operators/elementwise_div_op.h
paddle/operators/elementwise_div_op.h
+0
-1
paddle/operators/elementwise_mul_op.h
paddle/operators/elementwise_mul_op.h
+0
-1
paddle/operators/elementwise_op_function.h
paddle/operators/elementwise_op_function.h
+1
-2
paddle/operators/elementwise_sub_op.h
paddle/operators/elementwise_sub_op.h
+0
-18
paddle/operators/math/CMakeLists.txt
paddle/operators/math/CMakeLists.txt
+2
-0
paddle/operators/math/math_function_test.cc
paddle/operators/math/math_function_test.cc
+13
-0
paddle/operators/math/math_function_test.cu
paddle/operators/math/math_function_test.cu
+13
-0
paddle/operators/math/sequence_scale.cc
paddle/operators/math/sequence_scale.cc
+46
-0
paddle/operators/math/sequence_scale.cu
paddle/operators/math/sequence_scale.cu
+57
-0
paddle/operators/math/sequence_scale.h
paddle/operators/math/sequence_scale.h
+55
-0
paddle/operators/net_op.cc
paddle/operators/net_op.cc
+13
-0
paddle/operators/net_op_test.cc
paddle/operators/net_op_test.cc
+13
-0
paddle/operators/recv_op.cc
paddle/operators/recv_op.cc
+7
-3
paddle/operators/send_op.cc
paddle/operators/send_op.cc
+4
-4
paddle/operators/split_op.cc
paddle/operators/split_op.cc
+6
-0
paddle/operators/warpctc_op.h
paddle/operators/warpctc_op.h
+12
-1
paddle/optimizer/lr_policy.h
paddle/optimizer/lr_policy.h
+13
-0
paddle/optimizer/parameter_optimizer_test.cc
paddle/optimizer/parameter_optimizer_test.cc
+13
-0
paddle/optimizer/serialization_test.cc
paddle/optimizer/serialization_test.cc
+13
-0
paddle/optimizer/tensor.h
paddle/optimizer/tensor.h
+13
-0
paddle/platform/cpu_info_test.cc
paddle/platform/cpu_info_test.cc
+13
-0
paddle/platform/hostdevice.h
paddle/platform/hostdevice.h
+13
-0
paddle/platform/place_test.cc
paddle/platform/place_test.cc
+13
-0
paddle/pybind/print_operators_doc.cc
paddle/pybind/print_operators_doc.cc
+13
-0
paddle/scripts/cluster_train/paddle.py
paddle/scripts/cluster_train/paddle.py
+13
-0
paddle/scripts/cpplint.py
paddle/scripts/cpplint.py
+13
-0
paddle/string/piece.cc
paddle/string/piece.cc
+13
-0
paddle/string/piece.h
paddle/string/piece.h
+13
-0
paddle/string/piece_test.cc
paddle/string/piece_test.cc
+13
-0
paddle/string/printf.h
paddle/string/printf.h
+13
-0
paddle/string/printf_test.cc
paddle/string/printf_test.cc
+13
-0
paddle/string/tinyformat/tinyformat.h
paddle/string/tinyformat/tinyformat.h
+13
-0
paddle/trainer/tests/simple_sparse_neural_network.py
paddle/trainer/tests/simple_sparse_neural_network.py
+13
-0
paddle/trainer/tests/simple_sparse_neural_network_dp.py
paddle/trainer/tests/simple_sparse_neural_network_dp.py
+13
-0
paddle/utils/enable_virtualenv.py
paddle/utils/enable_virtualenv.py
+13
-0
proto/OptimizerConfig.proto
proto/OptimizerConfig.proto
+13
-0
python/paddle/trainer_config_helpers/tests/configs/img_layers.py
...paddle/trainer_config_helpers/tests/configs/img_layers.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/img_trans_layers.py
.../trainer_config_helpers/tests/configs/img_trans_layers.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/last_first_seq.py
...le/trainer_config_helpers/tests/configs/last_first_seq.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/layer_activations.py
...trainer_config_helpers/tests/configs/layer_activations.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/math_ops.py
...n/paddle/trainer_config_helpers/tests/configs/math_ops.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/projections.py
...addle/trainer_config_helpers/tests/configs/projections.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/shared_fc.py
.../paddle/trainer_config_helpers/tests/configs/shared_fc.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/shared_gru.py
...paddle/trainer_config_helpers/tests/configs/shared_gru.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/shared_lstm.py
...addle/trainer_config_helpers/tests/configs/shared_lstm.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/simple_rnn_layers.py
...trainer_config_helpers/tests/configs/simple_rnn_layers.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_BatchNorm3D.py
.../trainer_config_helpers/tests/configs/test_BatchNorm3D.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_bi_grumemory.py
...trainer_config_helpers/tests/configs/test_bi_grumemory.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_bilinear_interp.py
...iner_config_helpers/tests/configs/test_bilinear_interp.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_clip_layer.py
...e/trainer_config_helpers/tests/configs/test_clip_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_config_parser_for_non_file_config.py
...s/tests/configs/test_config_parser_for_non_file_config.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_conv3d_layer.py
...trainer_config_helpers/tests/configs/test_conv3d_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_cost_layers.py
.../trainer_config_helpers/tests/configs/test_cost_layers.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_cost_layers_with_weight.py
...fig_helpers/tests/configs/test_cost_layers_with_weight.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_crop.py
.../paddle/trainer_config_helpers/tests/configs/test_crop.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_cross_entropy_over_beam.py
...fig_helpers/tests/configs/test_cross_entropy_over_beam.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_deconv3d_layer.py
...ainer_config_helpers/tests/configs/test_deconv3d_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_detection_output_layer.py
...nfig_helpers/tests/configs/test_detection_output_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_dot_prod_layer.py
...ainer_config_helpers/tests/configs/test_dot_prod_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_expand_layer.py
...trainer_config_helpers/tests/configs/test_expand_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_factorization_machine.py
...onfig_helpers/tests/configs/test_factorization_machine.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_fc.py
...on/paddle/trainer_config_helpers/tests/configs/test_fc.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_gated_unit_layer.py
...ner_config_helpers/tests/configs/test_gated_unit_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_grumemory_layer.py
...iner_config_helpers/tests/configs/test_grumemory_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_hsigmoid.py
...dle/trainer_config_helpers/tests/configs/test_hsigmoid.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_kmax_seq_socre_layer.py
...config_helpers/tests/configs/test_kmax_seq_socre_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_l2_distance_layer.py
...er_config_helpers/tests/configs/test_l2_distance_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_lstmemory_layer.py
...iner_config_helpers/tests/configs/test_lstmemory_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_maxout.py
...addle/trainer_config_helpers/tests/configs/test_maxout.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_multibox_loss_layer.py
..._config_helpers/tests/configs/test_multibox_loss_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_multiplex_layer.py
...iner_config_helpers/tests/configs/test_multiplex_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_ntm_layers.py
...e/trainer_config_helpers/tests/configs/test_ntm_layers.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_pad.py
...n/paddle/trainer_config_helpers/tests/configs/test_pad.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_pooling3D_layer.py
...iner_config_helpers/tests/configs/test_pooling3D_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_prelu_layer.py
.../trainer_config_helpers/tests/configs/test_prelu_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_print_layer.py
.../trainer_config_helpers/tests/configs/test_print_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_recursive_topology.py
...r_config_helpers/tests/configs/test_recursive_topology.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_repeat_layer.py
...trainer_config_helpers/tests/configs/test_repeat_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_resize_layer.py
...trainer_config_helpers/tests/configs/test_resize_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_rnn_group.py
...le/trainer_config_helpers/tests/configs/test_rnn_group.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_roi_pool_layer.py
...ainer_config_helpers/tests/configs/test_roi_pool_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_row_conv.py
...dle/trainer_config_helpers/tests/configs/test_row_conv.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_row_l2_norm_layer.py
...er_config_helpers/tests/configs/test_row_l2_norm_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_scale_shift_layer.py
...er_config_helpers/tests/configs/test_scale_shift_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_scale_sub_region_layer.py
...nfig_helpers/tests/configs/test_scale_sub_region_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_seq_concat_reshape.py
...r_config_helpers/tests/configs/test_seq_concat_reshape.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_seq_slice_layer.py
...iner_config_helpers/tests/configs/test_seq_slice_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_sequence_pooling.py
...ner_config_helpers/tests/configs/test_sequence_pooling.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_smooth_l1.py
...le/trainer_config_helpers/tests/configs/test_smooth_l1.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_split_datasource.py
...ner_config_helpers/tests/configs/test_split_datasource.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_spp_layer.py
...le/trainer_config_helpers/tests/configs/test_spp_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/test_sub_nested_seq_select_layer.py
...helpers/tests/configs/test_sub_nested_seq_select_layer.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/unused_layers.py
...dle/trainer_config_helpers/tests/configs/unused_layers.py
+13
-0
python/paddle/trainer_config_helpers/tests/configs/util_layers.py
...addle/trainer_config_helpers/tests/configs/util_layers.py
+13
-0
python/paddle/utils/image_multiproc.py
python/paddle/utils/image_multiproc.py
+13
-0
python/paddle/utils/plotcurve.py
python/paddle/utils/plotcurve.py
+13
-0
python/paddle/v2/dataset/sentiment.py
python/paddle/v2/dataset/sentiment.py
+13
-0
python/paddle/v2/dataset/tests/imikolov_test.py
python/paddle/v2/dataset/tests/imikolov_test.py
+13
-0
python/paddle/v2/dataset/tests/test_sentiment.py
python/paddle/v2/dataset/tests/test_sentiment.py
+13
-0
python/paddle/v2/event.py
python/paddle/v2/event.py
+13
-0
python/paddle/v2/fluid/__init__.py
python/paddle/v2/fluid/__init__.py
+13
-0
python/paddle/v2/fluid/backward.py
python/paddle/v2/fluid/backward.py
+13
-0
python/paddle/v2/fluid/clip.py
python/paddle/v2/fluid/clip.py
+13
-0
python/paddle/v2/fluid/data_feeder.py
python/paddle/v2/fluid/data_feeder.py
+13
-0
python/paddle/v2/fluid/default_scope_funcs.py
python/paddle/v2/fluid/default_scope_funcs.py
+13
-0
python/paddle/v2/fluid/distribute_transpiler.py
python/paddle/v2/fluid/distribute_transpiler.py
+13
-0
python/paddle/v2/fluid/distribute_transpiler_simple.py
python/paddle/v2/fluid/distribute_transpiler_simple.py
+13
-0
python/paddle/v2/fluid/distributed_spliter.py
python/paddle/v2/fluid/distributed_spliter.py
+13
-0
python/paddle/v2/fluid/evaluator.py
python/paddle/v2/fluid/evaluator.py
+13
-0
python/paddle/v2/fluid/executor.py
python/paddle/v2/fluid/executor.py
+13
-0
python/paddle/v2/fluid/framework.py
python/paddle/v2/fluid/framework.py
+13
-0
python/paddle/v2/fluid/initializer.py
python/paddle/v2/fluid/initializer.py
+13
-0
python/paddle/v2/fluid/io.py
python/paddle/v2/fluid/io.py
+13
-0
python/paddle/v2/fluid/layer_helper.py
python/paddle/v2/fluid/layer_helper.py
+13
-0
python/paddle/v2/fluid/layers/__init__.py
python/paddle/v2/fluid/layers/__init__.py
+13
-0
python/paddle/v2/fluid/layers/control_flow.py
python/paddle/v2/fluid/layers/control_flow.py
+33
-0
python/paddle/v2/fluid/layers/device.py
python/paddle/v2/fluid/layers/device.py
+13
-0
python/paddle/v2/fluid/layers/io.py
python/paddle/v2/fluid/layers/io.py
+13
-0
python/paddle/v2/fluid/layers/nn.py
python/paddle/v2/fluid/layers/nn.py
+72
-0
python/paddle/v2/fluid/layers/ops.py
python/paddle/v2/fluid/layers/ops.py
+13
-0
python/paddle/v2/fluid/layers/tensor.py
python/paddle/v2/fluid/layers/tensor.py
+13
-0
python/paddle/v2/fluid/memory_optimization_transpiler.py
python/paddle/v2/fluid/memory_optimization_transpiler.py
+13
-0
python/paddle/v2/fluid/net_drawer.py
python/paddle/v2/fluid/net_drawer.py
+13
-0
python/paddle/v2/fluid/nets.py
python/paddle/v2/fluid/nets.py
+49
-0
python/paddle/v2/fluid/op.py
python/paddle/v2/fluid/op.py
+13
-0
python/paddle/v2/fluid/optimizer.py
python/paddle/v2/fluid/optimizer.py
+13
-0
python/paddle/v2/fluid/param_attr.py
python/paddle/v2/fluid/param_attr.py
+13
-0
python/paddle/v2/fluid/profiler.py
python/paddle/v2/fluid/profiler.py
+13
-0
python/paddle/v2/fluid/registry.py
python/paddle/v2/fluid/registry.py
+13
-0
python/paddle/v2/fluid/regularizer.py
python/paddle/v2/fluid/regularizer.py
+13
-0
python/paddle/v2/fluid/tests/__init__.py
python/paddle/v2/fluid/tests/__init__.py
+13
-0
python/paddle/v2/fluid/tests/book/test_fit_a_line.py
python/paddle/v2/fluid/tests/book/test_fit_a_line.py
+13
-0
python/paddle/v2/fluid/tests/book/test_image_classification_train.py
...le/v2/fluid/tests/book/test_image_classification_train.py
+13
-0
python/paddle/v2/fluid/tests/book/test_label_semantic_roles.py
...n/paddle/v2/fluid/tests/book/test_label_semantic_roles.py
+13
-0
python/paddle/v2/fluid/tests/book/test_machine_translation.py
...on/paddle/v2/fluid/tests/book/test_machine_translation.py
+13
-0
python/paddle/v2/fluid/tests/book/test_recognize_digits_conv.py
.../paddle/v2/fluid/tests/book/test_recognize_digits_conv.py
+13
-0
python/paddle/v2/fluid/tests/book/test_recognize_digits_mlp.py
...n/paddle/v2/fluid/tests/book/test_recognize_digits_mlp.py
+13
-0
python/paddle/v2/fluid/tests/book/test_recommender_system.py
python/paddle/v2/fluid/tests/book/test_recommender_system.py
+13
-0
python/paddle/v2/fluid/tests/book/test_understand_sentiment_conv.py
...dle/v2/fluid/tests/book/test_understand_sentiment_conv.py
+13
-0
python/paddle/v2/fluid/tests/book/test_understand_sentiment_dynamic_lstm.py
...luid/tests/book/test_understand_sentiment_dynamic_lstm.py
+13
-0
python/paddle/v2/fluid/tests/book/test_understand_sentiment_lstm.py
...dle/v2/fluid/tests/book/test_understand_sentiment_lstm.py
+13
-0
python/paddle/v2/fluid/tests/book/test_word2vec.py
python/paddle/v2/fluid/tests/book/test_word2vec.py
+13
-0
python/paddle/v2/fluid/tests/book_distribute/notest_dist_fit_a_line.py
.../v2/fluid/tests/book_distribute/notest_dist_fit_a_line.py
+13
-0
python/paddle/v2/fluid/tests/book_distribute/notest_dist_label_semantic_roles.py
...tests/book_distribute/notest_dist_label_semantic_roles.py
+13
-0
python/paddle/v2/fluid/tests/book_distribute/notest_dist_word2vec.py
...le/v2/fluid/tests/book_distribute/notest_dist_word2vec.py
+13
-0
python/paddle/v2/fluid/tests/book_distribute/notest_recognize_digits_conv_dist.py
...ests/book_distribute/notest_recognize_digits_conv_dist.py
+13
-0
python/paddle/v2/fluid/tests/book_distribute/notest_understand_sentiment_conv_dist.py
.../book_distribute/notest_understand_sentiment_conv_dist.py
+13
-0
python/paddle/v2/fluid/tests/book_distribute/test_split_var.py
...n/paddle/v2/fluid/tests/book_distribute/test_split_var.py
+13
-0
python/paddle/v2/fluid/tests/decorators.py
python/paddle/v2/fluid/tests/decorators.py
+13
-0
python/paddle/v2/fluid/tests/demo/fc_gan.py
python/paddle/v2/fluid/tests/demo/fc_gan.py
+13
-0
python/paddle/v2/fluid/tests/op_test.py
python/paddle/v2/fluid/tests/op_test.py
+13
-0
python/paddle/v2/fluid/tests/test_accuracy_op.py
python/paddle/v2/fluid/tests/test_accuracy_op.py
+13
-0
python/paddle/v2/fluid/tests/test_activation_op.py
python/paddle/v2/fluid/tests/test_activation_op.py
+13
-0
python/paddle/v2/fluid/tests/test_adadelta_op.py
python/paddle/v2/fluid/tests/test_adadelta_op.py
+13
-0
python/paddle/v2/fluid/tests/test_adagrad_op.py
python/paddle/v2/fluid/tests/test_adagrad_op.py
+13
-0
python/paddle/v2/fluid/tests/test_adam_op.py
python/paddle/v2/fluid/tests/test_adam_op.py
+13
-0
python/paddle/v2/fluid/tests/test_adamax_op.py
python/paddle/v2/fluid/tests/test_adamax_op.py
+13
-0
python/paddle/v2/fluid/tests/test_array_read_write_op.py
python/paddle/v2/fluid/tests/test_array_read_write_op.py
+13
-0
python/paddle/v2/fluid/tests/test_assign_op.py
python/paddle/v2/fluid/tests/test_assign_op.py
+13
-0
python/paddle/v2/fluid/tests/test_assign_value_op.py
python/paddle/v2/fluid/tests/test_assign_value_op.py
+13
-0
python/paddle/v2/fluid/tests/test_auc_op.py
python/paddle/v2/fluid/tests/test_auc_op.py
+13
-0
python/paddle/v2/fluid/tests/test_batch_norm_op.py
python/paddle/v2/fluid/tests/test_batch_norm_op.py
+13
-0
python/paddle/v2/fluid/tests/test_beam_search_decode_op.py
python/paddle/v2/fluid/tests/test_beam_search_decode_op.py
+13
-0
python/paddle/v2/fluid/tests/test_beam_search_op.py
python/paddle/v2/fluid/tests/test_beam_search_op.py
+13
-0
python/paddle/v2/fluid/tests/test_bilinear_tensor_product_op.py
.../paddle/v2/fluid/tests/test_bilinear_tensor_product_op.py
+13
-0
python/paddle/v2/fluid/tests/test_calc_gradient.py
python/paddle/v2/fluid/tests/test_calc_gradient.py
+13
-0
python/paddle/v2/fluid/tests/test_cast_op.py
python/paddle/v2/fluid/tests/test_cast_op.py
+13
-0
python/paddle/v2/fluid/tests/test_chunk_eval_op.py
python/paddle/v2/fluid/tests/test_chunk_eval_op.py
+13
-0
python/paddle/v2/fluid/tests/test_clip.py
python/paddle/v2/fluid/tests/test_clip.py
+13
-0
python/paddle/v2/fluid/tests/test_clip_by_norm_op.py
python/paddle/v2/fluid/tests/test_clip_by_norm_op.py
+13
-0
python/paddle/v2/fluid/tests/test_clip_op.py
python/paddle/v2/fluid/tests/test_clip_op.py
+13
-0
python/paddle/v2/fluid/tests/test_compare_op.py
python/paddle/v2/fluid/tests/test_compare_op.py
+13
-0
python/paddle/v2/fluid/tests/test_concat_op.py
python/paddle/v2/fluid/tests/test_concat_op.py
+13
-0
python/paddle/v2/fluid/tests/test_cond_op.py
python/paddle/v2/fluid/tests/test_cond_op.py
+13
-0
python/paddle/v2/fluid/tests/test_conditional_block.py
python/paddle/v2/fluid/tests/test_conditional_block.py
+13
-0
python/paddle/v2/fluid/tests/test_const_value.py
python/paddle/v2/fluid/tests/test_const_value.py
+13
-0
python/paddle/v2/fluid/tests/test_conv2d_op.py
python/paddle/v2/fluid/tests/test_conv2d_op.py
+13
-0
python/paddle/v2/fluid/tests/test_conv2d_transpose_op.py
python/paddle/v2/fluid/tests/test_conv2d_transpose_op.py
+13
-0
python/paddle/v2/fluid/tests/test_conv3d_op.py
python/paddle/v2/fluid/tests/test_conv3d_op.py
+13
-0
python/paddle/v2/fluid/tests/test_conv3d_transpose_op.py
python/paddle/v2/fluid/tests/test_conv3d_transpose_op.py
+13
-0
python/paddle/v2/fluid/tests/test_conv_shift_op.py
python/paddle/v2/fluid/tests/test_conv_shift_op.py
+13
-0
python/paddle/v2/fluid/tests/test_cos_sim_op.py
python/paddle/v2/fluid/tests/test_cos_sim_op.py
+13
-0
python/paddle/v2/fluid/tests/test_create_op_doc_string.py
python/paddle/v2/fluid/tests/test_create_op_doc_string.py
+13
-0
python/paddle/v2/fluid/tests/test_crf_decoding_op.py
python/paddle/v2/fluid/tests/test_crf_decoding_op.py
+13
-0
python/paddle/v2/fluid/tests/test_crop_op.py
python/paddle/v2/fluid/tests/test_crop_op.py
+13
-0
python/paddle/v2/fluid/tests/test_cross_entropy_op.py
python/paddle/v2/fluid/tests/test_cross_entropy_op.py
+13
-0
python/paddle/v2/fluid/tests/test_data_feeder.py
python/paddle/v2/fluid/tests/test_data_feeder.py
+13
-0
python/paddle/v2/fluid/tests/test_decayed_adagrad_op.py
python/paddle/v2/fluid/tests/test_decayed_adagrad_op.py
+13
-0
python/paddle/v2/fluid/tests/test_default_scope_funcs.py
python/paddle/v2/fluid/tests/test_default_scope_funcs.py
+13
-0
python/paddle/v2/fluid/tests/test_detection_output_op.py
python/paddle/v2/fluid/tests/test_detection_output_op.py
+13
-0
python/paddle/v2/fluid/tests/test_dropout_op.py
python/paddle/v2/fluid/tests/test_dropout_op.py
+13
-0
python/paddle/v2/fluid/tests/test_dyn_rnn.py
python/paddle/v2/fluid/tests/test_dyn_rnn.py
+13
-0
python/paddle/v2/fluid/tests/test_dynrnn_gradient_check.py
python/paddle/v2/fluid/tests/test_dynrnn_gradient_check.py
+13
-0
python/paddle/v2/fluid/tests/test_dynrnn_static_input.py
python/paddle/v2/fluid/tests/test_dynrnn_static_input.py
+192
-0
python/paddle/v2/fluid/tests/test_elementwise_add_op.py
python/paddle/v2/fluid/tests/test_elementwise_add_op.py
+13
-0
python/paddle/v2/fluid/tests/test_elementwise_div_op.py
python/paddle/v2/fluid/tests/test_elementwise_div_op.py
+13
-0
python/paddle/v2/fluid/tests/test_elementwise_mul_op.py
python/paddle/v2/fluid/tests/test_elementwise_mul_op.py
+13
-0
python/paddle/v2/fluid/tests/test_elementwise_sub_op.py
python/paddle/v2/fluid/tests/test_elementwise_sub_op.py
+13
-0
python/paddle/v2/fluid/tests/test_exception.py
python/paddle/v2/fluid/tests/test_exception.py
+13
-0
python/paddle/v2/fluid/tests/test_executor_and_mul.py
python/paddle/v2/fluid/tests/test_executor_and_mul.py
+13
-0
python/paddle/v2/fluid/tests/test_expand_op.py
python/paddle/v2/fluid/tests/test_expand_op.py
+13
-0
python/paddle/v2/fluid/tests/test_feed_fetch_method.py
python/paddle/v2/fluid/tests/test_feed_fetch_method.py
+13
-0
python/paddle/v2/fluid/tests/test_fill_constant_batch_size_like_op.py
...e/v2/fluid/tests/test_fill_constant_batch_size_like_op.py
+13
-0
python/paddle/v2/fluid/tests/test_fill_constant_op.py
python/paddle/v2/fluid/tests/test_fill_constant_op.py
+13
-0
python/paddle/v2/fluid/tests/test_fill_op.py
python/paddle/v2/fluid/tests/test_fill_op.py
+13
-0
python/paddle/v2/fluid/tests/test_fill_zeros_like_op.py
python/paddle/v2/fluid/tests/test_fill_zeros_like_op.py
+13
-0
python/paddle/v2/fluid/tests/test_framework_debug_str.py
python/paddle/v2/fluid/tests/test_framework_debug_str.py
+13
-0
python/paddle/v2/fluid/tests/test_ftrl_op.py
python/paddle/v2/fluid/tests/test_ftrl_op.py
+13
-0
python/paddle/v2/fluid/tests/test_gather_op.py
python/paddle/v2/fluid/tests/test_gather_op.py
+13
-0
python/paddle/v2/fluid/tests/test_gaussian_random_op.py
python/paddle/v2/fluid/tests/test_gaussian_random_op.py
+13
-0
python/paddle/v2/fluid/tests/test_get_places_op.py
python/paddle/v2/fluid/tests/test_get_places_op.py
+13
-0
python/paddle/v2/fluid/tests/test_gru_op.py
python/paddle/v2/fluid/tests/test_gru_op.py
+13
-0
python/paddle/v2/fluid/tests/test_gru_unit_op.py
python/paddle/v2/fluid/tests/test_gru_unit_op.py
+13
-0
python/paddle/v2/fluid/tests/test_hinge_loss_op.py
python/paddle/v2/fluid/tests/test_hinge_loss_op.py
+13
-0
python/paddle/v2/fluid/tests/test_huber_loss_op.py
python/paddle/v2/fluid/tests/test_huber_loss_op.py
+13
-0
python/paddle/v2/fluid/tests/test_image_classification_layer.py
.../paddle/v2/fluid/tests/test_image_classification_layer.py
+13
-0
python/paddle/v2/fluid/tests/test_infer_shape.py
python/paddle/v2/fluid/tests/test_infer_shape.py
+13
-0
python/paddle/v2/fluid/tests/test_inference_model_io.py
python/paddle/v2/fluid/tests/test_inference_model_io.py
+13
-0
python/paddle/v2/fluid/tests/test_initializer.py
python/paddle/v2/fluid/tests/test_initializer.py
+13
-0
python/paddle/v2/fluid/tests/test_is_empty_op.py
python/paddle/v2/fluid/tests/test_is_empty_op.py
+13
-0
python/paddle/v2/fluid/tests/test_l1_norm_op.py
python/paddle/v2/fluid/tests/test_l1_norm_op.py
+13
-0
python/paddle/v2/fluid/tests/test_layers.py
python/paddle/v2/fluid/tests/test_layers.py
+13
-0
python/paddle/v2/fluid/tests/test_linear_chain_crf_op.py
python/paddle/v2/fluid/tests/test_linear_chain_crf_op.py
+13
-0
python/paddle/v2/fluid/tests/test_lod_array_length_op.py
python/paddle/v2/fluid/tests/test_lod_array_length_op.py
+13
-0
python/paddle/v2/fluid/tests/test_lod_rank_table.py
python/paddle/v2/fluid/tests/test_lod_rank_table.py
+13
-0
python/paddle/v2/fluid/tests/test_lod_reset_op.py
python/paddle/v2/fluid/tests/test_lod_reset_op.py
+13
-0
python/paddle/v2/fluid/tests/test_lod_tensor_array.py
python/paddle/v2/fluid/tests/test_lod_tensor_array.py
+13
-0
python/paddle/v2/fluid/tests/test_lod_tensor_array_ops.py
python/paddle/v2/fluid/tests/test_lod_tensor_array_ops.py
+13
-0
python/paddle/v2/fluid/tests/test_log_loss_op.py
python/paddle/v2/fluid/tests/test_log_loss_op.py
+13
-0
python/paddle/v2/fluid/tests/test_logical_op.py
python/paddle/v2/fluid/tests/test_logical_op.py
+13
-0
python/paddle/v2/fluid/tests/test_lookup_table_op.py
python/paddle/v2/fluid/tests/test_lookup_table_op.py
+13
-0
python/paddle/v2/fluid/tests/test_lrn_op.py
python/paddle/v2/fluid/tests/test_lrn_op.py
+13
-0
python/paddle/v2/fluid/tests/test_lstm_op.py
python/paddle/v2/fluid/tests/test_lstm_op.py
+13
-0
python/paddle/v2/fluid/tests/test_lstm_unit_op.py
python/paddle/v2/fluid/tests/test_lstm_unit_op.py
+13
-0
python/paddle/v2/fluid/tests/test_margin_rank_loss_op.py
python/paddle/v2/fluid/tests/test_margin_rank_loss_op.py
+13
-0
python/paddle/v2/fluid/tests/test_matmul_op.py
python/paddle/v2/fluid/tests/test_matmul_op.py
+13
-0
python/paddle/v2/fluid/tests/test_maxout_op.py
python/paddle/v2/fluid/tests/test_maxout_op.py
+13
-0
python/paddle/v2/fluid/tests/test_mean_op.py
python/paddle/v2/fluid/tests/test_mean_op.py
+13
-0
python/paddle/v2/fluid/tests/test_memory_optimization_transpiler.py
...dle/v2/fluid/tests/test_memory_optimization_transpiler.py
+13
-0
python/paddle/v2/fluid/tests/test_minus_op.py
python/paddle/v2/fluid/tests/test_minus_op.py
+13
-0
python/paddle/v2/fluid/tests/test_mnist_if_else_op.py
python/paddle/v2/fluid/tests/test_mnist_if_else_op.py
+13
-0
python/paddle/v2/fluid/tests/test_modified_huber_loss_op.py
python/paddle/v2/fluid/tests/test_modified_huber_loss_op.py
+13
-0
python/paddle/v2/fluid/tests/test_momentum_op.py
python/paddle/v2/fluid/tests/test_momentum_op.py
+13
-0
python/paddle/v2/fluid/tests/test_mul_op.py
python/paddle/v2/fluid/tests/test_mul_op.py
+13
-0
python/paddle/v2/fluid/tests/test_multiplex_op.py
python/paddle/v2/fluid/tests/test_multiplex_op.py
+13
-0
python/paddle/v2/fluid/tests/test_nce.py
python/paddle/v2/fluid/tests/test_nce.py
+13
-0
python/paddle/v2/fluid/tests/test_net.py
python/paddle/v2/fluid/tests/test_net.py
+13
-0
python/paddle/v2/fluid/tests/test_norm_op.py
python/paddle/v2/fluid/tests/test_norm_op.py
+13
-0
python/paddle/v2/fluid/tests/test_op_support_gpu.py
python/paddle/v2/fluid/tests/test_op_support_gpu.py
+13
-0
python/paddle/v2/fluid/tests/test_operator.py
python/paddle/v2/fluid/tests/test_operator.py
+13
-0
python/paddle/v2/fluid/tests/test_operator_desc.py
python/paddle/v2/fluid/tests/test_operator_desc.py
+13
-0
python/paddle/v2/fluid/tests/test_optimizer.py
python/paddle/v2/fluid/tests/test_optimizer.py
+13
-0
python/paddle/v2/fluid/tests/test_pad_op.py
python/paddle/v2/fluid/tests/test_pad_op.py
+13
-0
python/paddle/v2/fluid/tests/test_parallel_op.py
python/paddle/v2/fluid/tests/test_parallel_op.py
+13
-0
python/paddle/v2/fluid/tests/test_parameter.py
python/paddle/v2/fluid/tests/test_parameter.py
+13
-0
python/paddle/v2/fluid/tests/test_pool2d_op.py
python/paddle/v2/fluid/tests/test_pool2d_op.py
+13
-0
python/paddle/v2/fluid/tests/test_pool3d_op.py
python/paddle/v2/fluid/tests/test_pool3d_op.py
+13
-0
python/paddle/v2/fluid/tests/test_pool_max_op.py
python/paddle/v2/fluid/tests/test_pool_max_op.py
+13
-0
python/paddle/v2/fluid/tests/test_positive_negative_pair_op.py
...n/paddle/v2/fluid/tests/test_positive_negative_pair_op.py
+13
-0
python/paddle/v2/fluid/tests/test_precision_recall_op.py
python/paddle/v2/fluid/tests/test_precision_recall_op.py
+13
-0
python/paddle/v2/fluid/tests/test_prelu_op.py
python/paddle/v2/fluid/tests/test_prelu_op.py
+13
-0
python/paddle/v2/fluid/tests/test_print_op.py
python/paddle/v2/fluid/tests/test_print_op.py
+13
-0
python/paddle/v2/fluid/tests/test_profiler.py
python/paddle/v2/fluid/tests/test_profiler.py
+13
-0
python/paddle/v2/fluid/tests/test_program.py
python/paddle/v2/fluid/tests/test_program.py
+13
-0
python/paddle/v2/fluid/tests/test_protobuf.py
python/paddle/v2/fluid/tests/test_protobuf.py
+13
-0
python/paddle/v2/fluid/tests/test_protobuf_descs.py
python/paddle/v2/fluid/tests/test_protobuf_descs.py
+13
-0
python/paddle/v2/fluid/tests/test_proximal_adagrad_op.py
python/paddle/v2/fluid/tests/test_proximal_adagrad_op.py
+13
-0
python/paddle/v2/fluid/tests/test_proximal_gd_op.py
python/paddle/v2/fluid/tests/test_proximal_gd_op.py
+13
-0
python/paddle/v2/fluid/tests/test_rank_loss_op.py
python/paddle/v2/fluid/tests/test_rank_loss_op.py
+13
-0
python/paddle/v2/fluid/tests/test_recurrent_op.py
python/paddle/v2/fluid/tests/test_recurrent_op.py
+13
-0
python/paddle/v2/fluid/tests/test_reduce_op.py
python/paddle/v2/fluid/tests/test_reduce_op.py
+13
-0
python/paddle/v2/fluid/tests/test_registry.py
python/paddle/v2/fluid/tests/test_registry.py
+13
-0
python/paddle/v2/fluid/tests/test_regularizer.py
python/paddle/v2/fluid/tests/test_regularizer.py
+13
-0
python/paddle/v2/fluid/tests/test_reorder_lod_tensor.py
python/paddle/v2/fluid/tests/test_reorder_lod_tensor.py
+21
-10
python/paddle/v2/fluid/tests/test_reshape_op.py
python/paddle/v2/fluid/tests/test_reshape_op.py
+13
-0
python/paddle/v2/fluid/tests/test_rmsprop_op.py
python/paddle/v2/fluid/tests/test_rmsprop_op.py
+13
-0
python/paddle/v2/fluid/tests/test_rnn_memory_helper_op.py
python/paddle/v2/fluid/tests/test_rnn_memory_helper_op.py
+13
-0
python/paddle/v2/fluid/tests/test_roi_pool_op.py
python/paddle/v2/fluid/tests/test_roi_pool_op.py
+13
-0
python/paddle/v2/fluid/tests/test_row_conv_op.py
python/paddle/v2/fluid/tests/test_row_conv_op.py
+13
-0
python/paddle/v2/fluid/tests/test_scale_op.py
python/paddle/v2/fluid/tests/test_scale_op.py
+13
-0
python/paddle/v2/fluid/tests/test_scatter_op.py
python/paddle/v2/fluid/tests/test_scatter_op.py
+13
-0
python/paddle/v2/fluid/tests/test_scope.py
python/paddle/v2/fluid/tests/test_scope.py
+13
-0
python/paddle/v2/fluid/tests/test_selected_rows.py
python/paddle/v2/fluid/tests/test_selected_rows.py
+13
-0
python/paddle/v2/fluid/tests/test_seq_concat_op.py
python/paddle/v2/fluid/tests/test_seq_concat_op.py
+13
-0
python/paddle/v2/fluid/tests/test_seq_conv.py
python/paddle/v2/fluid/tests/test_seq_conv.py
+13
-0
python/paddle/v2/fluid/tests/test_seq_pool.py
python/paddle/v2/fluid/tests/test_seq_pool.py
+13
-0
python/paddle/v2/fluid/tests/test_sequence_erase_op.py
python/paddle/v2/fluid/tests/test_sequence_erase_op.py
+13
-0
python/paddle/v2/fluid/tests/test_sequence_expand.py
python/paddle/v2/fluid/tests/test_sequence_expand.py
+13
-0
python/paddle/v2/fluid/tests/test_sequence_slice_op.py
python/paddle/v2/fluid/tests/test_sequence_slice_op.py
+13
-0
python/paddle/v2/fluid/tests/test_sequence_softmax_op.py
python/paddle/v2/fluid/tests/test_sequence_softmax_op.py
+13
-0
python/paddle/v2/fluid/tests/test_sgd_op.py
python/paddle/v2/fluid/tests/test_sgd_op.py
+13
-0
python/paddle/v2/fluid/tests/test_shrink_rnn_memory.py
python/paddle/v2/fluid/tests/test_shrink_rnn_memory.py
+13
-0
python/paddle/v2/fluid/tests/test_sigmoid_cross_entropy_with_logits_op.py
.../fluid/tests/test_sigmoid_cross_entropy_with_logits_op.py
+13
-0
python/paddle/v2/fluid/tests/test_sign_op.py
python/paddle/v2/fluid/tests/test_sign_op.py
+13
-0
python/paddle/v2/fluid/tests/test_smooth_l1_loss_op.py
python/paddle/v2/fluid/tests/test_smooth_l1_loss_op.py
+13
-0
python/paddle/v2/fluid/tests/test_softmax_op.py
python/paddle/v2/fluid/tests/test_softmax_op.py
+13
-0
python/paddle/v2/fluid/tests/test_softmax_with_cross_entropy_op.py
...ddle/v2/fluid/tests/test_softmax_with_cross_entropy_op.py
+13
-0
python/paddle/v2/fluid/tests/test_split_and_merge_lod_tensor_op.py
...ddle/v2/fluid/tests/test_split_and_merge_lod_tensor_op.py
+13
-0
python/paddle/v2/fluid/tests/test_split_op.py
python/paddle/v2/fluid/tests/test_split_op.py
+13
-0
python/paddle/v2/fluid/tests/test_spp_op.py
python/paddle/v2/fluid/tests/test_spp_op.py
+13
-0
python/paddle/v2/fluid/tests/test_squared_l2_distance_op.py
python/paddle/v2/fluid/tests/test_squared_l2_distance_op.py
+13
-0
python/paddle/v2/fluid/tests/test_squared_l2_norm_op.py
python/paddle/v2/fluid/tests/test_squared_l2_norm_op.py
+13
-0
python/paddle/v2/fluid/tests/test_sum_op.py
python/paddle/v2/fluid/tests/test_sum_op.py
+13
-0
python/paddle/v2/fluid/tests/test_tensor.py
python/paddle/v2/fluid/tests/test_tensor.py
+13
-0
python/paddle/v2/fluid/tests/test_top_k_op.py
python/paddle/v2/fluid/tests/test_top_k_op.py
+13
-0
python/paddle/v2/fluid/tests/test_transpose_op.py
python/paddle/v2/fluid/tests/test_transpose_op.py
+13
-0
python/paddle/v2/fluid/tests/test_uniform_random_op.py
python/paddle/v2/fluid/tests/test_uniform_random_op.py
+13
-0
python/paddle/v2/fluid/tests/test_unpool_op.py
python/paddle/v2/fluid/tests/test_unpool_op.py
+13
-0
python/paddle/v2/fluid/tests/test_variable.py
python/paddle/v2/fluid/tests/test_variable.py
+13
-0
python/paddle/v2/fluid/tests/test_warpctc_op.py
python/paddle/v2/fluid/tests/test_warpctc_op.py
+54
-23
python/paddle/v2/fluid/tests/test_while_op.py
python/paddle/v2/fluid/tests/test_while_op.py
+13
-0
python/paddle/v2/image.py
python/paddle/v2/image.py
+13
-0
python/paddle/v2/inference.py
python/paddle/v2/inference.py
+13
-0
python/paddle/v2/master/__init__.py
python/paddle/v2/master/__init__.py
+13
-0
python/paddle/v2/master/client.py
python/paddle/v2/master/client.py
+13
-0
python/paddle/v2/reader/tests/__init__.py
python/paddle/v2/reader/tests/__init__.py
+13
-0
python/paddle/v2/tests/test_parameters.py
python/paddle/v2/tests/test_parameters.py
+13
-0
python/paddle/v2/trainer.py
python/paddle/v2/trainer.py
+13
-0
tools/manylinux1/build_scripts/manylinux1-check.py
tools/manylinux1/build_scripts/manylinux1-check.py
+13
-0
tools/manylinux1/build_scripts/ssl-check.py
tools/manylinux1/build_scripts/ssl-check.py
+13
-0
v1_api_demo/mnist/api_train.py
v1_api_demo/mnist/api_train.py
+13
-0
v1_api_demo/mnist/mnist_provider.py
v1_api_demo/mnist/mnist_provider.py
+13
-0
v1_api_demo/quick_start/data/proc_from_raw_data/preprocess.py
...pi_demo/quick_start/data/proc_from_raw_data/preprocess.py
+13
-0
v1_api_demo/quick_start/trainer_config.bidi-lstm.py
v1_api_demo/quick_start/trainer_config.bidi-lstm.py
+13
-0
v1_api_demo/quick_start/trainer_config.cnn.py
v1_api_demo/quick_start/trainer_config.cnn.py
+13
-0
v1_api_demo/quick_start/trainer_config.emb.py
v1_api_demo/quick_start/trainer_config.emb.py
+13
-0
v1_api_demo/quick_start/trainer_config.lr.py
v1_api_demo/quick_start/trainer_config.lr.py
+13
-0
v1_api_demo/quick_start/trainer_config.lstm.py
v1_api_demo/quick_start/trainer_config.lstm.py
+13
-0
v1_api_demo/quick_start/trainer_config.resnet-lstm.py
v1_api_demo/quick_start/trainer_config.resnet-lstm.py
+13
-0
未找到文件。
.copyright.hook
0 → 100644
浏览文件 @
27e31f64
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import io, re
import sys, os
import subprocess
import platform
COPYRIGHT = '''
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
'''
LANG_COMMENT_MARK = None
NEW_LINE_MARK = None
COPYRIGHT_HEADER = None
if platform.system() == "Windows":
NEW_LINE_MARK = "\r\n"
else:
NEW_LINE_MARK = '\n'
COPYRIGHT_HEADER = COPYRIGHT.split(NEW_LINE_MARK)[1]
p = re.search('(\d{4})', COPYRIGHT_HEADER).group(0)
process = subprocess.Popen(["date", "+%Y"], stdout=subprocess.PIPE)
date, err = process.communicate()
date = date.decode("utf-8").rstrip("\n")
COPYRIGHT_HEADER = COPYRIGHT_HEADER.replace(p, date)
def generate_copyright(template, lang='C'):
if lang == 'Python':
LANG_COMMENT_MARK = '#'
else:
LANG_COMMENT_MARK = "//"
lines = template.split(NEW_LINE_MARK)
ans = LANG_COMMENT_MARK + COPYRIGHT_HEADER + NEW_LINE_MARK
for lino, line in enumerate(lines):
if lino == 0 or lino == 1 or lino == len(lines) - 1: continue
ans += LANG_COMMENT_MARK + line + NEW_LINE_MARK
return ans
def lang_type(filename):
if filename.endswith(".py"):
return "Python"
elif filename.endswith(".h"):
return "C"
elif filename.endswith(".hpp"):
return "C"
elif filename.endswith(".cc"):
return "C"
elif filename.endswith(".cpp"):
return "C"
elif filename.endswith(".cu"):
return "C"
elif filename.endswith(".cuh"):
return "C"
elif filename.endswith(".go"):
return "C"
elif filename.endswith(".proto"):
return "C"
else:
print("Unsupported filetype")
exit(0)
def main(argv=None):
parser = argparse.ArgumentParser(
description='Checker for copyright declaration.')
parser.add_argument('filenames', nargs='*', help='Filenames to check')
args = parser.parse_args(argv)
retv = 0
for filename in args.filenames:
first_line = io.open(filename).readline()
if "Copyright" in first_line: continue
original_contents = io.open(filename).read()
new_contents = generate_copyright(
COPYRIGHT, lang_type(filename)) + original_contents
print('Auto Insert Copyright Header {}'.format(filename))
retv = 1
with io.open(filename, 'w') as output_file:
output_file.write(new_contents)
return retv
if __name__ == '__main__':
exit(main())
.pre-commit-config.yaml
浏览文件 @
27e31f64
...
...
@@ -31,3 +31,11 @@
-
id
:
go-fmt
types
:
-
go
-
repo
:
local
hooks
:
-
id
:
copyright_checker
name
:
copyright_checker
entry
:
python ./.copyright.hook
language
:
system
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$
exclude
:
(?!.*third_party)^.*$ | (?!.*book)^.*$
adversarial/advbox/attacks/base.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
The base model of the model.
"""
...
...
adversarial/advbox/attacks/gradientsign.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
This module provide the attack method for FGSM's implement.
"""
...
...
adversarial/advbox/models/base.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
The base model of the model.
"""
...
...
adversarial/advbox/models/paddle.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
absolute_import
import
numpy
as
np
...
...
adversarial/fluid_mnist.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
CNN on mnist data using fluid api of paddlepaddle
"""
...
...
adversarial/mnist_tutorial_fgsm.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
FGSM demos on mnist using advbox tool.
"""
...
...
benchmark/paddle/image/alexnet.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
from
paddle.trainer_config_helpers
import
*
...
...
benchmark/paddle/image/googlenet.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
from
paddle.trainer_config_helpers
import
*
...
...
benchmark/paddle/image/provider.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
io
,
os
import
random
import
numpy
as
np
...
...
benchmark/paddle/image/resnet.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
from
paddle.trainer_config_helpers
import
*
...
...
benchmark/paddle/image/smallnet_mnist_cifar.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
from
paddle.trainer_config_helpers
import
*
...
...
benchmark/paddle/image/vgg.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
from
paddle.trainer_config_helpers
import
*
...
...
benchmark/paddle/rnn/provider.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
io
,
os
import
random
import
numpy
as
np
...
...
benchmark/paddle/rnn/rnn.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
from
paddle.trainer_config_helpers
import
*
...
...
benchmark/tensorflow/image/alexnet.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
six.moves
import
xrange
# pylint: disable=redefined-builtin
from
datetime
import
datetime
import
math
...
...
benchmark/tensorflow/image/alexnet_multi_gpu.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
six.moves
import
xrange
# pylint: disable=redefined-builtin
from
datetime
import
datetime
import
math
...
...
benchmark/tensorflow/image/googlenet.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
six.moves
import
xrange
from
datetime
import
datetime
import
math
...
...
benchmark/tensorflow/image/smallnet_mnist_cifar.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
six.moves
import
xrange
# pylint: disable=redefined-builtin
from
datetime
import
datetime
import
math
...
...
benchmark/tensorflow/rnn/reader.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
os.path
import
io
import
numpy
as
np
...
...
benchmark/tensorflow/rnn/rnn.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
from
six.moves
import
xrange
# pylint: disable=redefined-builtin
import
math
...
...
benchmark/tensorflow/rnn/rnn_multi_gpu.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
from
six.moves
import
xrange
# pylint: disable=redefined-builtin
import
re
...
...
cmake/external/grpc.cmake
浏览文件 @
27e31f64
...
...
@@ -33,7 +33,7 @@ ExternalProject_Add(
extern_grpc
DEPENDS protobuf zlib
GIT_REPOSITORY
"https://github.com/grpc/grpc.git"
GIT_TAG
"v1.
7
.x"
GIT_TAG
"v1.
8
.x"
PREFIX
${
GRPC_SOURCES_DIR
}
UPDATE_COMMAND
""
CONFIGURE_COMMAND
""
...
...
cmake/make_resource.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
os
import
re
import
sys
...
...
doc/api/v1/data_provider/src/mnist_config.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
define_py_data_sources2
(
...
...
doc/api/v1/data_provider/src/mnist_provider.dict.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer.PyDataProvider2
import
*
...
...
doc/api/v1/data_provider/src/sentimental_config.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
dictionary
=
dict
()
...
...
doc/api/v1/data_provider/src/sentimental_provider.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer.PyDataProvider2
import
*
...
...
doc/api/v2/fluid/layers.rst
浏览文件 @
27e31f64
...
...
@@ -358,6 +358,12 @@ reduce_min
.. autofunction:: paddle.v2.fluid.layers.reduce_min
:noindex:
split
-----
.. autofunction:: paddle.v2.fluid.layers.split
:noindex:
logsigmoid
----------
.. autofunction:: paddle.v2.fluid.layers.logsigmoid
...
...
doc/api/v2/fluid/nets.rst
浏览文件 @
27e31f64
...
...
@@ -20,3 +20,8 @@ sequence_conv_pool
:noindex:
glu
---
.. autofunction:: paddle.v2.fluid.nets.glu
:noindex:
doc/faq/local/src/reduce_min_pool_size.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
@
provider
(
min_pool_size
=
0
,
...)
def
process
(
settings
,
filename
):
os
.
system
(
'shuf %s > %s.shuf'
%
(
filename
,
filename
))
# shuffle before.
...
...
doc/faq/local/src/word2vec_config.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
...
# the settings and define data provider is omitted.
DICT_DIM
=
3000
# dictionary dimension.
word_ids
=
data_layer
(
'word_ids'
,
size
=
DICT_DIM
)
...
...
doc/faq/local/src/word2vec_dataprovider.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
DICT_DIM
=
3000
...
...
doc/getstarted/concepts/src/train.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2
as
paddle
import
numpy
as
np
...
...
doc/howto/usage/cluster/src/k8s_train/start_paddle.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/python
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
...
...
doc/howto/usage/cluster/src/word2vec/api_train_v2.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
gzip
import
math
...
...
doc/howto/usage/cluster/src/word2vec/api_train_v2_cluster.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
math
import
os
import
paddle.v2
as
paddle
...
...
go/pserver/client/c/test/test_mnist.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2
as
paddle
import
gzip
...
...
go/pserver/client/c/test/test_train.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2
as
paddle
import
paddle.v2.dataset.uci_housing
as
uci_housing
import
paddle.v2.master
as
master
...
...
paddle/api/test/testTrainConfig.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
100
,
learning_method
=
AdamOptimizer
())
...
...
paddle/capi/examples/model_inference/common/common.h
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef __CAPI_EXAMPLE_COMMON_H__
#define __CAPI_EXAMPLE_COMMON_H__
#include <stdio.h>
...
...
paddle/capi/examples/model_inference/dense/merge_v2_model.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.utils.merge_model
import
merge_v2_model
from
mnist_v2
import
network
...
...
paddle/capi/examples/model_inference/dense/mnist_v2.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
os
import
sys
import
gzip
...
...
paddle/capi/examples/model_inference/dense/trainer_config.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
img
=
data_layer
(
name
=
'pixel'
,
size
=
784
)
...
...
paddle/capi/examples/model_inference/sequence/trainer_config.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
WORD_DIM
=
3000
...
...
paddle/capi/tests/test_predict_network.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
100
)
...
...
paddle/cuda/src/avx_mathfun.h
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
AVX implementation of sin, cos, sincos, exp and log
...
...
paddle/framework/backward_test.cc
浏览文件 @
27e31f64
/
* Copyright (c) 2016
PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
/
/ Copyright (c) 2018
PaddlePaddle Authors. All Rights Reserve.
//
//
Licensed under the Apache License, Version 2.0 (the "License");
//
you may not use this file except in compliance with the License.
//
You may obtain a copy of the License at
//
//
http://www.apache.org/licenses/LICENSE-2.0
//
//
Unless required by applicable law or agreed to in writing, software
//
distributed under the License is distributed on an "AS IS" BASIS,
//
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/framework/backward.h"
...
...
paddle/framework/dim.h
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <iostream>
...
...
paddle/framework/dim_test.cu
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <thrust/device_vector.h>
#include <sstream>
...
...
paddle/framework/eigen_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
...
...
paddle/framework/lod_tensor_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
...
...
paddle/framework/lod_tensor_test.cu
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
...
...
paddle/framework/tensor_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
...
...
paddle/framework/tensor_util.h
浏览文件 @
27e31f64
...
...
@@ -315,9 +315,8 @@ inline void DeserializeFromStream(std::istream& is, Tensor* tensor,
desc
.
data_type
(),
DeserializedDataFunctor
(
&
buf
,
&
cpu_tensor
,
ctx
.
GetPlace
()));
is
.
read
(
static_cast
<
char
*>
(
buf
),
cpu_tensor
.
memory_size
());
auto
cpu_place
=
new
platform
::
CPUPlace
();
framework
::
Copy
(
cpu_tensor
,
*
cpu_place
,
dev_ctx
,
tensor
);
delete
cpu_place
;
auto
dst_place
=
dev_ctx
.
GetPlace
();
framework
::
Copy
(
cpu_tensor
,
dst_place
,
dev_ctx
,
tensor
);
#else
PADDLE_THROW
(
"Unexpected branch"
);
#endif
...
...
paddle/framework/tensor_util_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
...
...
paddle/framework/variable.h
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
...
...
paddle/gserver/tests/img_conv_cudnn.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
...
...
paddle/gserver/tests/img_conv_exconv.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
...
...
paddle/gserver/tests/sequence_recurrent.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
...
...
paddle/gserver/tests/sequence_rnn_matched_inputs.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
...
...
paddle/gserver/tests/sequence_rnn_mixed_inputs.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
...
...
paddle/gserver/tests/sequence_rnn_multi_unequalength_inputs.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
...
...
paddle/operators/CMakeLists.txt
浏览文件 @
27e31f64
...
...
@@ -149,7 +149,7 @@ op_library(sequence_pool_op DEPS sequence_pooling)
op_library
(
lstm_op DEPS sequence2batch lstm_compute
)
op_library
(
gru_op DEPS sequence2batch gru_compute
)
op_library
(
recurrent_op DEPS executor
)
op_library
(
warpctc_op DEPS dynload_warpctc sequence_padding math_function
)
op_library
(
warpctc_op DEPS dynload_warpctc sequence_padding
sequence_scale
math_function
)
op_library
(
cos_sim_op DEPS cos_sim_functor
)
op_library
(
parallel_do_op DEPS executor
)
...
...
paddle/operators/detail/grpc_client.cc
浏览文件 @
27e31f64
...
...
@@ -87,7 +87,7 @@ bool RPCClient::AsyncGetVariable(const std::string& ep,
return
true
;
}
bool
RPCClient
::
w
ait
()
{
bool
RPCClient
::
W
ait
()
{
bool
ok
=
true
;
while
(
true
)
{
...
...
@@ -96,7 +96,6 @@ bool RPCClient::wait() {
}
if
(
!
Proceed
())
{
LOG
(
ERROR
)
<<
"Get meets CompletionQueue error"
;
return
false
;
}
}
...
...
@@ -110,9 +109,9 @@ bool RPCClient::Proceed() {
// request counts.
if
(
!
cq_
.
Next
(
&
tag
,
&
ok
))
{
LOG
(
ERROR
)
<<
"Get meets CompletionQueue error"
;
return
false
;
}
req_count_
--
;
GPR_ASSERT
(
ok
);
PADDLE_ENFORCE
(
tag
);
...
...
@@ -120,12 +119,15 @@ bool RPCClient::Proceed() {
// TODO(gongwb): add more retries.
ClientBase
*
c
=
static_cast
<
ClientBase
*>
(
tag
);
if
(
!
c
->
status_
.
ok
())
{
LOG
(
ERROR
)
<<
"proc param error:"
<<
c
->
var_h_
.
String
()
<<
" grpc error:"
<<
c
->
status_
.
error_message
();
delete
c
;
return
tru
e
;
return
fals
e
;
}
c
->
Process
();
delete
c
;
req_count_
--
;
return
true
;
}
...
...
@@ -135,8 +137,12 @@ std::shared_ptr<grpc::Channel> RPCClient::GetChannel(const std::string& ep) {
return
it
->
second
;
}
grpc
::
ChannelArguments
args
;
args
.
SetMaxSendMessageSize
(
std
::
numeric_limits
<
int
>::
max
());
args
.
SetMaxReceiveMessageSize
(
std
::
numeric_limits
<
int
>::
max
());
auto
ch
=
std
::
shared_ptr
<
grpc
::
Channel
>
(
grpc
::
CreateC
hannel
(
ep
,
grpc
::
InsecureChannelCredentials
()
));
grpc
::
CreateC
ustomChannel
(
ep
,
grpc
::
InsecureChannelCredentials
(),
args
));
channels_
[
ep
]
=
ch
;
return
ch
;
...
...
paddle/operators/detail/grpc_client.h
浏览文件 @
27e31f64
...
...
@@ -130,7 +130,7 @@ class RPCClient {
const
framework
::
Scope
&
scope
,
const
std
::
string
&
var_name
,
int64_t
time_out
=
600
*
1000
);
bool
w
ait
();
bool
W
ait
();
private:
bool
Proceed
();
...
...
paddle/operators/detail/grpc_server.cc
浏览文件 @
27e31f64
...
...
@@ -28,12 +28,15 @@ class RequestBase {
public:
explicit
RequestBase
(
sendrecv
::
SendRecvService
::
AsyncService
*
service
,
grpc
::
ServerCompletionQueue
*
cq
)
:
service_
(
service
),
cq_
(
cq
),
status_
(
PROCESS
)
{}
:
service_
(
service
),
cq_
(
cq
),
status_
(
PROCESS
)
{
PADDLE_ENFORCE
(
cq_
);
}
virtual
~
RequestBase
()
{}
virtual
void
Process
()
{
assert
(
false
);
}
CallStatus
Status
()
{
return
status_
;
}
void
SetStatus
(
CallStatus
status
)
{
status_
=
status
;
}
virtual
std
::
string
GetReqName
()
{
assert
(
false
);
}
protected:
grpc
::
ServerContext
ctx_
;
...
...
@@ -56,12 +59,14 @@ class RequestSend final : public RequestBase {
virtual
~
RequestSend
()
{}
virtual
std
::
string
GetReqName
()
{
return
request_
.
varname
();
}
virtual
void
Process
()
{
MessageWithName
msg_with_name
=
std
::
make_pair
(
request_
.
varname
(),
std
::
move
(
request_
));
queue_
->
Push
(
std
::
move
(
msg_with_name
));
// TODO(gongwb): check var's info.
responder_
.
Finish
(
reply_
,
grpc
::
Status
::
OK
,
this
);
status_
=
FINISH
;
}
protected:
...
...
@@ -74,20 +79,27 @@ class RequestSend final : public RequestBase {
class
RequestGet
final
:
public
RequestBase
{
public:
explicit
RequestGet
(
sendrecv
::
SendRecvService
::
AsyncService
*
service
,
grpc
::
ServerCompletionQueue
*
cq
,
framework
::
Scope
*
scope
)
:
RequestBase
(
service
,
cq
),
responder_
(
&
ctx_
),
scope_
(
scope
)
{
grpc
::
ServerCompletionQueue
*
cq
,
framework
::
Scope
*
scope
,
const
platform
::
DeviceContext
*
dev_ctx
)
:
RequestBase
(
service
,
cq
),
responder_
(
&
ctx_
),
scope_
(
scope
),
dev_ctx_
(
dev_ctx
)
{
service_
->
RequestGetVariable
(
&
ctx_
,
&
request_
,
&
responder_
,
cq_
,
cq_
,
this
);
}
virtual
~
RequestGet
()
{}
virtual
std
::
string
GetReqName
()
{
return
request_
.
varname
();
}
virtual
void
Process
()
{
// proc request.
std
::
string
var_name
=
request_
.
varname
();
auto
*
var
=
scope_
->
FindVar
(
var_name
);
SerializeToMessage
(
var_name
,
var
,
platform
::
CPUDeviceContext
()
,
&
reply_
);
SerializeToMessage
(
var_name
,
var
,
*
dev_ctx_
,
&
reply_
);
// TODO(gongwb): check var's info.
responder_
.
Finish
(
reply_
,
grpc
::
Status
::
OK
,
this
);
status_
=
FINISH
;
}
protected:
...
...
@@ -95,11 +107,14 @@ class RequestGet final : public RequestBase {
sendrecv
::
VariableMessage
reply_
;
ServerAsyncResponseWriter
<
sendrecv
::
VariableMessage
>
responder_
;
framework
::
Scope
*
scope_
;
const
platform
::
DeviceContext
*
dev_ctx_
;
};
void
AsyncGRPCServer
::
RunSyncUpdate
()
{
grpc
::
ServerBuilder
builder
;
builder
.
AddListeningPort
(
address_
,
grpc
::
InsecureServerCredentials
());
builder
.
SetMaxSendMessageSize
(
std
::
numeric_limits
<
int
>::
max
());
builder
.
SetMaxReceiveMessageSize
(
std
::
numeric_limits
<
int
>::
max
());
builder
.
RegisterService
(
&
service_
);
cq_send_
=
builder
.
AddCompletionQueue
();
...
...
@@ -155,22 +170,10 @@ void AsyncGRPCServer::TryToRegisterNewGetOne() {
if
(
is_shut_down_
)
{
return
;
}
RequestGet
*
get
=
new
RequestGet
(
&
service_
,
cq_get_
.
get
(),
scope_
);
RequestGet
*
get
=
new
RequestGet
(
&
service_
,
cq_get_
.
get
(),
scope_
,
dev_ctx_
);
VLOG
(
4
)
<<
"create Requestget status:"
<<
get
->
Status
();
}
void
AsyncGRPCServer
::
SetFinishOrDelete
(
RequestBase
*&
last
)
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
cq_mutex_
);
if
(
is_shut_down_
)
{
delete
last
;
last
=
NULL
;
return
;
}
last
->
SetStatus
(
FINISH
);
return
;
}
void
AsyncGRPCServer
::
HandleRequest
(
bool
wait
,
grpc
::
ServerCompletionQueue
*
cq
,
std
::
string
cq_name
,
std
::
function
<
void
()
>
TryToRegisterNewOne
)
{
...
...
@@ -184,13 +187,19 @@ void AsyncGRPCServer::HandleRequest(bool wait, grpc::ServerCompletionQueue* cq,
break
;
}
PADDLE_ENFORCE
(
tag
);
if
(
wait
&&
!
done_
)
{
Wait
();
}
RequestBase
*
base
=
(
RequestBase
*
)
tag
;
// reference:
// https://github.com/tensorflow/tensorflow/issues/5596
// https://groups.google.com/forum/#!topic/grpc-io/xftlRy-IQwM
// https://groups.google.com/forum/#!topic/grpc-io/ywATt88Ef_I
if
(
!
ok
)
{
VLOG
(
4
)
<<
cq_name
<<
" recv no regular event"
;
LOG
(
WARNING
)
<<
cq_name
<<
" recv no regular event:argument name"
<<
base
->
GetReqName
();
TryToRegisterNewOne
();
delete
base
;
continue
;
...
...
@@ -201,7 +210,6 @@ void AsyncGRPCServer::HandleRequest(bool wait, grpc::ServerCompletionQueue* cq,
VLOG
(
4
)
<<
cq_name
<<
" status:"
<<
base
->
Status
();
TryToRegisterNewOne
();
base
->
Process
();
SetFinishOrDelete
(
base
);
break
;
}
case
FINISH
:
{
...
...
paddle/operators/detail/grpc_server.h
浏览文件 @
27e31f64
...
...
@@ -37,7 +37,7 @@ class RequestBase;
class
AsyncGRPCServer
final
:
public
sendrecv
::
SendRecvService
::
Service
{
public:
explicit
AsyncGRPCServer
(
std
::
string
address
)
{
address_
=
address
;
}
explicit
AsyncGRPCServer
(
const
std
::
string
&
address
)
:
address_
(
address
)
{
}
void
RunSyncUpdate
();
...
...
@@ -47,6 +47,8 @@ class AsyncGRPCServer final : public sendrecv::SendRecvService::Service {
void
SetScope
(
framework
::
Scope
*
scope
)
{
scope_
=
scope
;
}
void
SetDevCtx
(
const
platform
::
DeviceContext
*
dev_ctx
)
{
dev_ctx_
=
dev_ctx
;
}
const
MessageWithName
Get
()
{
return
this
->
var_recv_queue_
.
Pop
();
}
void
Push
(
const
MessageWithName
&
msg
)
{
this
->
var_recv_queue_
.
Push
(
msg
);
}
...
...
@@ -60,7 +62,6 @@ class AsyncGRPCServer final : public sendrecv::SendRecvService::Service {
std
::
function
<
void
()
>
TryToRegisterNewOne
);
void
TryToRegisterNewSendOne
();
void
TryToRegisterNewGetOne
();
void
SetFinishOrDelete
(
RequestBase
*&
last
);
void
ShutdownQueue
();
private:
...
...
@@ -74,6 +75,7 @@ class AsyncGRPCServer final : public sendrecv::SendRecvService::Service {
std
::
string
address_
;
framework
::
Scope
*
scope_
;
const
platform
::
DeviceContext
*
dev_ctx_
;
// received variable from RPC, operators fetch variable from this queue.
SimpleBlockQueue
<
MessageWithName
>
var_recv_queue_
;
...
...
paddle/operators/elementwise_add_op.h
浏览文件 @
27e31f64
...
...
@@ -81,23 +81,6 @@ struct ElementwiseAddGradFunctor {
}
};
template
<
typename
T
>
struct
ElementwiseAddOneGradFunctor
{
template
<
typename
Device
,
typename
X
,
typename
Y
,
typename
Z
,
typename
dX
,
typename
dY
,
typename
dZ
>
void
operator
()(
Device
d
,
X
x
,
Y
y
,
Z
z
,
dX
dx
,
dY
dy
,
dZ
dz
)
{
auto
dz_e
=
framework
::
EigenVector
<
T
>::
Flatten
(
*
dz
);
if
(
dx
)
{
auto
dx_e
=
framework
::
EigenVector
<
T
>::
Flatten
(
*
dx
);
dx_e
.
device
(
d
)
=
dz_e
;
}
if
(
dy
)
{
auto
dy_e
=
framework
::
EigenVector
<
T
>::
Flatten
(
*
dy
);
dy_e
.
device
(
d
)
=
dz_e
.
sum
();
}
}
};
template
<
typename
T
>
struct
ElementwiseAddBroadCastGradFunctor
{
template
<
typename
Device
,
typename
X
,
typename
Y
,
typename
Z
,
typename
dX
,
...
...
@@ -142,7 +125,6 @@ class ElementwiseAddGradKernel : public framework::OpKernel<T> {
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
ElementwiseGradCompute
<
DeviceContext
,
T
,
ElementwiseAddGradFunctor
<
T
>
,
ElementwiseAddOneGradFunctor
<
T
>
,
ElementwiseAddBroadCastGradFunctor
<
T
>
,
ElementwiseAddBroadCast2GradFunctor
<
T
>>
(
ctx
);
}
...
...
paddle/operators/elementwise_div_op.h
浏览文件 @
27e31f64
...
...
@@ -107,7 +107,6 @@ class ElementwiseDivGradKernel : public framework::OpKernel<T> {
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
ElementwiseGradCompute
<
DeviceContext
,
T
,
ElementwiseDivGradFunctor
<
T
>
,
ElementwiseDivGradFunctor
<
T
>
,
ElementwiseDivBroadCastGradFunctor
<
T
>
,
ElementwiseDivBroadCast2GradFunctor
<
T
>>
(
ctx
);
}
...
...
paddle/operators/elementwise_mul_op.h
浏览文件 @
27e31f64
...
...
@@ -106,7 +106,6 @@ class ElementwiseMulGradKernel : public framework::OpKernel<T> {
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
ElementwiseGradCompute
<
DeviceContext
,
T
,
ElementwiseMulGradFunctor
<
T
>
,
ElementwiseMulGradFunctor
<
T
>
,
ElementwiseMulBroadCastGradFunctor
<
T
>
,
ElementwiseMulBroadCast2GradFunctor
<
T
>>
(
ctx
);
}
...
...
paddle/operators/elementwise_op_function.h
浏览文件 @
27e31f64
...
...
@@ -311,8 +311,7 @@ EIGEN_FUNCTOR(Mul, EIGEN_MUL);
EIGEN_FUNCTOR
(
Div
,
EIGEN_DIV
);
template
<
typename
DeviceContext
,
typename
T
,
typename
functor
,
typename
functor1
,
typename
broadcastfunctor
,
typename
broadcast2functor
>
typename
broadcastfunctor
,
typename
broadcast2functor
>
void
ElementwiseGradCompute
(
const
framework
::
ExecutionContext
&
ctx
)
{
using
Tensor
=
framework
::
Tensor
;
...
...
paddle/operators/elementwise_sub_op.h
浏览文件 @
27e31f64
...
...
@@ -43,23 +43,6 @@ struct ElementwiseSubGradFunctor {
}
};
template
<
typename
T
>
struct
ElementwiseSubOneGradFunctor
{
template
<
typename
Device
,
typename
X
,
typename
Y
,
typename
Z
,
typename
dX
,
typename
dY
,
typename
dZ
>
void
operator
()(
Device
d
,
X
x
,
Y
y
,
Z
z
,
dX
dx
,
dY
dy
,
dZ
dz
)
{
auto
dz_e
=
framework
::
EigenVector
<
T
>::
Flatten
(
*
dz
);
if
(
dx
)
{
auto
dx_e
=
framework
::
EigenVector
<
T
>::
Flatten
(
*
dx
);
dx_e
.
device
(
d
)
=
dz_e
;
}
if
(
dy
)
{
auto
dy_e
=
framework
::
EigenVector
<
T
>::
Flatten
(
*
dy
);
dy_e
.
device
(
d
)
=
(
-
1.0
)
*
dz_e
.
sum
();
}
}
};
template
<
typename
T
>
struct
ElementwiseSubBroadCastGradFunctor
{
template
<
typename
Device
,
typename
X
,
typename
Y
,
typename
Z
,
typename
dX
,
...
...
@@ -106,7 +89,6 @@ class ElementwiseSubGradKernel : public framework::OpKernel<T> {
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
ElementwiseGradCompute
<
DeviceContext
,
T
,
ElementwiseSubGradFunctor
<
T
>
,
ElementwiseSubOneGradFunctor
<
T
>
,
ElementwiseSubBroadCastGradFunctor
<
T
>
,
ElementwiseSubBroadCast2GradFunctor
<
T
>>
(
ctx
);
}
...
...
paddle/operators/math/CMakeLists.txt
浏览文件 @
27e31f64
...
...
@@ -13,6 +13,7 @@ if(WITH_GPU)
nv_library
(
context_project SRCS context_project.cc context_project.cu DEPS device_context math_function
)
nv_library
(
sequence2batch SRCS sequence2batch.cc sequence2batch.cu DEPS device_context tensor
)
nv_library
(
sequence_padding SRCS sequence_padding.cc sequence_padding.cu DEPS lod_tensor device_context
)
nv_library
(
sequence_scale SRCS sequence_scale.cc sequence_scale.cu DEPS lod_tensor device_context
)
nv_library
(
lstm_compute SRCS lstm_compute.cc lstm_compute.cu DEPS device_context activation_functions
)
nv_library
(
maxouting SRCS maxouting.cc maxouting.cu DEPS device_context
)
nv_library
(
unpooling SRCS unpooling.cc unpooling.cu DEPS device_context
)
...
...
@@ -29,6 +30,7 @@ else()
cc_library
(
context_project SRCS context_project.cc DEPS device_context math_function
)
cc_library
(
sequence2batch SRCS sequence2batch.cc DEPS device_context tensor
)
cc_library
(
sequence_padding SRCS sequence_padding.cc DEPS lod_tensor device_context
)
cc_library
(
sequence_scale SRCS sequence_scale.cc DEPS lod_tensor device_context
)
cc_library
(
lstm_compute SRCS lstm_compute.cc DEPS device_context activation_functions
)
cc_library
(
maxouting SRCS maxouting.cc DEPS device_context
)
cc_library
(
unpooling SRCS unpooling.cc DEPS device_context
)
...
...
paddle/operators/math/math_function_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/operators/math/math_function.h"
#include "gtest/gtest.h"
...
...
paddle/operators/math/math_function_test.cu
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "gtest/gtest.h"
#include "paddle/operators/math/math_function.h"
...
...
paddle/operators/math/sequence_scale.cc
0 → 100644
浏览文件 @
27e31f64
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/operators/math/sequence_scale.h"
namespace
paddle
{
namespace
operators
{
namespace
math
{
template
<
typename
T
>
class
ScaleLoDTensorFunctor
<
platform
::
CPUDeviceContext
,
T
>
{
public:
void
operator
()(
const
platform
::
CPUDeviceContext
&
context
,
framework
::
LoDTensor
&
seq
,
const
T
*
scales
)
{
const
size_t
level
=
0
;
auto
lod
=
seq
.
lod
();
const
size_t
num_seq
=
lod
[
level
].
size
()
-
1
;
size_t
seq_width
=
seq
.
dims
()[
1
];
framework
::
LoD
abs_offset_lod
=
framework
::
ToAbsOffset
(
lod
);
T
*
seq_data
=
seq
.
mutable_data
<
T
>
(
context
.
GetPlace
());
for
(
size_t
i
=
0
;
i
<
num_seq
;
++
i
)
{
for
(
size_t
j
=
lod
[
level
][
i
]
*
seq_width
;
j
<
lod
[
level
][
i
+
1
]
*
seq_width
;
++
j
)
{
seq_data
[
j
]
*=
scales
[
i
];
}
}
}
};
template
class
ScaleLoDTensorFunctor
<
platform
::
CPUDeviceContext
,
float
>;
}
// namespace math
}
// namespace operators
}
// namespace paddle
paddle/operators/math/sequence_scale.cu
0 → 100644
浏览文件 @
27e31f64
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/operators/math/sequence_scale.h"
#include "paddle/platform/cuda_helper.h"
namespace
paddle
{
namespace
operators
{
namespace
math
{
using
platform
::
PADDLE_CUDA_NUM_THREADS
;
template
<
typename
T
,
int
BlockSize
>
__global__
void
SequenceScaleKernel
(
T
*
seq
,
size_t
*
lod
,
const
T
*
scales
,
const
size_t
seq_width
)
{
for
(
int
i
=
threadIdx
.
x
;
i
<
(
lod
[
blockIdx
.
x
+
1
]
-
lod
[
blockIdx
.
x
])
*
seq_width
;
i
+=
BlockSize
)
{
int
idx
=
lod
[
blockIdx
.
x
]
*
seq_width
+
i
;
seq
[
idx
]
*=
scales
[
blockIdx
.
x
];
}
}
template
<
typename
T
>
class
ScaleLoDTensorFunctor
<
platform
::
CUDADeviceContext
,
T
>
{
public:
void
operator
()(
const
platform
::
CUDADeviceContext
&
context
,
framework
::
LoDTensor
&
seq
,
const
T
*
scales
)
{
const
size_t
level
=
0
;
auto
lod
=
seq
.
lod
();
const
size_t
num_seq
=
lod
[
level
].
size
()
-
1
;
const
size_t
seq_width
=
seq
.
numel
()
/
seq
.
dims
()[
0
];
framework
::
LoD
abs_offset_lod
=
framework
::
ToAbsOffset
(
lod
);
T
*
seq_data
=
seq
.
mutable_data
<
T
>
(
context
.
GetPlace
());
SequenceScaleKernel
<
T
,
PADDLE_CUDA_NUM_THREADS
><<<
num_seq
,
PADDLE_CUDA_NUM_THREADS
,
0
,
context
.
stream
()
>>>
(
seq_data
,
abs_offset_lod
[
level
].
data
(),
scales
,
seq_width
);
}
};
template
class
ScaleLoDTensorFunctor
<
platform
::
CUDADeviceContext
,
float
>;
}
// namespace math
}
// namespace operators
}
// namespace paddle
paddle/operators/math/sequence_scale.h
0 → 100644
浏览文件 @
27e31f64
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include "paddle/framework/lod_tensor.h"
#include "paddle/platform/device_context.h"
namespace
paddle
{
namespace
operators
{
namespace
math
{
/*
* \brief Scale a sequence.
*
* All sequences will be padded to the same length and stored in a transposed
* shape.
* Example:
* Given:
* seq = (s0, s0, s0, s0; s1, s1; s2, s2, s2; s3)
* scales = (2, 3, 4, 5)
* then:
* result = (2*s0, 2*s0, 2*s0, 2*s0; 3*s1, 3*s1; 4*s2, 4*s2, 4*s2; 5*s3)
*
* \param context Device context of this functor.
* \param seq LoDTensor which is stored in sequence format, the shape
* is [total_sequence_length, sequence_width] where
* total_sequence_length is the sum of all sequences'
* length.
* \param scales Array<T>. The i-th sequence will be scaled by scales[i].
* \param num_seq Number of sequence
*
*/
template
<
typename
DeviceContext
,
typename
T
>
class
ScaleLoDTensorFunctor
{
public:
void
operator
()(
const
DeviceContext
&
context
,
framework
::
LoDTensor
&
seq
,
const
T
*
scales
);
};
}
// namespace math
}
// namespace operators
}
// namespace paddle
paddle/operators/net_op.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
...
...
paddle/operators/net_op_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/operators/net_op.h"
#include <gtest/gtest.h>
...
...
paddle/operators/recv_op.cc
浏览文件 @
27e31f64
...
...
@@ -87,7 +87,12 @@ class RecvOp : public framework::OperatorBase {
const
platform
::
Place
&
dev_place
)
const
override
{
// FIXME(typhoonzero): no new scopes for every run.
framework
::
Scope
&
recv_scope
=
scope
.
NewScope
();
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
auto
&
dev_ctx
=
*
pool
.
Get
(
dev_place
);
// FIXME(Yancey1989): initialize rpc server with laze mode.
rpc_service_
->
SetScope
(
&
recv_scope
);
rpc_service_
->
SetDevCtx
(
&
dev_ctx
);
auto
param_list
=
Attr
<
std
::
vector
<
std
::
string
>>
(
"ParamList"
);
auto
grad_list
=
Attr
<
std
::
vector
<
std
::
string
>>
(
"GradList"
);
auto
trainer_count
=
Attr
<
int
>
(
"Trainers"
);
...
...
@@ -96,6 +101,8 @@ class RecvOp : public framework::OperatorBase {
rpc_service_
->
Reset
();
// TODO(typhoonzero): change this to a while_op for every cluster-batch.
bool
exit_flag
=
false
;
VLOG
(
4
)
<<
"param_count:"
<<
param_count
<<
" trainer_count:"
<<
trainer_count
;
while
(
!
exit_flag
)
{
// TODO(gognwb): simply this loop.
// Get from multiple trainers, we don't care about order in which
...
...
@@ -134,9 +141,6 @@ class RecvOp : public framework::OperatorBase {
}
auto
*
var
=
recv_scope
.
Var
(
grad_var_name
);
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
auto
&
dev_ctx
=
*
pool
.
Get
(
dev_place
);
detail
::
DeserializeFromMessage
(
v
.
second
,
dev_ctx
,
var
);
}
...
...
paddle/operators/send_op.cc
浏览文件 @
27e31f64
...
...
@@ -33,13 +33,13 @@ class SendOp : public framework::OperatorBase {
:
OperatorBase
(
type
,
inputs
,
outputs
,
attrs
)
{}
void
Run
(
const
framework
::
Scope
&
scope
,
const
platform
::
Place
&
dev_
place
)
const
override
{
const
platform
::
Place
&
place
)
const
override
{
auto
ins
=
Inputs
(
"X"
);
auto
outs
=
Outputs
(
"Out"
);
std
::
vector
<
std
::
string
>
epmap
=
Attr
<
std
::
vector
<
std
::
string
>>
(
"epmap"
);
// FIXME(gongwb): DeviceContext?
auto
ctx
=
platform
::
CPUDeviceContext
(
);
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
auto
&
ctx
=
*
pool
.
Get
(
place
);
for
(
size_t
i
=
0
;
i
<
ins
.
size
();
i
++
)
{
client_
.
AsyncSendVariable
(
epmap
[
i
],
ctx
,
scope
,
ins
[
i
]);
}
...
...
@@ -48,7 +48,7 @@ class SendOp : public framework::OperatorBase {
client_
.
AsyncGetVariable
(
epmap
[
i
],
ctx
,
scope
,
outs
[
i
]);
}
client_
.
wait
(
);
PADDLE_ENFORCE
(
client_
.
Wait
()
);
}
private:
...
...
paddle/operators/split_op.cc
浏览文件 @
27e31f64
...
...
@@ -60,6 +60,12 @@ class SplitOp : public framework::OperatorWithKernel {
}
}
ctx
->
SetOutputsDim
(
"Out"
,
outs_dims
);
if
(
axis
!=
0
)
{
// Only pass LoD when not spliting along the first dim.
for
(
size_t
i
=
0
;
i
<
outs_number
;
++
i
)
{
ctx
->
ShareLoD
(
"X"
,
"Out"
,
0
,
i
);
}
}
}
};
...
...
paddle/operators/warpctc_op.h
浏览文件 @
27e31f64
...
...
@@ -17,6 +17,7 @@ limitations under the License. */
#include "paddle/framework/op_registry.h"
#include "paddle/operators/math/math_function.h"
#include "paddle/operators/math/sequence_padding.h"
#include "paddle/operators/math/sequence_scale.h"
#include "paddle/platform/dynload/warpctc.h"
namespace
paddle
{
...
...
@@ -178,11 +179,14 @@ class WarpCTCKernel : public framework::OpKernel<T> {
T
*
warpctc_grad_data
=
warpctc_grad
->
mutable_data
<
T
>
(
warpctc_logits
.
dims
(),
ctx
.
GetPlace
());
math
::
SetConstant
<
DeviceContext
,
T
>
()(
ctx
.
template
device_context
<
DeviceContext
>(),
warpctc_grad
,
static_cast
<
T
>
(
0
));
// warpctc accesses labels in CPU memory
Tensor
warpctc_label
;
Copy
(
*
label
,
platform
::
CPUPlace
(),
ctx
.
device_context
(),
&
warpctc_label
);
const
int
*
warpctc_label_data
=
warpctc_label
.
data
<
int
>
();
// warpctc stores loss in CPU memory
Tensor
warpctc_loss
;
T
*
warpctc_loss_data
=
...
...
@@ -206,11 +210,18 @@ class WarpCTCGradKernel : public framework::OpKernel<T> {
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
auto
*
warpctc_grad
=
ctx
.
Input
<
Tensor
>
(
"WarpCTCGrad"
);
auto
*
logits_grad
=
ctx
.
Output
<
LoDTensor
>
(
framework
::
GradVarName
(
"Logits"
));
const
Tensor
*
loss_grad
=
ctx
.
Input
<
Tensor
>
(
framework
::
GradVarName
(
"Loss"
));
logits_grad
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
bool
norm_by_times
=
ctx
.
Attr
<
bool
>
(
"norm_by_times"
);
math
::
UnpaddingLoDTensorFunctor
<
DeviceContext
,
T
>
()(
ctx
.
template
device_context
<
DeviceContext
>(),
*
logits_grad
,
*
warpctc_grad
,
norm_by_times
);
const
T
*
loss_grad_data
=
loss_grad
->
data
<
T
>
();
math
::
ScaleLoDTensorFunctor
<
DeviceContext
,
T
>
()(
ctx
.
template
device_context
<
DeviceContext
>(),
*
logits_grad
,
loss_grad_data
);
}
};
...
...
paddle/optimizer/lr_policy.h
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <algorithm>
...
...
paddle/optimizer/parameter_optimizer_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
...
...
paddle/optimizer/serialization_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
...
...
paddle/optimizer/tensor.h
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
/**
* @brief tensor used by optimizer
...
...
paddle/platform/cpu_info_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/platform/cpu_info.h"
#include "paddle/string/printf.h"
...
...
paddle/platform/hostdevice.h
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#ifdef __CUDACC__
...
...
paddle/platform/place_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/platform/place.h"
#include <sstream>
#include "gtest/gtest.h"
...
...
paddle/pybind/print_operators_doc.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <iostream>
#include <sstream> // std::stringstream
#include <string>
...
...
paddle/scripts/cluster_train/paddle.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/python
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
...
...
paddle/scripts/cpplint.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
#
# Copyright (c) 2009 Google Inc. All rights reserved.
...
...
paddle/string/piece.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
...
...
paddle/string/piece.h
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
...
...
paddle/string/piece_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
...
...
paddle/string/printf.h
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
...
...
paddle/string/printf_test.cc
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/string/printf.h"
#include <string>
...
...
paddle/string/tinyformat/tinyformat.h
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// tinyformat.h
// Copyright (C) 2011, Chris Foster [chris42f (at) gmail (d0t) com]
//
...
...
paddle/trainer/tests/simple_sparse_neural_network.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
17
,
learning_method
=
AdaGradOptimizer
(),
learning_rate
=
1e-4
)
...
...
paddle/trainer/tests/simple_sparse_neural_network_dp.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer.PyDataProvider2
import
provider
,
integer_sequence
,
integer_value
import
random
...
...
paddle/utils/enable_virtualenv.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
os
...
...
proto/OptimizerConfig.proto
浏览文件 @
27e31f64
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax
=
"proto2"
;
option
optimize_for
=
LITE_RUNTIME
;
...
...
python/paddle/trainer_config_helpers/tests/configs/img_layers.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-3
,
batch_size
=
1000
)
...
...
python/paddle/trainer_config_helpers/tests/configs/img_trans_layers.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-3
,
batch_size
=
1000
)
...
...
python/paddle/trainer_config_helpers/tests/configs/last_first_seq.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/layer_activations.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
'''
Test all activations.
'''
...
...
python/paddle/trainer_config_helpers/tests/configs/math_ops.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/projections.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
'''
Test mixed layer, projections and operators.
'''
...
...
python/paddle/trainer_config_helpers/tests/configs/shared_fc.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-4
,
batch_size
=
1000
)
...
...
python/paddle/trainer_config_helpers/tests/configs/shared_gru.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-4
,
batch_size
=
1000
)
...
...
python/paddle/trainer_config_helpers/tests/configs/shared_lstm.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-4
,
batch_size
=
1000
)
...
...
python/paddle/trainer_config_helpers/tests/configs/simple_rnn_layers.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-4
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_BatchNorm3D.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-4
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_bi_grumemory.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-4
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_bilinear_interp.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_clip_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
data
=
data_layer
(
name
=
'input'
,
size
=
300
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_config_parser_for_non_file_config.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
#
...
...
python/paddle/trainer_config_helpers/tests/configs/test_conv3d_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_cost_layers.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-4
,
batch_size
=
1000
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_cost_layers_with_weight.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-4
,
batch_size
=
1000
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_crop.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_cross_entropy_over_beam.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
#coding=utf-8
...
...
python/paddle/trainer_config_helpers/tests/configs/test_deconv3d_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_detection_output_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_dot_prod_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
vec1
=
data_layer
(
name
=
'vector1'
,
size
=
10
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_expand_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_factorization_machine.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
data
=
data_layer
(
name
=
'data'
,
size
=
1024
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_fc.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_gated_unit_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
data
=
data_layer
(
name
=
'input'
,
size
=
256
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_grumemory_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-4
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_hsigmoid.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-4
,
batch_size
=
1000
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_kmax_seq_socre_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
#coding=utf-8
from
paddle.trainer_config_helpers
import
*
...
...
python/paddle/trainer_config_helpers/tests/configs/test_l2_distance_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
outputs
(
...
...
python/paddle/trainer_config_helpers/tests/configs/test_lstmemory_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_maxout.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_multibox_loss_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_multiplex_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_ntm_layers.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_pad.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_pooling3D_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
100
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_prelu_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
data
=
data_layer
(
name
=
'input'
,
size
=
300
,
height
=
10
,
width
=
10
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_print_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-4
,
batch_size
=
1000
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_recursive_topology.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_repeat_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_resize_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
data
=
data_layer
(
name
=
'input'
,
size
=
300
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_rnn_group.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-4
,
batch_size
=
1000
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_roi_pool_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
data
=
data_layer
(
name
=
'data'
,
size
=
3
*
14
*
14
,
height
=
14
,
width
=
14
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_row_conv.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_row_l2_norm_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
data
=
data_layer
(
name
=
'input'
,
size
=
300
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_scale_shift_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
data
=
data_layer
(
name
=
'data'
,
size
=
100
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_scale_sub_region_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_seq_concat_reshape.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_seq_slice_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
#coding=utf-8
from
paddle.trainer_config_helpers
import
*
...
...
python/paddle/trainer_config_helpers/tests/configs/test_sequence_pooling.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-4
,
batch_size
=
1000
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_smooth_l1.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
data
=
data_layer
(
name
=
'input'
,
size
=
300
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_split_datasource.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
define_py_data_sources2
(
...
...
python/paddle/trainer_config_helpers/tests/configs/test_spp_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
100
,
learning_rate
=
1e-5
)
...
...
python/paddle/trainer_config_helpers/tests/configs/test_sub_nested_seq_select_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/env python
#coding=utf-8
from
paddle.trainer_config_helpers
import
*
...
...
python/paddle/trainer_config_helpers/tests/configs/unused_layers.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-4
)
...
...
python/paddle/trainer_config_helpers/tests/configs/util_layers.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer_config_helpers
import
*
settings
(
learning_rate
=
1e-4
,
batch_size
=
1000
)
...
...
python/paddle/utils/image_multiproc.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
os
,
sys
import
numpy
as
np
from
PIL
import
Image
...
...
python/paddle/utils/plotcurve.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#!/usr/bin/python
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
...
...
python/paddle/v2/dataset/sentiment.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# /usr/bin/env python
# -*- coding:utf-8 -*-
...
...
python/paddle/v2/dataset/tests/imikolov_test.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.dataset.imikolov
import
unittest
...
...
python/paddle/v2/dataset/tests/test_sentiment.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# /usr/bin/env python
# -*- coding:utf-8 -*-
...
...
python/paddle/v2/event.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
Testing and training events.
...
...
python/paddle/v2/fluid/__init__.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
# import all class inside framework into fluid module
import
framework
...
...
python/paddle/v2/fluid/backward.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.v2.fluid
import
framework
as
framework
from
.
import
core
import
collections
...
...
python/paddle/v2/fluid/clip.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
functools
import
layers
from
.
import
core
...
...
python/paddle/v2/fluid/data_feeder.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
core
import
numpy
...
...
python/paddle/v2/fluid/default_scope_funcs.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
Default scope function.
...
...
python/paddle/v2/fluid/distribute_transpiler.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
framework
from
framework
import
Program
,
default_main_program
,
Parameter
,
Variable
...
...
python/paddle/v2/fluid/distribute_transpiler_simple.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
framework
from
framework
import
Program
,
default_main_program
,
Parameter
,
Variable
import
optimizer
...
...
python/paddle/v2/fluid/distributed_spliter.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
def
hash_name
(
varlist
,
pserver_endpoints
):
"""
hash variable names to several endpoints.
...
...
python/paddle/v2/fluid/evaluator.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
layers
...
...
python/paddle/v2/fluid/executor.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
contextlib
from
framework
import
Program
,
default_main_program
...
...
python/paddle/v2/fluid/framework.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
collections
import
contextlib
...
...
python/paddle/v2/fluid/initializer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
framework
import
numpy
as
np
...
...
python/paddle/v2/fluid/io.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
os
import
cPickle
as
pickle
...
...
python/paddle/v2/fluid/layer_helper.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
copy
import
itertools
...
...
python/paddle/v2/fluid/layers/__init__.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
ops
from
ops
import
*
import
nn
...
...
python/paddle/v2/fluid/layers/control_flow.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
..layer_helper
import
LayerHelper
,
unique_name
from
..framework
import
Program
,
Variable
,
Operator
from
..
import
core
...
...
@@ -1278,6 +1291,26 @@ class DynamicRNN(object):
outputs
=
{
'Out'
:
input_array
})
return
array_read
(
array
=
input_array
,
i
=
self
.
step_idx
)
def
static_input
(
self
,
x
):
self
.
_assert_in_rnn_block_
(
"static_input"
)
if
not
isinstance
(
x
,
Variable
):
raise
TypeError
(
"static_input() can only take a Variable as its input"
)
if
self
.
lod_rank_table
is
None
:
raise
RuntimeError
(
"static_input() must be called after step_input()."
)
parent_block
=
self
.
_parent_block_
()
x_reordered
=
parent_block
.
create_var
(
name
=
unique_name
(
"dynamic_rnn_static_input_reordered"
),
type
=
core
.
VarDesc
.
VarType
.
LOD_TENSOR
,
dtype
=
x
.
dtype
)
parent_block
.
append_op
(
type
=
'reorder_lod_tensor_by_rank'
,
inputs
=
{
'X'
:
[
x
],
'RankTable'
:
[
self
.
lod_rank_table
]},
outputs
=
{
'Out'
:
[
x_reordered
]})
return
shrink_memory
(
x_reordered
,
self
.
step_idx
,
self
.
lod_rank_table
)
@
contextlib
.
contextmanager
def
block
(
self
):
if
self
.
status
!=
DynamicRNN
.
BEFORE_RNN
:
...
...
python/paddle/v2/fluid/layers/device.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
All util layers.
"""
...
...
python/paddle/v2/fluid/layers/io.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
..
import
core
from
..layer_helper
import
LayerHelper
...
...
python/paddle/v2/fluid/layers/nn.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
All layers just related to the neural network.
"""
...
...
@@ -36,6 +49,7 @@ __all__ = [
'sequence_first_step'
,
'sequence_last_step'
,
'dropout'
,
'split'
,
]
...
...
@@ -1525,3 +1539,61 @@ def reduce_min(input, dim=None, keep_dim=False):
'reduce_all'
:
True
if
dim
==
None
else
False
})
return
out
def
split
(
input
,
num_or_sections
,
dim
=-
1
):
"""
Splits the tensor into multiple sub-tensors.
Args:
input (Variable): The input variable which is a Tensor or LoDTensor.
num_or_sections (int|list): If :attr:`num_or_sections` is an integer,
then the integer indicates the number of equal sized sub-tensors
that the tensor will be divided into. If :attr:`num_or_sections`
is a list of integers, the length of list indicates the number of
sub-tensors and the integers indicate the sizes of sub-tensors'
:attr:`dim` dimension orderly.
dim (int): The dimension along which to split. If :math:`dim < 0`, the
dimension to split along is :math:`rank(input) + dim`.
Returns:
List: The list of segmented tensor variables.
Examples:
.. code-block:: python
# x is a Tensor variable with shape [3, 9, 5]:
x0, x1, x2 = fluid.layers.split(x, num_or_sections=3, dim=1)
x0.shape # [3, 3, 5]
x1.shape # [3, 3, 5]
x2.shape # [3, 3, 5]
x0, x1, x2 = fluid.layers.split(x, num_or_sections=[2, 3, 4], dim=1)
x0.shape # [3, 2, 5]
x1.shape # [3, 3, 5]
x2.shape # [3, 4, 5]
"""
helper
=
LayerHelper
(
'split'
,
**
locals
())
input_shape
=
input
.
shape
dim
=
(
len
(
input_shape
)
+
dim
)
if
dim
<
0
else
dim
if
isinstance
(
num_or_sections
,
int
):
assert
num_or_sections
>
1
,
'num_or_sections must be more than 1.'
num
=
num_or_sections
else
:
assert
len
(
num_or_sections
)
<
input_shape
[
dim
],
'len(num_or_sections) must not be more than input.shape[dim].'
num
=
len
(
num_or_sections
)
outs
=
[
helper
.
create_tmp_variable
(
dtype
=
helper
.
input_dtype
())
for
i
in
range
(
num
)
]
helper
.
append_op
(
type
=
'split'
,
inputs
=
{
'X'
:
input
},
outputs
=
{
'Out'
:
outs
},
attrs
=
{
'num'
:
num_or_sections
if
isinstance
(
num_or_sections
,
int
)
else
0
,
'sections'
:
num_or_sections
if
isinstance
(
num_or_sections
,
list
)
else
[],
'axis'
:
dim
})
return
outs
python/paddle/v2/fluid/layers/ops.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
..registry
import
register_layer
__activations__
=
[
...
...
python/paddle/v2/fluid/layers/tensor.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
..layer_helper
import
LayerHelper
from
..param_attr
import
ParamAttr
from
..framework
import
convert_np_dtype_to_dtype_
...
...
python/paddle/v2/fluid/memory_optimization_transpiler.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
collections
import
defaultdict
import
framework
from
framework
import
Program
,
default_main_program
,
Parameter
,
Variable
...
...
python/paddle/v2/fluid/net_drawer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
argparse
import
json
import
logging
...
...
python/paddle/v2/fluid/nets.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
layers
__all__
=
[
"simple_img_conv_pool"
,
"sequence_conv_pool"
,
"glu"
,
]
...
...
@@ -101,3 +115,38 @@ def sequence_conv_pool(input,
pool_out
=
layers
.
sequence_pool
(
input
=
conv_out
,
pool_type
=
pool_type
)
return
pool_out
def
glu
(
input
,
dim
=-
1
):
"""
The gated linear unit composed by split, sigmoid activation and elementwise
multiplication. Specifically, Split the input into two equal sized parts
:math:`a` and :math:`b` along the given dimension and then compute as
following:
.. math::
{GLU}(a, b)= a \otimes \sigma(b)
Refer to `Language Modeling with Gated Convolutional Networks
<https://arxiv.org/pdf/1612.08083.pdf>`_.
Args:
input (Variable): The input variable which is a Tensor or LoDTensor.
dim (int): The dimension along which to split. If :math:`dim < 0`, the
dimension to split along is :math:`rank(input) + dim`.
Returns:
Variable: The Tensor variable with half the size of input.
Examples:
.. code-block:: python
# x is a Tensor variable with shape [3, 6, 9]
fluid.nets.glu(input=x, dim=1) # shape of output: [3, 3, 9]
"""
a
,
b
=
layers
.
split
(
input
,
num_or_sections
=
2
,
dim
=
dim
)
act_b
=
layers
.
sigmoid
(
x
=
b
)
out
=
layers
.
elementwise_mul
(
x
=
a
,
y
=
act_b
)
return
out
python/paddle/v2/fluid/op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid.core
as
core
import
paddle.v2.fluid.proto.framework_pb2
as
framework_pb2
...
...
python/paddle/v2/fluid/optimizer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
collections
import
defaultdict
import
framework
...
...
python/paddle/v2/fluid/param_attr.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
initializer
import
Initializer
,
Xavier
,
Constant
from
regularizer
import
WeightDecayRegularizer
...
...
python/paddle/v2/fluid/profiler.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid.core
as
core
from
contextlib
import
contextmanager
import
os
...
...
python/paddle/v2/fluid/registry.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
re
import
cStringIO
import
warnings
...
...
python/paddle/v2/fluid/regularizer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
framework
__all__
=
[
...
...
python/paddle/v2/fluid/tests/__init__.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
python/paddle/v2/fluid/tests/book/test_fit_a_line.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
paddle.v2
as
paddle
import
paddle.v2.fluid
as
fluid
...
...
python/paddle/v2/fluid/tests/book/test_image_classification_train.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
sys
...
...
python/paddle/v2/fluid/tests/book/test_label_semantic_roles.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
math
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/book/test_machine_translation.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
paddle.v2
as
paddle
import
paddle.v2.fluid
as
fluid
...
...
python/paddle/v2/fluid/tests/book/test_recognize_digits_conv.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
numpy
as
np
import
paddle.v2
as
paddle
...
...
python/paddle/v2/fluid/tests/book/test_recognize_digits_mlp.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
numpy
as
np
import
paddle.v2
as
paddle
...
...
python/paddle/v2/fluid/tests/book/test_recommender_system.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
paddle.v2
as
paddle
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/book/test_understand_sentiment_conv.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
numpy
as
np
import
paddle.v2
as
paddle
...
...
python/paddle/v2/fluid/tests/book/test_understand_sentiment_dynamic_lstm.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
paddle.v2
as
paddle
import
paddle.v2.fluid
as
fluid
...
...
python/paddle/v2/fluid/tests/book/test_understand_sentiment_lstm.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
paddle.v2
as
paddle
import
paddle.v2.fluid
as
fluid
...
...
python/paddle/v2/fluid/tests/book/test_word2vec.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
paddle.v2
as
paddle
import
paddle.v2.fluid
as
fluid
...
...
python/paddle/v2/fluid/tests/book_distribute/notest_dist_fit_a_line.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
paddle.v2
as
paddle
import
paddle.v2.fluid
as
fluid
...
...
python/paddle/v2/fluid/tests/book_distribute/notest_dist_label_semantic_roles.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
math
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/book_distribute/notest_dist_word2vec.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
numpy
as
np
import
paddle.v2
as
paddle
...
...
python/paddle/v2/fluid/tests/book_distribute/notest_recognize_digits_conv_dist.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
numpy
as
np
import
paddle.v2
as
paddle
...
...
python/paddle/v2/fluid/tests/book_distribute/notest_understand_sentiment_conv_dist.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
os
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/book_distribute/test_split_var.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
math
import
unittest
from
paddle.v2.fluid.distribute_transpiler
import
split_dense_variable
...
...
python/paddle/v2/fluid/tests/decorators.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid
as
fluid
__all__
=
[
'many_times'
,
'prog_scope'
]
...
...
python/paddle/v2/fluid/tests/demo/fc_gan.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
errno
import
math
import
os
...
...
python/paddle/v2/fluid/tests/op_test.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
import
random
...
...
python/paddle/v2/fluid/tests/test_accuracy_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_activation_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_adadelta_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_adagrad_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/test_adam_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_adamax_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_array_read_write_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.core
as
core
import
paddle.v2.fluid.layers
as
layers
...
...
python/paddle/v2/fluid/tests/test_assign_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
op_test
import
numpy
import
unittest
...
...
python/paddle/v2/fluid/tests/test_assign_value_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid
as
fluid
import
paddle.v2.fluid.layers
as
layers
import
op_test
...
...
python/paddle/v2/fluid/tests/test_auc_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_batch_norm_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_beam_search_decode_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_beam_search_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
logging
from
paddle.v2.fluid.op
import
Operator
,
DynamicRecurrentOp
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/test_bilinear_tensor_product_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_calc_gradient.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid
as
fluid
...
...
python/paddle/v2/fluid/tests/test_cast_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
op_test
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_chunk_eval_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_clip.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
numpy
as
np
import
paddle.v2
as
paddle
...
...
python/paddle/v2/fluid/tests/test_clip_by_norm_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_clip_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_compare_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
op_test
import
unittest
import
numpy
...
...
python/paddle/v2/fluid/tests/test_concat_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_cond_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
logging
import
paddle.v2.fluid.core
as
core
import
unittest
...
...
python/paddle/v2/fluid/tests/test_conditional_block.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.layers
as
layers
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/test_const_value.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.framework
as
framework
...
...
python/paddle/v2/fluid/tests/test_conv2d_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_conv2d_transpose_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_conv3d_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_conv3d_transpose_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_conv_shift_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_cos_sim_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_create_op_doc_string.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.layers
as
layers
...
...
python/paddle/v2/fluid/tests/test_crf_decoding_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
random
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_crop_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_cross_entropy_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
,
randomize_probability
...
...
python/paddle/v2/fluid/tests/test_data_feeder.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid
as
fluid
...
...
python/paddle/v2/fluid/tests/test_decayed_adagrad_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_default_scope_funcs.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.v2.fluid.default_scope_funcs
import
*
import
unittest
...
...
python/paddle/v2/fluid/tests/test_detection_output_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_dropout_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_dyn_rnn.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid
as
fluid
import
paddle.v2
as
paddle
import
unittest
...
...
python/paddle/v2/fluid/tests/test_dynrnn_gradient_check.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
import
random
import
collections
...
...
python/paddle/v2/fluid/tests/test_dynrnn_static_input.py
0 → 100644
浏览文件 @
27e31f64
import
unittest
import
paddle.v2
as
paddle
import
paddle.v2.fluid.core
as
core
import
paddle.v2.fluid
as
fluid
from
paddle.v2.fluid.backward
import
append_backward
import
paddle.v2.fluid.framework
as
framework
from
paddle.v2.fluid.framework
import
Program
,
switch_main_program
import
bisect
import
numpy
as
np
fluid
.
default_startup_program
().
random_seed
=
1
class
TestDyRnnStaticInput
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
_delta
=
0.005
self
.
_max_sequence_len
=
3
self
.
_program
=
Program
()
switch_main_program
(
self
.
_program
)
self
.
output_dim
=
10
self
.
place
=
core
.
CPUPlace
()
self
.
prepare_x_tensor
()
self
.
prepare_static_input_tensor
()
self
.
exe
=
fluid
.
Executor
(
self
.
place
)
def
prepare_x_tensor
(
self
):
self
.
x_tensor_dim
=
10
lod
=
[[
0
,
2
,
3
,
6
]]
shape
=
[
lod
[
0
][
-
1
],
self
.
x_tensor_dim
]
self
.
x_tensor_data
=
np
.
random
.
random
(
shape
).
astype
(
'float32'
)
self
.
x_tensor
=
core
.
LoDTensor
()
self
.
x_tensor
.
set_lod
(
lod
)
self
.
x_tensor
.
set
(
self
.
x_tensor_data
,
self
.
place
)
def
prepare_static_input_tensor
(
self
):
self
.
static_input_tensor_dim
=
4
lod
=
[[
0
,
1
,
3
,
6
]]
shape
=
[
lod
[
0
][
-
1
],
self
.
static_input_tensor_dim
]
self
.
static_input_data
=
np
.
random
.
random
(
shape
).
astype
(
'float32'
)
self
.
static_input_tensor
=
core
.
LoDTensor
()
self
.
static_input_tensor
.
set_lod
(
lod
)
self
.
static_input_tensor
.
set
(
self
.
static_input_data
,
self
.
place
)
def
fetch_value
(
self
,
var
):
fetch_outs
=
self
.
exe
.
run
(
feed
=
{
'x_tensor'
:
self
.
x_tensor
,
'static_input_tensor'
:
self
.
static_input_tensor
},
fetch_list
=
[
var
],
return_numpy
=
False
)
return
self
.
_lodtensor_to_ndarray
(
fetch_outs
[
0
])
def
_lodtensor_to_ndarray
(
self
,
lod_tensor
):
dims
=
lod_tensor
.
get_dims
()
ndarray
=
np
.
zeros
(
shape
=
dims
).
astype
(
'float32'
)
for
i
in
xrange
(
np
.
product
(
dims
)):
ndarray
.
ravel
()[
i
]
=
lod_tensor
.
get_float_element
(
i
)
return
ndarray
,
lod_tensor
.
lod
()
def
build_graph
(
self
,
only_forward
=
False
):
x_tensor
=
fluid
.
layers
.
data
(
name
=
'x_tensor'
,
shape
=
[
self
.
x_tensor_dim
],
dtype
=
'float32'
,
lod_level
=
1
)
x_tensor
.
stop_gradient
=
False
static_input_tensor
=
fluid
.
layers
.
data
(
name
=
'static_input_tensor'
,
shape
=
[
self
.
static_input_tensor_dim
],
dtype
=
'float32'
,
lod_level
=
1
)
static_input_tensor
.
stop_gradient
=
False
if
only_forward
:
static_input_out_array
=
self
.
_program
.
global_block
().
create_var
(
name
=
'static_input_out_array'
,
type
=
core
.
VarDesc
.
VarType
.
LOD_TENSOR_ARRAY
,
dtype
=
'float32'
)
static_input_out_array
.
stop_gradient
=
True
rnn
=
fluid
.
layers
.
DynamicRNN
()
with
rnn
.
block
():
step_x
=
rnn
.
step_input
(
x_tensor
)
step_static_input
=
rnn
.
static_input
(
static_input_tensor
)
if
only_forward
:
fluid
.
layers
.
array_write
(
x
=
step_static_input
,
i
=
rnn
.
step_idx
,
array
=
static_input_out_array
)
last
=
fluid
.
layers
.
sequence_pool
(
input
=
step_static_input
,
pool_type
=
'last'
)
projected
=
fluid
.
layers
.
fc
(
input
=
[
step_x
,
last
],
size
=
self
.
output_dim
)
rnn
.
output
(
projected
)
if
only_forward
:
static_input_step_outs
=
[]
step_idx
=
fluid
.
layers
.
fill_constant
(
shape
=
[
1
],
dtype
=
'int64'
,
value
=
0
)
step_idx
.
stop_gradient
=
True
for
i
in
xrange
(
self
.
_max_sequence_len
):
step_out
=
fluid
.
layers
.
array_read
(
static_input_out_array
,
step_idx
)
step_out
.
stop_gradient
=
True
static_input_step_outs
.
append
(
step_out
)
fluid
.
layers
.
increment
(
x
=
step_idx
,
value
=
1.0
,
in_place
=
True
)
if
only_forward
:
return
static_input_step_outs
last
=
fluid
.
layers
.
sequence_pool
(
input
=
rnn
(),
pool_type
=
'last'
)
loss
=
fluid
.
layers
.
mean
(
x
=
last
)
append_backward
(
loss
)
static_input_grad
=
self
.
_program
.
global_block
().
var
(
framework
.
grad_var_name
(
'static_input_tensor'
))
return
static_input_grad
,
loss
def
get_seq_len_from_lod
(
self
,
lod
):
return
[
lod
[
0
][
i
+
1
]
-
lod
[
0
][
i
]
for
i
in
xrange
(
len
(
lod
[
0
])
-
1
)]
def
get_expected_static_step_outs
(
self
):
x_lod
=
self
.
x_tensor
.
lod
()
x_seq_len
=
self
.
get_seq_len_from_lod
(
x_lod
)
x_seq_len_sorted
=
sorted
(
x_seq_len
)
x_sorted_indices
=
np
.
argsort
(
x_seq_len
)[::
-
1
]
static_lod
=
self
.
static_input_tensor
.
lod
()
static_sliced
=
[
self
.
static_input_data
[
static_lod
[
0
][
i
]:
static_lod
[
0
][
i
+
1
]]
for
i
in
xrange
(
len
(
static_lod
[
0
])
-
1
)
]
static_seq_len
=
self
.
get_seq_len_from_lod
(
static_lod
)
static_reordered
=
[]
for
i
in
xrange
(
len
(
x_sorted_indices
)):
static_reordered
.
extend
(
static_sliced
[
x_sorted_indices
[
i
]].
tolist
())
static_seq_len_reordered
=
[
static_seq_len
[
x_sorted_indices
[
i
]]
for
i
in
xrange
(
len
(
x_sorted_indices
))
]
static_step_outs
=
[]
static_step_lods
=
[]
for
i
in
xrange
(
self
.
_max_sequence_len
):
end
=
len
(
x_seq_len
)
-
bisect
.
bisect_left
(
x_seq_len_sorted
,
i
+
1
)
lod
=
[
0
]
for
i
in
xrange
(
end
):
lod
.
append
(
static_seq_len_reordered
[
i
]
+
lod
[
-
1
])
static_step_lods
.
append
([
lod
])
end
=
lod
[
-
1
]
static_step_outs
.
append
(
np
.
array
(
static_reordered
[:
end
]).
astype
(
'float32'
))
return
static_step_outs
,
static_step_lods
def
test_step_out
(
self
):
static_step_outs
=
self
.
build_graph
(
only_forward
=
True
)
self
.
exe
.
run
(
framework
.
default_startup_program
())
expected_outs
,
expected_lods
=
self
.
get_expected_static_step_outs
()
for
i
in
xrange
(
self
.
_max_sequence_len
):
step_out
,
lod
=
self
.
fetch_value
(
static_step_outs
[
i
])
self
.
assertTrue
(
np
.
allclose
(
step_out
,
expected_outs
[
i
]))
self
.
assertTrue
(
np
.
allclose
(
lod
,
expected_lods
[
i
]))
def
test_network_gradient
(
self
):
static_input_grad
,
loss
=
self
.
build_graph
()
self
.
exe
.
run
(
framework
.
default_startup_program
())
actual_gradients
,
actual_lod
=
self
.
fetch_value
(
static_input_grad
)
static_input_shape
=
self
.
static_input_tensor
.
get_dims
()
numeric_gradients
=
np
.
zeros
(
shape
=
static_input_shape
).
astype
(
'float32'
)
# calculate numeric gradients
tensor_size
=
np
.
product
(
static_input_shape
)
for
i
in
xrange
(
tensor_size
):
origin
=
self
.
static_input_tensor
.
get_float_element
(
i
)
x_pos
=
origin
+
self
.
_delta
self
.
static_input_tensor
.
set_float_element
(
i
,
x_pos
)
y_pos
=
self
.
fetch_value
(
loss
)[
0
][
0
]
x_neg
=
origin
-
self
.
_delta
self
.
static_input_tensor
.
set_float_element
(
i
,
x_neg
)
y_neg
=
self
.
fetch_value
(
loss
)[
0
][
0
]
self
.
static_input_tensor
.
set_float_element
(
i
,
origin
)
numeric_gradients
.
ravel
()[
i
]
=
(
y_pos
-
y_neg
)
/
self
.
_delta
/
2
self
.
assertTrue
(
np
.
allclose
(
actual_gradients
,
numeric_gradients
,
0.001
))
self
.
assertTrue
(
np
.
allclose
(
actual_lod
,
self
.
static_input_tensor
.
lod
()))
if
__name__
==
'__main__'
:
unittest
.
main
()
python/paddle/v2/fluid/tests/test_elementwise_add_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_elementwise_div_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_elementwise_mul_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_elementwise_sub_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_exception.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid.core
as
core
import
unittest
...
...
python/paddle/v2/fluid/tests/test_executor_and_mul.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
...
...
python/paddle/v2/fluid/tests/test_expand_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_feed_fetch_method.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid.core
as
core
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_fill_constant_batch_size_like_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_fill_constant_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_fill_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_fill_zeros_like_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_framework_debug_str.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
from
paddle.v2.fluid.framework
import
Program
...
...
python/paddle/v2/fluid/tests/test_ftrl_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_gather_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_gaussian_random_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
...
...
python/paddle/v2/fluid/tests/test_get_places_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid
as
fluid
import
decorators
import
unittest
...
...
python/paddle/v2/fluid/tests/test_gru_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
import
math
...
...
python/paddle/v2/fluid/tests/test_gru_unit_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
math
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_hinge_loss_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_huber_loss_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_image_classification_layer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid
as
fluid
...
...
python/paddle/v2/fluid/tests/test_infer_shape.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/test_inference_model_io.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_initializer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
unittest
...
...
python/paddle/v2/fluid/tests/test_is_empty_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
paddle.v2.fluid.op
import
Operator
...
...
python/paddle/v2/fluid/tests/test_l1_norm_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
unittest
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_layers.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
unittest
...
...
python/paddle/v2/fluid/tests/test_linear_chain_crf_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
random
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_lod_array_length_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.layers
as
layers
from
paddle.v2.fluid.executor
import
Executor
...
...
python/paddle/v2/fluid/tests/test_lod_rank_table.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.v2.fluid.layers
import
lod_rank_table
,
data
from
paddle.v2.fluid.executor
import
Executor
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/test_lod_reset_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_lod_tensor_array.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.core
as
core
import
numpy
...
...
python/paddle/v2/fluid/tests/test_lod_tensor_array_ops.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.core
as
core
import
numpy
...
...
python/paddle/v2/fluid/tests/test_log_loss_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_logical_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
op_test
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_lookup_table_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_lrn_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_lstm_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_lstm_unit_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_margin_rank_loss_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_matmul_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_maxout_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_mean_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_memory_optimization_transpiler.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
unittest
...
...
python/paddle/v2/fluid/tests/test_minus_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_mnist_if_else_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid.layers
as
layers
from
paddle.v2.fluid.framework
import
Program
,
program_guard
,
default_main_program
,
default_startup_program
from
paddle.v2.fluid.executor
import
Executor
...
...
python/paddle/v2/fluid/tests/test_modified_huber_loss_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_momentum_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_mul_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_multiplex_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_nce.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_net.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid.core
as
core
from
paddle.v2.fluid.op
import
Operator
import
unittest
...
...
python/paddle/v2/fluid/tests/test_norm_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_op_support_gpu.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/test_operator.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.op
as
op
...
...
python/paddle/v2/fluid/tests/test_operator_desc.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/test_optimizer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.framework
as
framework
...
...
python/paddle/v2/fluid/tests/test_pad_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_parallel_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid
as
fluid
...
...
python/paddle/v2/fluid/tests/test_parameter.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
from
paddle.v2.fluid.framework
import
default_main_program
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/test_pool2d_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_pool3d_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_pool_max_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_positive_negative_pair_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
itertools
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_precision_recall_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_prelu_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_print_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.core
as
core
from
paddle.v2.fluid.executor
import
Executor
...
...
python/paddle/v2/fluid/tests/test_profiler.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
import
paddle.v2.fluid
as
fluid
...
...
python/paddle/v2/fluid/tests/test_program.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
__future__
import
print_function
import
unittest
...
...
python/paddle/v2/fluid/tests/test_protobuf.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid.proto.framework_pb2
as
framework_pb2
import
unittest
...
...
python/paddle/v2/fluid/tests/test_protobuf_descs.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/test_proximal_adagrad_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_proximal_gd_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_rank_loss_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_recurrent_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.layers
as
layers
...
...
python/paddle/v2/fluid/tests/test_reduce_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_registry.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
warnings
...
...
python/paddle/v2/fluid/tests/test_regularizer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.framework
as
framework
...
...
python/paddle/v2/fluid/tests/test_reorder_lod_tensor.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid
as
fluid
import
paddle.v2.fluid.core
as
core
...
...
@@ -6,8 +19,8 @@ import numpy
class
TestReorderLoDTensor
(
unittest
.
TestCase
):
num_seq
=
5
# [name,
dim
, lod_level] pair indicating data info of source and target
data_desc
=
([
'input'
,
9
,
0
],
[
'ref'
,
5
,
1
])
# [name,
shape
, lod_level] pair indicating data info of source and target
data_desc
=
([
'input'
,
[
9
],
0
],
[
'ref'
,
[
5
]
,
1
])
@
classmethod
def
setUpClass
(
cls
):
...
...
@@ -16,10 +29,10 @@ class TestReorderLoDTensor(unittest.TestCase):
@
classmethod
def
set_program
(
cls
):
dat
=
fluid
.
layers
.
data
(
name
=
cls
.
data_desc
[
0
][
0
],
shape
=
[
cls
.
data_desc
[
0
][
1
]
])
name
=
cls
.
data_desc
[
0
][
0
],
shape
=
cls
.
data_desc
[
0
][
1
])
dat
.
stop_gradient
=
False
rank_dat
=
fluid
.
layers
.
data
(
name
=
cls
.
data_desc
[
1
][
0
],
shape
=
[
cls
.
data_desc
[
1
][
1
]
])
name
=
cls
.
data_desc
[
1
][
0
],
shape
=
cls
.
data_desc
[
1
][
1
])
table
=
fluid
.
layers
.
lod_rank_table
(
rank_dat
)
new_dat
=
fluid
.
layers
.
reorder_lod_tensor_by_rank
(
x
=
dat
,
rank_table
=
table
)
...
...
@@ -49,7 +62,7 @@ class TestReorderLoDTensor(unittest.TestCase):
self
.
data
=
{}
for
desc
in
self
.
data_desc
:
data_name
=
desc
[
0
]
data_
dim
=
desc
[
1
]
data_
shape
=
desc
[
1
]
data_lod_level
=
desc
[
2
]
data_lod
=
[]
for
i
in
range
(
data_lod_level
):
...
...
@@ -59,9 +72,9 @@ class TestReorderLoDTensor(unittest.TestCase):
size
=
self
.
num_seq
if
i
==
0
else
lod_level_i
[
-
1
])
lod_level_i
=
[
0
]
+
numpy
.
cumsum
(
lod_level_i
).
tolist
()
data_lod
.
append
(
lod_level_i
)
data_value
=
numpy
.
random
.
random
(
size
=
[
data_lod
[
-
1
][
-
1
]
if
data_lod
else
self
.
num_seq
,
data_dim
]
).
astype
(
'float32'
)
data_value
=
numpy
.
random
.
random
(
size
=
[
data_lod
[
-
1
][
-
1
]
if
data_lod
else
self
.
num_seq
]
+
data_shape
).
astype
(
'float32'
)
self
.
data
[
data_name
]
=
(
data_value
,
data_lod
)
def
set_inputs
(
self
,
place
):
...
...
@@ -163,8 +176,6 @@ class TestReorderLoDTensor(unittest.TestCase):
numpy
.
allclose
(
numpy
.
array
(
actual_grad
),
expect_grad
,
atol
=
0.001
))
self
.
assertEqual
(
expect_grad_lod
,
actual_grad
.
lod
())
global
outputs_from_tensor_implicit_lod
outputs_from_tensor_implicit_lod
=
self
.
actual_outputs
# compare outputs between LodTensors with explicit and implicit lod
# use the same data but set the input lod explicitly
...
...
python/paddle/v2/fluid/tests/test_reshape_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_rmsprop_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_rnn_memory_helper_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
from
paddle.v2.fluid.framework
import
Program
...
...
python/paddle/v2/fluid/tests/test_roi_pool_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
import
math
...
...
python/paddle/v2/fluid/tests/test_row_conv_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_scale_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_scatter_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_scope.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid.core
import
unittest
...
...
python/paddle/v2/fluid/tests/test_selected_rows.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid.core
as
core
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_seq_concat_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
import
sys
...
...
python/paddle/v2/fluid/tests/test_seq_conv.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
import
random
...
...
python/paddle/v2/fluid/tests/test_seq_pool.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_sequence_erase_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_sequence_expand.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_sequence_slice_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
import
sys
...
...
python/paddle/v2/fluid/tests/test_sequence_softmax_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_sgd_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/test_shrink_rnn_memory.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.core
as
core
from
paddle.v2.fluid.executor
import
Executor
...
...
python/paddle/v2/fluid/tests/test_sigmoid_cross_entropy_with_logits_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
from
op_test
import
OpTest
from
scipy.special
import
logit
...
...
python/paddle/v2/fluid/tests/test_sign_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_smooth_l1_loss_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_softmax_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_softmax_with_cross_entropy_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_split_and_merge_lod_tensor_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.core
as
core
import
numpy
as
np
...
...
python/paddle/v2/fluid/tests/test_split_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_spp_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_squared_l2_distance_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_squared_l2_norm_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
as
np
import
unittest
from
numpy
import
linalg
as
LA
...
...
python/paddle/v2/fluid/tests/test_sum_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_tensor.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
paddle.v2.fluid.core
as
core
import
unittest
import
numpy
...
...
python/paddle/v2/fluid/tests/test_top_k_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_transpose_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_uniform_random_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
...
...
python/paddle/v2/fluid/tests/test_unpool_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
...
...
python/paddle/v2/fluid/tests/test_variable.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
from
paddle.v2.fluid.framework
import
default_main_program
,
Program
,
convert_np_dtype_to_dtype_
import
paddle.v2.fluid.core
as
core
...
...
python/paddle/v2/fluid/tests/test_warpctc_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
sys
import
unittest
import
numpy
as
np
from
op_test
import
OpTest
from
test_softmax_op
import
stable_softmax
CUDA_BLOCK_SIZE
=
512
class
CTCForward
(
object
):
def
__init__
(
self
,
softmax
,
softmax_lod
,
labels
,
labels_lod
,
blank
,
...
...
@@ -154,47 +169,63 @@ class CTCForward(object):
class
TestWarpCTCOp
(
OpTest
):
def
config
(
self
):
self
.
batch_size
=
4
self
.
num_classes
=
8
self
.
logits_lod
=
[[
0
,
4
,
5
,
8
,
11
]]
self
.
labels_lod
=
[[
0
,
3
,
4
,
8
,
12
]]
self
.
blank
=
self
.
num_classes
-
1
self
.
norm_by_times
=
False
def
setUp
(
self
):
self
.
op_type
=
"warpctc"
self
.
config
()
batch_size
=
4
num_classes
=
8
logits_lod
=
[[
0
,
4
,
5
,
8
,
11
]]
logits
=
np
.
random
.
uniform
(
0.1
,
1.0
,
[
11
,
num_classes
]).
astype
(
"float32"
)
logits
=
np
.
random
.
uniform
(
0.1
,
1.0
,
[
self
.
logits_lod
[
0
][
-
1
],
self
.
num_classes
]).
astype
(
"float32"
)
softmax
=
np
.
apply_along_axis
(
stable_softmax
,
1
,
logits
)
labels_lod
=
[[
0
,
3
,
4
,
8
,
12
]]
# labels should not be blank
labels
=
np
.
random
.
randint
(
0
,
num_classes
-
1
,
[
12
,
1
],
dtype
=
"int32"
)
blank
=
num_classes
-
1
norm_by_times
=
False
labels
=
np
.
random
.
randint
(
0
,
self
.
num_classes
-
1
,
[
self
.
labels_lod
[
0
][
-
1
],
1
],
dtype
=
"int32"
)
ctc
=
CTCForward
(
softmax
,
logits_lod
,
labels
,
labels_lod
,
blank
,
norm_by_times
)
ctc
=
CTCForward
(
softmax
,
self
.
logits_lod
,
labels
,
self
.
labels_lod
,
self
.
blank
,
self
.
norm_by_times
)
loss
=
ctc
.
forward
()
max_sequence_length
=
0
for
i
in
range
(
batch_size
):
max_sequence_length
=
max
(
max_sequence_length
,
logits_lod
[
0
][
i
+
1
]
-
logits_lod
[
0
][
i
])
gradient
=
np
.
zeros
(
[
max_sequence_length
,
batch_size
,
num_classes
],
dtype
=
"float32"
)
for
i
in
range
(
self
.
batch_size
):
max_sequence_length
=
max
(
max_sequence_length
,
self
.
logits_lod
[
0
][
i
+
1
]
-
self
.
logits_lod
[
0
][
i
])
self
.
gradient
=
np
.
zeros
(
[
max_sequence_length
,
self
.
batch_size
,
self
.
num_classes
],
dtype
=
"float32"
)
self
.
inputs
=
{
"Logits"
:
(
logits
,
logits_lod
),
"Label"
:
(
labels
,
labels_lod
)
"Logits"
:
(
logits
,
self
.
logits_lod
),
"Label"
:
(
labels
,
self
.
labels_lod
)
}
self
.
outputs
=
{
"Loss"
:
loss
}
self
.
attrs
=
{
"blank"
:
blank
,
"norm_by_times"
:
norm_by_times
}
self
.
attrs
=
{
"blank"
:
self
.
blank
,
"norm_by_times"
:
self
.
norm_by_times
}
def
test_check_output
(
self
):
self
.
check_output
()
def
test_check_grad
(
self
):
self
.
outputs
[
'WarpCTCGrad'
]
=
self
.
gradient
self
.
check_grad
([
"Logits"
],
"Loss"
,
max_relative_error
=
0.007
)
class
TestWarpCTCOpCase1
(
TestWarpCTCOp
):
def
config
(
self
):
self
.
batch_size
=
4
self
.
num_classes
=
CUDA_BLOCK_SIZE
+
2
self
.
logits_lod
=
[[
0
,
4
,
5
,
8
,
11
]]
self
.
labels_lod
=
[[
0
,
3
,
4
,
8
,
12
]]
self
.
blank
=
0
self
.
norm_by_times
=
False
# def test_check_grad(self):
# self.outputs["WarpCTCGrad"] = None
# self.check_grad(["Logits"], "Loss", max_relative_error=0.01)
if
__name__
==
"__main__"
:
unittest
.
main
()
python/paddle/v2/fluid/tests/test_while_op.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
paddle.v2.fluid.layers
as
layers
from
paddle.v2.fluid.executor
import
Executor
...
...
python/paddle/v2/image.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
This file contains some common interfaces for image preprocess.
Many users are confused about the image layout. We introduce
...
...
python/paddle/v2/inference.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
numpy
import
collections
import
topology
...
...
python/paddle/v2/master/__init__.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
client
import
*
__all__
=
[
'client'
]
python/paddle/v2/master/client.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
ctypes
import
os
...
...
python/paddle/v2/reader/tests/__init__.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
python/paddle/v2/tests/test_parameters.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import
unittest
import
sys
...
...
python/paddle/v2/trainer.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
Module Trainer
"""
...
...
tools/manylinux1/build_scripts/manylinux1-check.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# Logic copied from PEP 513
...
...
tools/manylinux1/build_scripts/ssl-check.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# cf. https://github.com/pypa/manylinux/issues/53
GOOD_SSL
=
"https://google.com"
...
...
v1_api_demo/mnist/api_train.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
"""
A very basic example for how to use current Raw SWIG API to train mnist network.
...
...
v1_api_demo/mnist/mnist_provider.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
from
paddle.trainer.PyDataProvider2
import
*
from
mnist_util
import
read_from_mnist
...
...
v1_api_demo/quick_start/data/proc_from_raw_data/preprocess.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# -*- coding: UTF-8 -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
...
...
v1_api_demo/quick_start/trainer_config.bidi-lstm.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
...
...
v1_api_demo/quick_start/trainer_config.cnn.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
...
...
v1_api_demo/quick_start/trainer_config.emb.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
...
...
v1_api_demo/quick_start/trainer_config.lr.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
...
...
v1_api_demo/quick_start/trainer_config.lstm.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
...
...
v1_api_demo/quick_start/trainer_config.resnet-lstm.py
浏览文件 @
27e31f64
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录