| 104 | } |
| 105 | |
| 106 | bool DecodeResourceHandleList(std::unique_ptr<port::StringListDecoder> d, |
| 107 | ResourceHandle* ps, int64 n) { |
| 108 | std::vector<uint32> sizes(n); |
| 109 | if (!d->ReadSizes(&sizes)) return false; |
| 110 | |
| 111 | ResourceHandleProto proto; |
| 112 | for (int i = 0; i < n; ++i) { |
| 113 | if (!proto.ParseFromArray(d->Data(sizes[i]), sizes[i])) { |
| 114 | return false; |
| 115 | } |
| 116 | if (!ps[i].FromProto(proto).ok()) { |
| 117 | return false; |
| 118 | } |
| 119 | } |
| 120 | return true; |
| 121 | } |
| 122 | |
| 123 | } // namespace tensorflow |