Skip to content

Commit

Permalink
Fixed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jim19930609 committed Nov 24, 2021
1 parent 51fb833 commit efcc61d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion paddle/fluid/eager/tests/task_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cc_test(test_egr_ds_eager_utils SRCS eager_utils_test.cc DEPS ${eager_deps})
cc_test(test_egr_task_eager_utils SRCS eager_utils_test.cc DEPS ${eager_deps})
14 changes: 0 additions & 14 deletions paddle/fluid/eager/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,4 @@ egr::EagerTensor EagerUtils::GetOutput(
return EagerTensor((*(out.get())));
}

AutogradMeta* EagerUtils::unsafe_autograd_meta(const egr::EagerTensor& target) {
auto* p_autograd_meta = target.get_autograd_meta();
PADDLE_ENFORCE(p_autograd_meta,
paddle::platform::errors::Fatal(
"Null autograd_meta gotten from unsafe_autograd_meta(), "
"if you are using unsafe_autograd_meta, please make sure "
"your tensor's autograd_meta is set"));
return static_cast<AutogradMeta*>(p_autograd_meta);
}

std::pair<size_t, size_t> EagerUtils::OutRankInfo(
const egr::EagerTensor& target) {
return unsafe_autograd_meta(target)->OutRankInfo();
}
} // namespace egr
3 changes: 0 additions & 3 deletions paddle/fluid/eager/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ class EagerUtils {
iter.SetStopGradient(stop_gradient);
iter.apply(std::forward<Args>(args)...);
}
static std::pair<size_t, size_t> OutRankInfo(const egr::EagerTensor& target);
// This method will return an AutogradMeta pointer unsafely.
static AutogradMeta* unsafe_autograd_meta(const egr::EagerTensor& target);

// Intermidate needed remove this once we don't need legacy
static std::vector<std::shared_ptr<egr::EagerTensor>> SyncToVars(
Expand Down

1 comment on commit efcc61d

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.