Constructor with strides and dimension names
| 490 | |
| 491 | /// Constructor with strides and dimension names |
| 492 | Tensor::Tensor(const std::shared_ptr<DataType>& type, const std::shared_ptr<Buffer>& data, |
| 493 | const std::vector<int64_t>& shape, const std::vector<int64_t>& strides, |
| 494 | const std::vector<std::string>& dim_names) |
| 495 | : type_(type), data_(data), shape_(shape), strides_(strides), dim_names_(dim_names) { |
| 496 | ARROW_CHECK(is_tensor_supported(type->id())); |
| 497 | if (shape.size() > 0 && strides.size() == 0) { |
| 498 | ARROW_CHECK_OK(internal::ComputeRowMajorStrides( |
| 499 | checked_cast<const FixedWidthType&>(*type_), shape, &strides_)); |
| 500 | } |
| 501 | } |
| 502 | |
| 503 | Tensor::Tensor(const std::shared_ptr<DataType>& type, const std::shared_ptr<Buffer>& data, |
| 504 | const std::vector<int64_t>& shape, const std::vector<int64_t>& strides) |