Skip to content
GitLab
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
550a546a
Commit
550a546a
authored
Oct 26, 2017
by
Martin Reinecke
Browse files
small tweaks
parent
5e42cb29
Pipeline
#20632
passed with stage
in 4 minutes and 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/field.py
View file @
550a546a
...
...
@@ -412,8 +412,8 @@ class Field(object):
if
np
.
isscalar
(
data
):
return
data
else
:
return_domain
=
tuple
(
self
.
domain
[
i
]
for
i
in
range
(
len
(
self
.
domain
)
)
return_domain
=
tuple
(
dom
for
i
,
dom
in
enumerate
(
self
.
domain
)
if
i
not
in
spaces
)
return
Field
(
domain
=
return_domain
,
val
=
data
,
copy
=
False
)
...
...
@@ -454,7 +454,7 @@ class Field(object):
raise
TypeError
(
"argument must be a Field"
)
if
other
.
domain
!=
self
.
domain
:
raise
ValueError
(
"domains are incompatible."
)
self
.
val
[()]
=
other
.
val
self
.
val
[()]
=
other
.
val
[()]
# ---General binary methods---
...
...
nifty/operators/diagonal_operator.py
View file @
550a546a
...
...
@@ -144,8 +144,8 @@ class DiagonalOperator(EndomorphicOperator):
for
space_index
in
self
.
_spaces
:
active_axes
+=
x
.
domain
.
axes
[
space_index
]
reshaper
=
[
x
.
shape
[
i
]
if
i
in
active_axes
else
1
for
i
in
range
(
len
(
x
.
shape
)
)
]
reshaper
=
[
shp
if
i
in
active_axes
else
1
for
i
,
shp
in
enumerate
(
x
.
shape
)]
reshaped_local_diagonal
=
np
.
reshape
(
self
.
_diagonal
.
val
,
reshaper
)
# here the actual multiplication takes place
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment