| 1138 | } |
| 1139 | |
| 1140 | Status GetTensorSize(const Tensor& tensor, int64_t* size) { |
| 1141 | // emulates the behavior of Write without actually writing |
| 1142 | int32_t metadata_length = 0; |
| 1143 | int64_t body_length = 0; |
| 1144 | io::MockOutputStream dst; |
| 1145 | RETURN_NOT_OK(WriteTensor(tensor, &dst, &metadata_length, &body_length)); |
| 1146 | *size = dst.GetExtentBytesWritten(); |
| 1147 | return Status::OK(); |
| 1148 | } |
| 1149 | |
| 1150 | // ---------------------------------------------------------------------- |
| 1151 |