| 85 | |
| 86 | template<typename T> |
| 87 | Maybe<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 |
no test coverage detected