MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / Create

Method Create

python/mod_cvcuda/include/nvcv/python/Tensor.hpp:43–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41{
42public:
43 static Tensor Create(const nvcv::TensorShape &tshape, nvcv::DataType dtype, int rowalign = 0)
44 {
45 PyObject *otensor = capi().Tensor_Create(tshape.size(), &tshape[0], static_cast<NVCVDataType>(dtype),
46 static_cast<NVCVTensorLayout>(tshape.layout()), rowalign);
47 CheckCAPIError();
48 NVCV_ASSERT(otensor != nullptr);
49 py::object pytensor = py::reinterpret_steal<py::object>(otensor);
50
51 return Tensor(pytensor);
52 }
53
54 static Tensor Create(const Shape &shape, nvcv::DataType dtype, nvcv::TensorLayout layout = nvcv::TENSOR_NONE,
55 int rowalign = 0)

Callers

nothing calls this directly

Calls 5

CheckCAPIErrorFunction · 0.85
CreateNVCVTensorShapeFunction · 0.85
TensorClass · 0.70
sizeMethod · 0.45
layoutMethod · 0.45

Tested by

no test coverage detected