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

[WIP] Cross loss entropy cpp example #201

Closed
wants to merge 6 commits into from
Closed

Conversation

jjsjann123
Copy link
Collaborator

No description provided.

auto tv10 = div(tv6, tv9);
auto tv11 = log(tv10);
auto tv12 = neg(tv11);
auto tv13 = reshape(tv1, {128}, {128, 1});
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: we can use unsqueeze

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, the only reason we are seeing a reshape here is that unsqueeze/squeeze is not in thunder lowering yet.

@jjsjann123
Copy link
Collaborator Author

tagging #156

// none -> 0
// mean -> 1
// sum -> 2
auto t24 = at::cross_entropy_loss_symint(t0, t1, None, 1, 5, 0.0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

None is not valid in C++. What's the right way to call this function?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Never mind, it's just {}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops. sorry about this, must have copied the wrong file 🙇

@jjsjann123
Copy link
Collaborator Author

closing this one since Naoya is already on top of it.

@jjsjann123 jjsjann123 closed this May 11, 2023
@jjsjann123 jjsjann123 deleted the cross_loss_entropy_cpp branch May 11, 2023 18:20
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.

2 participants