Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
30f574e0
Commit
30f574e0
authored
Feb 17, 2018
by
Martin Reinecke
Browse files
allow write-locking of data oojects
parent
1a790855
Changes
3
Hide whitespace changes
Inline
Side-by-side
nifty4/data_objects/distributed_do.py
View file @
30f574e0
...
...
@@ -517,3 +517,11 @@ def transpose(arr):
def
default_distaxis
():
return
0
def
lock
(
arr
):
arr
.
_data
.
flags
.
writeable
=
False
def
locked
(
arr
):
return
not
arr
.
_data
.
flags
.
writeable
nifty4/data_objects/numpy_do.py
View file @
30f574e0
...
...
@@ -91,3 +91,11 @@ def default_distaxis():
def
local_shape
(
glob_shape
,
distaxis
=-
1
):
return
glob_shape
def
lock
(
arr
):
arr
.
flags
.
writeable
=
False
def
locked
(
arr
):
return
not
arr
.
flags
.
writeable
nifty4/dobj.py
View file @
30f574e0
...
...
@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-201
7
Max-Planck-Society
# Copyright(C) 2013-201
8
Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
...
...
@@ -33,4 +33,5 @@ __all__ = ["ntask", "rank", "master", "local_shape", "data_object", "full",
"log"
,
"tanh"
,
"sqrt"
,
"from_object"
,
"from_random"
,
"local_data"
,
"ibegin"
,
"ibegin_from_shape"
,
"np_allreduce_sum"
,
"distaxis"
,
"from_local_data"
,
"from_global_data"
,
"to_global_data"
,
"redistribute"
,
"default_distaxis"
,
"mprint"
,
"is_numpy"
]
"redistribute"
,
"default_distaxis"
,
"mprint"
,
"is_numpy"
,
"lock"
,
"locked"
]
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