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
cb27dc72
There was a problem fetching the pipeline summary.
Commit
cb27dc72
authored
8 years ago
by
Theo Steininger
Browse files
Options
Downloads
Patches
Plain Diff
Removed dtype remnants from FieldArray
parent
38c492f6
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nifty/field_types/field_array.py
+3
-10
3 additions, 10 deletions
nifty/field_types/field_array.py
with
3 additions
and
10 deletions
nifty/field_types/field_array.py
+
3
−
10
View file @
cb27dc72
...
...
@@ -16,20 +16,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
numpy
as
np
from
field_type
import
FieldType
class
FieldArray
(
FieldType
):
def
__init__
(
self
,
shape
,
dtype
=
np
.
float
):
def
__init__
(
self
,
shape
):
try
:
new_shape
=
tuple
([
int
(
i
)
for
i
in
shape
])
except
TypeError
:
new_shape
=
(
int
(
shape
),
)
self
.
_shape
=
new_shape
super
(
FieldArray
,
self
).
__init__
(
dtype
=
dtype
)
super
(
FieldArray
,
self
).
__init__
()
@property
def
shape
(
self
):
...
...
@@ -43,14 +41,9 @@ class FieldArray(FieldType):
def
_to_hdf5
(
self
,
hdf5_group
):
hdf5_group
[
'
shape
'
]
=
self
.
shape
hdf5_group
.
attrs
[
'
dtype
'
]
=
self
.
dtype
.
name
return
None
@classmethod
def
_from_hdf5
(
cls
,
hdf5_group
,
loopback_get
):
result
=
cls
(
shape
=
hdf5_group
[
'
shape
'
][:],
dtype
=
np
.
dtype
(
hdf5_group
.
attrs
[
'
dtype
'
])
)
result
=
cls
(
shape
=
hdf5_group
[
'
shape
'
][:])
return
result
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