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

Method Make

cpp/src/arrow/tensor.h:225–232  ·  view source on GitHub ↗

\brief Create a NumericTensor with full parameters This factory function will return Status::Invalid when the parameters are inconsistent \param[in] data The buffer of the tensor content \param[in] shape The shape of the tensor \param[in] strides The strides of the tensor (if this is empty, the data assumed to be row-major) \param[in] dim_names The names of the tensor dimensions

Source from the content-addressed store, hash-verified

223 /// (if this is empty, the data assumed to be row-major)
224 /// \param[in] dim_names The names of the tensor dimensions
225 static Result<std::shared_ptr<NumericTensor<TYPE>>> Make(
226 const std::shared_ptr<Buffer>& data, const std::vector<int64_t>& shape,
227 const std::vector<int64_t>& strides = {},
228 const std::vector<std::string>& dim_names = {}) {
229 ARROW_RETURN_NOT_OK(internal::ValidateTensorParameters(
230 TypeTraits<TYPE>::type_singleton(), data, shape, strides, dim_names));
231 return std::make_shared<NumericTensor<TYPE>>(data, shape, strides, dim_names);
232 }
233
234 /// Constructor with non-negative strides and dimension names
235 NumericTensor(const std::shared_ptr<Buffer>& data, const std::vector<int64_t>& shape,

Callers

nothing calls this directly

Calls 2

ValidateTensorParametersFunction · 0.85
type_singletonFunction · 0.70

Tested by

no test coverage detected