Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
6636ae9d
Commit
6636ae9d
authored
Jul 24, 2016
by
Ivan Smirnov
Browse files
Also add the new ctors to py::array_t
parent
6bb0ee11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
include/pybind11/numpy.h
include/pybind11/numpy.h
+14
-1
No files found.
include/pybind11/numpy.h
View file @
6636ae9d
...
...
@@ -276,8 +276,21 @@ protected:
template
<
typename
T
,
int
ExtraFlags
=
array
::
forcecast
>
class
array_t
:
public
array
{
public:
PYBIND11_OBJECT_CVT
(
array_t
,
array
,
is_non_null
,
m_ptr
=
ensure
(
m_ptr
));
array_t
()
:
array
()
{
}
array_t
(
const
buffer_info
&
info
)
:
array
(
info
)
{}
array_t
(
const
buffer_info
&
info
)
:
array
(
info
)
{
}
array_t
(
const
std
::
vector
<
size_t
>&
shape
,
T
*
ptr
,
const
std
::
vector
<
size_t
>&
strides
)
:
array
(
shape
,
ptr
,
strides
)
{
}
array_t
(
const
std
::
vector
<
size_t
>&
shape
,
T
*
ptr
)
:
array
(
shape
,
ptr
)
{
}
array_t
(
size_t
size
,
T
*
ptr
)
:
array
(
size
,
ptr
)
{
}
static
bool
is_non_null
(
PyObject
*
ptr
)
{
return
ptr
!=
nullptr
;
}
static
PyObject
*
ensure
(
PyObject
*
ptr
)
{
if
(
ptr
==
nullptr
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment