Skip to content

Conversation

@pangyoki
Copy link
Contributor

@pangyoki pangyoki commented Apr 30, 2021

PR types

New features

PR changes

APIs

Describe

Cherry-pick PR #32573 .

17 Inplace APIs in Tensor method

Tensor.reshape_
Tensor.squeeze_
Tensor.unsqueeze_
Tensor.scatter_
Tensor.tanh_
Tensor.clip_
Tensor.scale_
Tensor.add_
Tensor.subtract_
Tensor.ceil_
Tensor.floor_
Tensor.exp_
Tensor.reciprocal_
Tensor.round_
Tensor.sqrt_
Tensor.rsqrt_
Tensor.flatten_

* add relu6_ hardsigmoid_ leaky_relu_ Inplace APIs

* add softmax_with_cross_entropy_ Inplace API

* add clip_ scale_ add_ subtract_ Inplace APIs

* add wlist

* fix parameter of scale api

* add add_n_ Inplace API and remove log_ Inplace API

* fix elementwise_add_ and elementwise_sub_ broadcast problem

* elementwise inplace api give error message before run the op

* use broadcast_shape in elementwise inplace op

* add 8 inplace apis that is auto generated

* add unittest for all inplace apis

* add decorator for inplace apis in static mode

* fix windows blas fail of exp inplace api, change array_equal to allclose

* add flatten inplace api

* add flatten unittest

* fix flatten unittest

* add decorator

* fix grad.numpy in test_pylayer_op

* unsupport softmax_with_cross_entropy_

* add test_inplace_softmax_with_cross_entropy to static_mode_white_list

* delete __all__ in inplace_utils

* delete activation inplace function and add Tensor.inplace_func

* change paddle.inplace_ to Tensor.inplace_

* fix little problem

* add paddle in inplace_utils
@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Apr 30, 2021

✅ This PR's description meets the template requirements!
Please wait for other CI results.

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jzhang533 jzhang533 left a comment

Choose a reason for hiding this comment

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

lgtm

@lanxianghit lanxianghit merged commit 097d5f5 into PaddlePaddle:release/2.1 Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants