Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
MarisaKirisame committed Oct 1, 2020
1 parent f4603e3 commit 1cf2a63
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions aten/src/ATen/native/Checkpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,11 @@ Tensor& checkpoint_div_(Tensor& a, const Tensor& b) {
}

Tensor checkpoint_clone(at::Tensor const& a, c10::optional<c10::MemoryFormat> b) {
if (b) {
rematerialize_function_t rt =
[=](const Tensors& vec) -> Tensors {
return {at::clone(vec.at(0), b)};
};
return CheckpointTensorImpl::make("clone", rt, {a})[0];
}
else {
return a;
}
rematerialize_function_t rt =
[=](const Tensors& vec) -> Tensors {
return {at::clone(vec.at(0), b)};
};
return CheckpointTensorImpl::make("clone", rt, {a})[0];
}

Tensor checkpoint_where(at::Tensor const& a, at::Tensor const& b, at::Tensor const& c) {
Expand Down

0 comments on commit 1cf2a63

Please sign in to comment.