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

add prefetch and onPassEnd to PaddleApi.h and remove config_parser.py #2

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions paddle/api/GradientMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ void GradientMachine::start() { m->machine->start(); }

void GradientMachine::finish() { m->machine->finish(); }

void GradientMachine::onPassEnd() { m->machine->onPassEnd(); }

void GradientMachine::prefetch(const Arguments& inArgs) {
auto& in =
m->cast<std::vector<paddle::Argument>>(inArgs.getInternalArgumentsPtr());
m->machine->prefetch(in);
}

void GradientMachine::forward(const Arguments& inArgs,
Arguments* outArgs,
PassType passType) {
Expand Down
12 changes: 11 additions & 1 deletion paddle/api/PaddleAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,22 @@ class GradientMachine {
GradientMatchineCreateMode mode = CREATE_MODE_NORMAL,
const std::vector<int>& parameterTypes = defaultParamTypes);

void start();

/**
* @brief finish
*/
void finish();

void start();
/**
* Prefetch row ids of sparse parameter.
*/
void prefetch(const Arguments& inArgs);

/**
* Do some thing when train pass ended.
*/
void onPassEnd();

/**
* The forward stage of GradientMachine.
Expand Down
38 changes: 0 additions & 38 deletions python/paddle/trainer_config_helpers/config_parser.py

This file was deleted.