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

Method Tensor

cpp/src/arrow/tensor.cc:524–533  ·  view source on GitHub ↗

Constructor with strides and dimension names

Source from the content-addressed store, hash-verified

522
523/// Constructor with strides and dimension names
524Tensor::Tensor(const std::shared_ptr<DataType>& type, const std::shared_ptr<Buffer>& data,
525 const std::vector<int64_t>& shape, const std::vector<int64_t>& strides,
526 const std::vector<std::string>& dim_names)
527 : type_(type), data_(data), shape_(shape), strides_(strides), dim_names_(dim_names) {
528 ARROW_CHECK(is_tensor_supported(type->id()));
529 if (shape.size() > 0 && strides.size() == 0) {
530 ARROW_CHECK_OK(internal::ComputeRowMajorStrides(
531 checked_cast<const FixedWidthType&>(*type_), shape, &strides_));
532 }
533}
534
535Tensor::Tensor(const std::shared_ptr<DataType>& type, const std::shared_ptr<Buffer>& data,
536 const std::vector<int64_t>& shape, const std::vector<int64_t>& strides)

Calls 4

is_tensor_supportedFunction · 0.85
ComputeRowMajorStridesFunction · 0.85
idMethod · 0.45
sizeMethod · 0.45