Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
xerus
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xerus
xerus
Commits
4a5f5726
Commit
4a5f5726
authored
May 23, 2017
by
Ben Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
protect tensors after indexing with custodian and ward in python wrapper (fixes
#197
)
parent
7f951262
Pipeline
#727
passed with stages
in 8 minutes and 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
Makefile
Makefile
+1
-1
doc/new/_posts/2000-11-22-als.md
doc/new/_posts/2000-11-22-als.md
+1
-1
src/xerus/python/python.cpp
src/xerus/python/python.cpp
+5
-5
No files found.
Makefile
View file @
4a5f5726
...
...
@@ -107,7 +107,7 @@ define \n
endef
FLAGS
=
$(
strip
$(WARNINGS)
$(OPTIMIZE)
$(LOGGING)
$(DEBUG)
$(ADDITIONAL_INCLUDE)
$(OTHER)
)
PYTHON_FLAGS
=
$(
strip
$(WARNINGS)
$(LOGGING)
$(DEBUG)
$(ADDITIONAL_INCLUDE)
$(OTHER)
)
PYTHON_FLAGS
=
$(
strip
$(WARNINGS)
$(LOGGING)
$(DEBUG)
$(ADDITIONAL_INCLUDE)
$(OTHER)
-fno-var-tracking-assignments
)
MINIMAL_DEPS
=
Makefile config.mk makeIncludes/general.mk makeIncludes/warnings.mk makeIncludes/optimization.mk
...
...
doc/new/_posts/2000-11-22-als.md
View file @
4a5f5726
---
layout
:
post
title
:
"
A
LS
and
Performance
Data
"
title
:
"
A
lternating
Algorithms
"
date
:
2000-11-22
topic
:
"
Basic
Usage"
section
:
"
Documentation"
...
...
src/xerus/python/python.cpp
View file @
4a5f5726
...
...
@@ -352,7 +352,7 @@ BOOST_PYTHON_MODULE(xerus) {
return
Tensor
(
_dim
,
[
&
](
std
::
vector
<
size_t
>
_p
)
{
return
boost
::
python
::
call
<
double
>
(
_f
,
_p
);
});
}).
staticmethod
(
"from_function"
)
}).
staticmethod
(
"from_function"
)
.
def
(
"from_ndarray"
,
+
[](
PyObject
*
_npObject
){
//TODO check for dangling pointers!
#pragma GCC diagnostic push
...
...
@@ -513,9 +513,9 @@ BOOST_PYTHON_MODULE(xerus) {
.
def
(
"ensure_own_data_and_apply_factor"
,
&
Tensor
::
ensure_own_data_and_apply_factor
)
.
def
(
"multiIndex_to_position"
,
&
Tensor
::
multiIndex_to_position
).
staticmethod
(
"multiIndex_to_position"
)
.
def
(
"position_to_multiIndex"
,
&
Tensor
::
position_to_multiIndex
).
staticmethod
(
"position_to_multiIndex"
)
.
def
(
"__call__"
,
+
[](
Tensor
&
_this
,
const
std
::
vector
<
Index
>
&
_idx
){
return
new
xerus
::
internal
::
IndexedTensor
<
Tensor
>
(
std
::
move
(
_this
(
_idx
)));
},
return_value_policy
<
manage_new_object
>
()
)
.
def
(
"__call__"
,
+
[](
Tensor
*
_this
,
const
std
::
vector
<
Index
>
&
_idx
){
return
new
xerus
::
internal
::
IndexedTensor
<
Tensor
>
(
std
::
move
(
(
*
_this
)
(
_idx
)));
},
return_value_policy
<
manage_new_object
,
with_custodian_and_ward_postcall
<
0
,
1
>>
()
)
.
def
(
"__str__"
,
&
Tensor
::
to_string
)
.
def
(
self
*
other
<
value_t
>
())
.
def
(
other
<
value_t
>
()
*
self
)
...
...
@@ -578,7 +578,7 @@ BOOST_PYTHON_MODULE(xerus) {
})
.
def
(
"__call__"
,
+
[](
TensorNetwork
&
_this
,
const
std
::
vector
<
Index
>
&
_idx
){
return
new
xerus
::
internal
::
IndexedTensor
<
TensorNetwork
>
(
std
::
move
(
_this
(
_idx
)));
},
return_value_policy
<
manage_new_object
>
()
)
},
return_value_policy
<
manage_new_object
,
with_custodian_and_ward_postcall
<
0
,
1
>>
()
)
.
def
(
self
*
other
<
value_t
>
())
.
def
(
other
<
value_t
>
()
*
self
)
.
def
(
self
/
other
<
value_t
>
())
...
...
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