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

Method Build

cpp/src/arrow/tensor/csf_converter.cc:213–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211 }
212
213 Result<std::shared_ptr<Tensor>> Build() {
214 RETURN_NOT_OK(internal::ComputeRowMajorStrides(value_type_, shape_, &strides_));
215
216 ARROW_ASSIGN_OR_RAISE(values_buffer_,
217 AllocateBuffer(value_elsize_ * tensor_size_, pool_));
218 values_ = values_buffer_->mutable_data();
219 std::fill_n(values_, value_elsize_ * tensor_size_, 0);
220
221 const int64_t start = 0;
222 const int64_t stop = indptr_[0]->size() - 1;
223 ExpandValues(0, 0, start, stop);
224
225 return std::make_shared<Tensor>(sparse_tensor_->type(), std::move(values_buffer_),
226 shape_, strides_, sparse_tensor_->dim_names());
227 }
228
229 void ExpandValues(const int64_t dim, const int64_t dim_offset, const int64_t start,
230 const int64_t stop) {

Callers 1

Calls 6

ComputeRowMajorStridesFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
AllocateBufferFunction · 0.50
mutable_dataMethod · 0.45
sizeMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected