Constructor with strides and dimension names
| 430 | |
| 431 | /// Constructor with strides and dimension names |
| 432 | Tensor::Tensor(const std::shared_ptr<DataType>& type, const std::shared_ptr<Buffer>& data, |
| 433 | const std::vector<int64_t>& shape, const std::vector<int64_t>& strides, |
| 434 | const std::vector<std::string>& dim_names) |
| 435 | : type_(type), data_(data), shape_(shape), strides_(strides), dim_names_(dim_names) { |
| 436 | ARROW_CHECK(is_tensor_supported(type->id())); |
| 437 | if (shape.size() > 0 && strides.size() == 0) { |
| 438 | ARROW_CHECK_OK(internal::ComputeRowMajorStrides( |
| 439 | checked_cast<const FixedWidthType&>(*type_), shape, &strides_)); |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | Tensor::Tensor(const std::shared_ptr<DataType>& type, const std::shared_ptr<Buffer>& data, |
| 444 | const std::vector<int64_t>& shape, const std::vector<int64_t>& strides) |