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

cpu/gpu mean op and its unit test #3135

Merged
merged 5 commits into from
Aug 2, 2017
Merged

Conversation

gangliao
Copy link
Contributor

@gangliao gangliao commented Aug 1, 2017

Review after #3133


output->mutable_data<T>(context.GetPlace());

EigenScalar<T>::From(*output).device(*(context.GetEigenDevice<Place>())) =
Copy link
Contributor Author

@gangliao gangliao Aug 2, 2017

Choose a reason for hiding this comment

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

Tensor2Eigen still not easy to w/r.

@gangliao gangliao changed the title Mean cpu/gpu op and its unit test cpu/gpu mean op and its unit test Aug 2, 2017
Copy link
Contributor

@dzhwinter dzhwinter left a comment

Choose a reason for hiding this comment

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

LGTM

public:
MeanOpMaker(OpProto *proto, OpAttrChecker *op_checker)
: OpProtoAndCheckerMaker(proto, op_checker) {
AddInput("X", "The input of mean op");
Copy link
Contributor

@dzhwinter dzhwinter Aug 2, 2017

Choose a reason for hiding this comment

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

maybe we need a axis parameter to indicate which axis will be computed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

discussed with @reyoung Currently, we only need all mean operator.

self.X = np.random.random((32, 784)).astype("float32")
self.Out = np.mean(self.X)


Copy link
Contributor

Choose a reason for hiding this comment

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

no real test here ?

check if mean_op's output equals inputs's mean

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks it already did where OpTestMeta took this job.

Copy link
Contributor

Choose a reason for hiding this comment

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

get it.

Copy link
Member

@QiJune QiJune left a comment

Choose a reason for hiding this comment

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

LGTM

@gangliao gangliao merged commit 7e60706 into PaddlePaddle:develop Aug 2, 2017
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