MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / MakeEagerBlobObjectList

Function MakeEagerBlobObjectList

oneflow/core/framework/nn_graph.cpp:87–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86template<typename T>
87Maybe<void> MakeEagerBlobObjectList(vm::EagerBlobObjectList* blob_list, const T& tensor_list) {
88 blob_list->reserve(tensor_list.size());
89 for (const auto& tensor : tensor_list) {
90 CHECK_OR_RETURN(tensor->is_eager())
91 << Error::RuntimeError() << "Tensors in nn.Graph should be eager";
92 if (tensor->is_global()) {
93 blob_list->emplace_back(JUST(JUST(tensor->cur_rank_phy_tensor())->eager_blob_object()));
94 } else {
95 blob_list->emplace_back(JUST(tensor->eager_blob_object()));
96 }
97 }
98 return Maybe<void>::Ok();
99}
100
101} // namespace
102

Callers 3

RunLazyNNGraphFunction · 0.85
SoftSyncNNGraphBuffersFunction · 0.85

Calls 6

sizeMethod · 0.45
is_eagerMethod · 0.45
is_globalMethod · 0.45
emplace_backMethod · 0.45
eager_blob_objectMethod · 0.45
cur_rank_phy_tensorMethod · 0.45

Tested by

no test coverage detected