Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cyril Moineau
aidge_core
Commits
3a88f9be
Commit
3a88f9be
authored
1 year ago
by
Olivier BICHLER
Browse files
Options
Downloads
Patches
Plain Diff
Fixed pybind issues
parent
8bc10d7c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/aidge/data/Tensor.hpp
+1
-1
1 addition, 1 deletion
include/aidge/data/Tensor.hpp
python_binding/data/pybind_Tensor.cpp
+6
-6
6 additions, 6 deletions
python_binding/data/pybind_Tensor.cpp
with
7 additions
and
7 deletions
include/aidge/data/Tensor.hpp
+
1
−
1
View file @
3a88f9be
...
...
@@ -32,7 +32,7 @@ namespace Aidge {
* Contains a pointer to an actual contiguous implementation of data.
*/
class
Tensor
:
public
Data
,
public
Registrable
<
Tensor
,
std
::
tuple
<
std
::
string
,
DataType
>
,
std
::
shared_ptr
<
TensorImpl
>
(
in
t
device
,
NbElts_t
length
)
>
{
public
Registrable
<
Tensor
,
std
::
tuple
<
std
::
string
,
DataType
>
,
std
::
shared_ptr
<
TensorImpl
>
(
DeviceIdx_
t
device
,
NbElts_t
length
)
>
{
private:
DataType
mDataType
;
/** enum to specify data type. */
std
::
vector
<
DimSize_t
>
mDims
;
/** Dimensions of the tensor. */
...
...
This diff is collapsed.
Click to expand it.
python_binding/data/pybind_Tensor.cpp
+
6
−
6
View file @
3a88f9be
...
...
@@ -30,7 +30,7 @@ void addCtor(py::class_<Tensor,
Data
,
Registrable
<
Tensor
,
std
::
tuple
<
std
::
string
,
DataType
>
,
std
::
unique
_ptr
<
TensorImpl
>
(
cons
t
T
en
sor
&
)
>>&
mTensor
){
std
::
shared
_ptr
<
TensorImpl
>
(
DeviceIdx_t
device
,
NbElts_
t
l
en
gth
)
>>&
mTensor
){
mTensor
.
def
(
py
::
init
([](
py
::
array_t
<
T
,
py
::
array
::
c_style
|
py
::
array
::
forcecast
>
b
)
{
/* Request a buffer descriptor from Python */
py
::
buffer_info
info
=
b
.
request
();
...
...
@@ -58,16 +58,16 @@ void addCtor(py::class_<Tensor,
void
init_Tensor
(
py
::
module
&
m
){
py
::
class_
<
Registrable
<
Tensor
,
std
::
tuple
<
std
::
string
,
DataType
>
,
std
::
unique
_ptr
<
TensorImpl
>
(
cons
t
T
en
sor
&
)
>
,
std
::
shared
_ptr
<
TensorImpl
>
(
DeviceIdx_t
device
,
NbElts_
t
l
en
gth
)
>
,
std
::
shared_ptr
<
Registrable
<
Tensor
,
std
::
tuple
<
std
::
string
,
DataType
>
,
std
::
unique
_ptr
<
TensorImpl
>
(
cons
t
T
en
sor
&
)
>>>
(
m
,
"TensorRegistrable"
);
std
::
shared
_ptr
<
TensorImpl
>
(
DeviceIdx_t
device
,
NbElts_
t
l
en
gth
)
>>>
(
m
,
"TensorRegistrable"
);
py
::
class_
<
Tensor
,
std
::
shared_ptr
<
Tensor
>
,
Data
,
Registrable
<
Tensor
,
std
::
tuple
<
std
::
string
,
DataType
>
,
std
::
unique
_ptr
<
TensorImpl
>
(
cons
t
T
en
sor
&
)
>>
pyClassTensor
std
::
shared
_ptr
<
TensorImpl
>
(
DeviceIdx_t
device
,
NbElts_
t
l
en
gth
)
>>
pyClassTensor
(
m
,
"Tensor"
,
py
::
multiple_inheritance
(),
py
::
buffer_protocol
());
pyClassTensor
.
def
(
py
::
init
<>
())
...
...
@@ -76,7 +76,7 @@ void init_Tensor(py::module& m){
.
def
(
"dims"
,
(
const
std
::
vector
<
DimSize_t
>&
(
Tensor
::*
)()
const
)
&
Tensor
::
dims
)
.
def
(
"dtype"
,
&
Tensor
::
dataType
)
.
def
(
"size"
,
&
Tensor
::
size
)
.
def
(
"resize"
,
(
void
(
Tensor
::*
)(
const
std
::
vector
<
DimSize_t
>&
))
&
Tensor
::
resize
)
.
def
(
"resize"
,
(
void
(
Tensor
::*
)(
const
std
::
vector
<
DimSize_t
>&
,
std
::
vector
<
DimSize_t
>
))
&
Tensor
::
resize
)
.
def
(
"has_impl"
,
&
Tensor
::
hasImpl
)
.
def
(
"get_coord"
,
&
Tensor
::
getCoord
)
.
def
(
"get_idx"
,
&
Tensor
::
getIdx
)
...
...
@@ -114,7 +114,7 @@ void init_Tensor(py::module& m){
}
})
.
def_buffer
([](
Tensor
&
b
)
->
py
::
buffer_info
{
const
std
::
unique
_ptr
<
TensorImpl
>&
tensorImpl
=
b
.
getImpl
();
const
std
::
shared
_ptr
<
TensorImpl
>&
tensorImpl
=
b
.
getImpl
();
std
::
vector
<
size_t
>
dims
;
std
::
vector
<
size_t
>
strides
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment