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

Method ToTensor

cpp/src/arrow/array/array_base.cc:326–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326Result<std::shared_ptr<Tensor>> Array::ToTensor(bool allow_nulls) const {
327 if (!allow_nulls && null_count() > 0) {
328 return Status::Invalid(
329 "Array contains nulls, explicitly pass `allow_nulls=true` to leave them "
330 "undefined.");
331 }
332
333 return ToTensorWithNulls();
334}
335
336Result<std::shared_ptr<Tensor>> Array::ToTensorWithNulls() const {
337 return Status::TypeError("ToTensor is not implemented for Array type ", type()->name());

Callers 3

TESTFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 2

null_countFunction · 0.70
InvalidFunction · 0.50

Tested by 3

TESTFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36