Skip to content

Conversation

@qingqing01
Copy link
Contributor

@qingqing01 qingqing01 commented Sep 13, 2017

Fix #4047
Fix #3717

本地单测都通过:

[build]$ ctest -R _op
Test project /home/dangqingqing/github/myfork/build
      Start   2: parameter_optimizer_test
 1/29 Test   #2: parameter_optimizer_test .........   Passed    0.01 sec
      Start  97: grad_op_builder_test
 2/29 Test  #97: grad_op_builder_test .............   Passed    0.00 sec
      Start 100: net_op_test
 3/29 Test #100: net_op_test ......................   Passed    0.00 sec
      Start 113: test_op
 4/29 Test #113: test_op ..........................   Passed    1.21 sec
      Start 123: test_rowwise_add_op
 5/29 Test #123: test_rowwise_add_op ..............   Passed    6.73 sec
      Start 124: test_uniform_random_op
 6/29 Test #124: test_uniform_random_op ...........   Passed    6.22 sec
      Start 125: test_operator
 7/29 Test #125: test_operator ....................   Passed    1.22 sec
      Start 126: test_mul_op
 8/29 Test #126: test_mul_op ......................   Passed   58.44 sec
      Start 127: test_add_two_op
 9/29 Test #127: test_add_two_op ..................   Passed    5.43 sec
      Start 128: test_recurrent_op
10/29 Test #128: test_recurrent_op ................   Passed    5.07 sec
      Start 129: test_scale_and_identity_op
11/29 Test #129: test_scale_and_identity_op .......   Passed    4.88 sec
      Start 132: test_cross_entropy_op
12/29 Test #132: test_cross_entropy_op ............   Passed   10.67 sec
      Start 133: test_squared_l2_distance_op
13/29 Test #133: test_squared_l2_distance_op ......   Passed    6.08 sec
      Start 134: test_reshape_op
14/29 Test #134: test_reshape_op ..................   Passed    7.61 sec
      Start 135: test_cos_sim_op
15/29 Test #135: test_cos_sim_op ..................   Passed    5.91 sec
      Start 137: test_elementwise_mul_op
16/29 Test #137: test_elementwise_mul_op ..........   Passed    7.41 sec
      Start 139: test_pad_op
17/29 Test #139: test_pad_op ......................   Passed    4.99 sec
      Start 140: test_gather_op
18/29 Test #140: test_gather_op ...................   Passed    4.72 sec
      Start 141: test_minus_op
19/29 Test #141: test_minus_op ....................   Passed    9.49 sec
      Start 143: test_mean_op
20/29 Test #143: test_mean_op .....................   Passed    6.11 sec
      Start 144: test_gaussian_random_op
21/29 Test #144: test_gaussian_random_op ..........   Passed    5.68 sec
      Start 145: test_sigmoid_op
22/29 Test #145: test_sigmoid_op ..................   Passed    5.01 sec
      Start 147: test_concat_op
23/29 Test #147: test_concat_op ...................   Passed    3.68 sec
      Start 148: test_sgd_op
24/29 Test #148: test_sgd_op ......................   Passed    5.08 sec
      Start 150: test_top_k_op
25/29 Test #150: test_top_k_op ....................   Passed    1.27 sec
      Start 151: test_softmax_op
26/29 Test #151: test_softmax_op ..................   Passed    6.23 sec
      Start 153: test_scatter_op
27/29 Test #153: test_scatter_op ..................   Passed    3.79 sec
      Start 154: test_sum_op
28/29 Test #154: test_sum_op ......................   Passed    6.66 sec
      Start 155: test_fill_zeros_like_op
29/29 Test #155: test_fill_zeros_like_op ..........   Passed    5.97 sec

100% tests passed, 0 tests failed out of 29

Total Test time (real) = 195.61 sec


template <>
const std::vector<const Tensor*> InferShapeContext::MultiInput<Tensor>(
const std::string& name) const {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specialized template function InferShapeContext::Input and InferShapeContext::MultiInput, thus, the InferShape of non-sequence operators can call Input<Tensor> to avoid to use LoDTensor.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this specialization is great to hide the difference between LoDTensor and Tensor. I can also accept that we don't have this and expose LoDTensor to non-sequence operator contributors, because I feel that LoDTensor is a key difference from TensorFlow and could be a PaddlePaddle flag.

}

template <>
std::vector<Tensor*> ExecutionContext::MultiOutput<Tensor>(
Copy link
Contributor Author

@qingqing01 qingqing01 Sep 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redifined and specialized template function ExecutionContext::Output and ExecutionContext::MultiOutput, thus, the kernels of non-sequence operators can call Input<Tensor> and Output<Tensor> to avoid to use LoDTensor.

Superjomn
Superjomn previously approved these changes Sep 13, 2017
wangkuiyi
wangkuiyi previously approved these changes Sep 13, 2017
Copy link
Collaborator

@wangkuiyi wangkuiyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM++

@qingqing01
Copy link
Contributor Author

How to share LoD info in operator will be done in next PR, thus merged this PR.

@qingqing01 qingqing01 merged commit 30ab4fa into PaddlePaddle:develop Sep 14, 2017
@qingqing01 qingqing01 deleted the lod_tensor2 branch November 14, 2019 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants