Skip to content

Conversation

@zyfncg
Copy link
Contributor

@zyfncg zyfncg commented Jul 28, 2021

PR types

New features

PR changes

APIs

Describe

Support setitem by None index

Example:

x = paddle.to_tensor(np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]]).astype(np.float32))
x[:, None, 0] = 2.0
x[0, 0, :, None] = np.array([[0], [0]])

@paddle-bot-old
Copy link

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

AddAttr<std::vector<int64_t>>("decrease_axes",
"(list<int>) The axes to decrease.")
.SetDefault({});
AddAttr<std::vector<int64_t>>("none_axes", "(list<int>) The axes to none.")
Copy link
Contributor

Choose a reason for hiding this comment

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

看一下set_value_op下面的版本控制,新增attr要声明版本,否则可能会造成推理的兼容问题

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@hbwx24 hbwx24 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

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

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

LGTM

@chenwhql chenwhql merged commit f775bfc into PaddlePaddle:develop Jul 30, 2021
@zyfncg zyfncg deleted the zyf_slice branch August 16, 2021 02:41
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.

3 participants