Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
0f11a31c
Commit
0f11a31c
authored
10 years ago
by
ultimanet
Browse files
Options
Downloads
Patches
Plain Diff
nifty_mpi_data: added __pos__ to distributed_data_object
parent
fcc82a10
No related branches found
No related tags found
1 merge request
!3
Nifty 2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nifty_mpi_data.py
+29
-0
29 additions, 0 deletions
nifty_mpi_data.py
with
29 additions
and
0 deletions
nifty_mpi_data.py
+
29
−
0
View file @
0f11a31c
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
## NIFTY (Numerical Information Field Theory) has been developed at the
## Max-Planck-Institute for Astrophysics.
##
## Copyright (C) 2015 Max-Planck-Society
##
## Author: Theo Steininger
## Project homepage: <http://www.mpa-garching.mpg.de/ift/nifty/>
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
## See the GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##initialize the 'found-packages'-dictionary
##initialize the 'found-packages'-dictionary
found
=
{}
found
=
{}
...
@@ -93,6 +115,13 @@ class distributed_data_object(object):
...
@@ -93,6 +115,13 @@ class distributed_data_object(object):
def
__repr__
(
self
):
def
__repr__
(
self
):
return
'
<distributed_data_object>
\n
'
+
self
.
data
.
__repr__
()
return
'
<distributed_data_object>
\n
'
+
self
.
data
.
__repr__
()
def
__pos__
(
self
):
temp_d2o
=
distributed_data_object
(
global_shape
=
self
.
shape
,
dtype
=
self
.
dtype
,
distribution_strategy
=
self
.
distribution_strategy
)
temp_d2o
.
set_local_data
(
data
=
self
.
get_local_data
())
return
temp_d2o
def
__neg__
(
self
):
def
__neg__
(
self
):
temp_d2o
=
distributed_data_object
(
global_shape
=
self
.
shape
,
temp_d2o
=
distributed_data_object
(
global_shape
=
self
.
shape
,
dtype
=
self
.
dtype
,
dtype
=
self
.
dtype
,
...
...
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