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

Class Array

python/mod_cvcuda/include/nvcv/python/Array.hpp:37–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35namespace py = pybind11;
36
37class Array
38 : public Resource
39 , public nvcv::Array
40{
41public:
42 static Array Create(int64_t length, nvcv::DataType dtype)
43 {
44 PyObject *oarray = capi().Array_Create(length, dtype);
45 CheckCAPIError();
46 NVCV_ASSERT(oarray == nullptr);
47 py::object pyarray = py::reinterpret_steal<py::object>(oarray);
48 return Array(pyarray);
49 }
50
51 static Array Create(const Shape &shape, nvcv::DataType dtype)
52 {
53 return Create(LengthIf1D(shape), dtype);
54 }
55
56private:
57 friend struct py::detail::type_caster<Array>;
58
59 Array() = default;
60
61 explicit Array(py::object obj)
62 : Resource(obj)
63 , nvcv::Array(FromHandle(CheckCAPIError(capi().Array_GetHandle(this->ptr())), true))
64 {
65 }
66};
67
68} // namespace nvcvpy
69

Callers 2

CreateMethod · 0.70
loadMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected