mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
* Revert "Add missing brace (#7762)" This reverts commitea27c5af50. * Revert "[C++ API] Add backward() to Tensor and Variable (#7750)" This reverts commit1e2762796f.
This commit is contained in:
committed by
Peter Goldsborough
parent
8d91a602cc
commit
60745b3380
@@ -30,7 +30,7 @@ bool test_optimizer_xor(Optimizer optim, std::shared_ptr<ContainerList> model) {
|
||||
for (auto& layer : *model)
|
||||
x = layer->forward({x})[0].sigmoid_();
|
||||
Variable loss = at::binary_cross_entropy(x, target);
|
||||
loss.backward();
|
||||
backward(loss);
|
||||
return at::Scalar(loss.data());
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user