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

Why move output to cpu? #18

Open
ryh95 opened this issue Nov 15, 2017 · 1 comment
Open

Why move output to cpu? #18

ryh95 opened this issue Nov 15, 2017 · 1 comment

Comments

@ryh95
Copy link

ryh95 commented Nov 15, 2017

I noticed that in test function of trainer module
you write

output = output.data.squeeze().cpu()

Why you move output to cpu ?

By the way
in SimilarityTreeLSTM of model module
output = self.similarity(lstate, rstate)

Why don't use
output = self.similarity(lhidden, rhidden)

@dasguptar
Copy link
Owner

Hi @ryh95
I don't remember if there was any particular reason for moving the output to CPU. As I have mentioned in some other comments, this model was my first time using PyTorch, so I was quite extra cautious in many places, and ended up being redundant. This move to CPU might be one such instance.

Regarding the difference between state and hidden, I believe I had run experiments using both, and ended up using the one that performed better. Let me see if I can dig up the results.

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

No branches or pull requests

2 participants