MCPcopy Create free account
hub / github.com/apache/arrow / GetTensorSize

Function GetTensorSize

cpp/src/arrow/ipc/writer.cc:1154–1164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1152}
1153
1154Status 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

Callers 1

TEST_FFunction · 0.85

Calls 2

WriteTensorFunction · 0.85
OKFunction · 0.50

Tested by 1

TEST_FFunction · 0.68