Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Franck Dary
macaon
Commits
cf56fefc
Commit
cf56fefc
authored
Jun 23, 2020
by
Franck Dary
Browse files
Corrected bug on CustomHingeLoss where it would not run on gpu
parent
817bb319
Changes
1
Hide whitespace changes
Inline
Side-by-side
torch_modules/src/CustomHingeLoss.cpp
View file @
cf56fefc
#include
"CustomHingeLoss.hpp"
#include
"NeuralNetwork.hpp"
torch
::
Tensor
CustomHingeLoss
::
operator
()(
torch
::
Tensor
prediction
,
torch
::
Tensor
gold
)
{
torch
::
Tensor
loss
=
torch
::
zeros
(
1
);
torch
::
Tensor
loss
=
torch
::
zeros
(
1
)
.
to
(
NeuralNetworkImpl
::
device
)
;
for
(
unsigned
int
i
=
0
;
i
<
prediction
.
size
(
0
);
i
++
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment