File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ void pytorch_test6()
258
258
259
259
auto my_loss =
260
260
[](const torch::Tensor &curr, const torch::Tensor &next) -> torch::Tensor {
261
- return torch::relu (next - curr + 1.0 );
261
+ return torch::relu (next - curr + 1.0 );
262
262
};
263
263
264
264
torch::optim::SGD optimizer (net->parameters (), /* lr=*/ 0.1 );
@@ -318,7 +318,7 @@ void pytorch_test7()
318
318
319
319
auto my_loss =
320
320
[](const torch::Tensor &curr, const torch::Tensor &next) -> torch::Tensor {
321
- return torch::relu (next - curr + 1.0 );
321
+ return torch::relu (next - curr + 1.0 );
322
322
};
323
323
324
324
torch::optim::SGD optimizer (net->parameters (), /* lr=*/ 0.1 );
Original file line number Diff line number Diff line change @@ -24,8 +24,7 @@ void ranking_function_training(
24
24
assert (batch.size (0 ) == 2 );
25
25
26
26
auto ranking_function_loss =
27
- [](const torch::Tensor &curr, const torch::Tensor &next) -> torch::Tensor
28
- {
27
+ [](const torch::Tensor &curr, const torch::Tensor &next) -> torch::Tensor {
29
28
assert (curr.dim () == 1 && next.dim () == 1 );
30
29
// The ranking needs to decrease from 'curr' to 'next'
31
30
// by at least 'delta'. Anything less than that is loss.
You can’t perform that action at this time.
0 commit comments