Skip to content

Conversation

@PyExtreme
Copy link

Hi @yf225 , Here is the C++ frontend API TripletMarginLoss implementation. I have got some branching issues and therefore am opening a pull request.

The link of our previous conversation is here and I have made all the changes as mentioned.
#27525

Copy link
Contributor

@yf225 yf225 left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the great work @PyExtreme! I left some comments. I believe we should also rebase this PR on top of current master and fix the code conflicts.

TEST_F(ModulesTest, PrettyPrintTripletMarginLoss) {
ASSERT_EQ(
c10::str(TripletMarginLoss(TripletMarginLossOptions().margin(3).p(2).eps(1e-06).swap(false))),
"torch::nn::TripletMarginLoss(margin=3, p=2, eps=1e-06, swap=false)");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it supposed to also print reduction? I guess we don't have a nice string representation of the reduction enum at the moment, and please feel free to not print it for now. :D

Copy link
Author

Choose a reason for hiding this comment

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

@yf225 , no this won't be printing reduction here.

Copy link
Author

Choose a reason for hiding this comment

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

@yf225 , Thanks a lot for reviewing it. I have learnt a lot from it, gained confidence and got familiar with the pytorch codebase.
Will surely make the mentioned changes and fix the conflicts.

Thank you

Copy link
Contributor

@yf225 yf225 left a comment

Choose a reason for hiding this comment

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

Thanks @PyExtreme! I left some comments.

<<<<<<< HEAD
=======
using namespace std
>>>>>>> Add C++ Frontend - triplet-margin-loss
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to fix the code conflict here, and we also shouldn't do using namespace std.

", swap=" << options.swap() <<
=======
", swap=" <<options.swap() <<
>>>>>>> Add C++ Frontend - triplet-margin-loss
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to fix the code conflict here.

=======
", swap=" <<options.swap() <<
>>>>>>> Add C++ Frontend - triplet-margin-loss
", reduction=" << options.reduction() << ")";
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems confusing that we have logic for printing reduction here, but the actual pretty_print string doesn't have reduction. I suggest removing the reduction printing logic here for now, until we have better support for printing named enums :)

Copy link
Author

Choose a reason for hiding this comment

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

Hi @yf225 , I mistakenly pushed these changes. Sorry for wasting your time, I was still working on the PR.

Copy link
Author

Choose a reason for hiding this comment

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

Here is my updated PR #27713

Thank you

@pytorchbot pytorchbot added module: build Build system issues module: ci Related to continuous integration module: cpu CPU specific problem (e.g., perf, algorithm) module: docs Related to our documentation, both in docs/ and docblocks module: internals Related to internal abstractions in c10 and ATen module: lint Issues related to our Python/C++ lint rules (run by Travis) labels Oct 10, 2019
@PyExtreme
Copy link
Author

Hi @yf225 , I had to create a new branch to tackle merge conflict since I am using cloud due to some limitations on my PC. Therefore, I don't have enough command there.

Also, I have incorporated the changes you have put before here

Here is the link to my new PR
#27713

From next time, I will find a smoother method for fixing conflicts.

Thank you

@PyExtreme PyExtreme closed this Oct 10, 2019
facebook-github-bot pushed a commit that referenced this pull request Oct 13, 2019
Summary:
Hi yf225 , I had to create a new branch to tackle merge conflict since I am using cloud due to some limitations on my PC. Therefore, I don't have enough command there.

Also, I have incorporated the changes you have put before here
#27613

Also, it would be great if you could recommend me some resources to work smmothly on GCP..:-D

Thank you
Pull Request resolved: #27713

Differential Revision: D17899695

Pulled By: yf225

fbshipit-source-id: eb6643223148774a5cbbd093bdcc5623872e5bba
thiagocrepaldi pushed a commit to thiagocrepaldi/pytorch that referenced this pull request Feb 4, 2020
Summary:
Hi yf225 , I had to create a new branch to tackle merge conflict since I am using cloud due to some limitations on my PC. Therefore, I don't have enough command there.

Also, I have incorporated the changes you have put before here
pytorch#27613

Also, it would be great if you could recommend me some resources to work smmothly on GCP..:-D

Thank you
Pull Request resolved: pytorch#27713

Differential Revision: D17899695

Pulled By: yf225

fbshipit-source-id: eb6643223148774a5cbbd093bdcc5623872e5bba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: build Build system issues module: ci Related to continuous integration module: cpp Related to C++ API module: cpu CPU specific problem (e.g., perf, algorithm) module: docs Related to our documentation, both in docs/ and docblocks module: internals Related to internal abstractions in c10 and ATen module: lint Issues related to our Python/C++ lint rules (run by Travis)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants