Template Function Pennylane::NanoBindings::Utils::createNumpyArrayFromVector(std::vector<VectorT>&&, const std::vector<size_t>&)¶
Defined in File BindingsUtils.hpp
Function Documentation¶
-
template<typename VectorT>
nb::ndarray<VectorT, nb::numpy, nb::c_contig> Pennylane::NanoBindings::Utils::createNumpyArrayFromVector(std::vector<VectorT> &&data, const std::vector<size_t> &shape)¶ Create an ndarray from a vector of data with proper ownership transfer.
- Template Parameters
VectorT – Data type of the vector elements
- Parameters
data – Vector containing the data to transfer
shape – Vector containing the shape of the resulting array
- Returns
nb::ndarray<VectorT, nb::numpy, nb::c_contig> Array with copied data in numpy format
api/function_BindingsUtils_8hpp_1ae79a8a819051358166ba81598f9e9299
Download Python script
Download Notebook
View on GitHub