| 60 | namespace { |
| 61 | |
| 62 | Maybe<bool> GetTensorValidInCurRank(const std::shared_ptr<one::Tensor>& tensor) { |
| 63 | if (tensor->is_global()) { |
| 64 | const auto& parallel_id = JUST(GetParallelId4CurrentProcessCtx(JUST(tensor->parallel_desc()))); |
| 65 | if (parallel_id->has_value()) { |
| 66 | return true; |
| 67 | } else { |
| 68 | return false; |
| 69 | } |
| 70 | } else { |
| 71 | return true; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | Maybe<std::string> GetTensorMetaString(const std::shared_ptr<one::Tensor>& tensor) { |
| 76 | std::string ret = "shape=" + tensor->shape()->ToString() + ", dtype=" + tensor->dtype()->name(); |
no test coverage detected