Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New features] Support VarBase to expose func #36965

Merged
merged 8 commits into from
Nov 11, 2021

Conversation

veyron95
Copy link
Contributor

@veyron95 veyron95 commented Nov 3, 2021

PR types

New features

PR changes

APIs

Describe

1. Exposed interface for VarBase

  • _slice
  • _share_buffer_with
  • _clear
  • _offset

2. VarBase provides a '_to' interface that copies the current varbase to target device and dtype

  • _to

3. Varbase's gradient supports rewriting a new piece of memory

  • _copy_gradient_from

4. Exposed numel interface to get the number of elements

  • _numel

5. varbase supports construction through Tensor and Device

  • InitVarBaseFromTensorWithArg

@paddle-bot-old
Copy link

paddle-bot-old bot commented Nov 3, 2021

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

@veyron95 veyron95 force-pushed the support_varbase_expose_func branch from c1e2174 to fe60c02 Compare November 9, 2021 08:51
Copy link
Contributor

@JiabinYang JiabinYang 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
Member

@ForFishes ForFishes left a comment

Choose a reason for hiding this comment

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

LGTM

@JiabinYang JiabinYang merged commit 5264566 into PaddlePaddle:develop Nov 11, 2021
@veyron95 veyron95 deleted the support_varbase_expose_func branch November 12, 2021 03:48
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.

4 participants