| 1131 | } |
| 1132 | |
| 1133 | Status GetTensorSize(const Tensor& tensor, int64_t* size) { |
| 1134 | // emulates the behavior of Write without actually writing |
| 1135 | int32_t metadata_length = 0; |
| 1136 | int64_t body_length = 0; |
| 1137 | io::MockOutputStream dst; |
| 1138 | RETURN_NOT_OK(WriteTensor(tensor, &dst, &metadata_length, &body_length)); |
| 1139 | *size = dst.GetExtentBytesWritten(); |
| 1140 | return Status::OK(); |
| 1141 | } |
| 1142 | |
| 1143 | // ---------------------------------------------------------------------- |
| 1144 |