| 1152 | } |
| 1153 | |
| 1154 | Status GetTensorSize(const Tensor& tensor, int64_t* size) { |
| 1155 | // emulates the behavior of Write without actually writing |
| 1156 | int32_t metadata_length = 0; |
| 1157 | int64_t body_length = 0; |
| 1158 | io::MockOutputStream dst; |
| 1159 | ARROW_SUPPRESS_DEPRECATION_WARNING |
| 1160 | RETURN_NOT_OK(WriteTensor(tensor, &dst, &metadata_length, &body_length)); |
| 1161 | ARROW_UNSUPPRESS_DEPRECATION_WARNING |
| 1162 | *size = dst.GetExtentBytesWritten(); |
| 1163 | return Status::OK(); |
| 1164 | } |
| 1165 | |
| 1166 | // ---------------------------------------------------------------------- |
| 1167 | |