| 205 | } |
| 206 | |
| 207 | Status ValidateTensorParameters(const std::shared_ptr<DataType>& type, |
| 208 | const std::shared_ptr<Buffer>& data, |
| 209 | const std::vector<int64_t>& shape, |
| 210 | const std::vector<int64_t>& strides, |
| 211 | const std::vector<std::string>& dim_names) { |
| 212 | RETURN_NOT_OK(CheckTensorValidity(type, data, shape)); |
| 213 | if (!strides.empty()) { |
| 214 | RETURN_NOT_OK(CheckTensorStridesValidity(data, shape, strides, type)); |
| 215 | } else { |
| 216 | std::vector<int64_t> tmp_strides; |
| 217 | RETURN_NOT_OK(ComputeRowMajorStrides(checked_cast<const FixedWidthType&>(*type), |
| 218 | shape, &tmp_strides)); |
| 219 | } |
| 220 | if (dim_names.size() > shape.size()) { |
| 221 | return Status::Invalid("too many dim_names are supplied"); |
| 222 | } |
| 223 | return Status::OK(); |
| 224 | } |
| 225 | |
| 226 | template <typename Out> |
| 227 | struct ConvertColumnsToTensorVisitor { |
no test coverage detected