Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
apex
Commits
1ccaaf4a
Commit
1ccaaf4a
authored
Jun 18, 2019
by
Michael Carilli
Browse files
Merge branch 'master' of
https://github.com/NVIDIA/apex
parents
68c850d3
cd6e46c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
apex/amp/_initialize.py
apex/amp/_initialize.py
+2
-2
No files found.
apex/amp/_initialize.py
View file @
1ccaaf4a
...
@@ -40,12 +40,12 @@ def applier(value, fn):
...
@@ -40,12 +40,12 @@ def applier(value, fn):
return
value
return
value
elif
isinstance
(
value
,
np
.
ndarray
):
elif
isinstance
(
value
,
np
.
ndarray
):
return
value
return
value
elif
hasattr
(
value
,
"to"
):
# Allow handling of custom batch classes
return
fn
(
value
)
elif
isinstance
(
value
,
container_abcs
.
Mapping
):
elif
isinstance
(
value
,
container_abcs
.
Mapping
):
return
{
applier
(
k
,
fn
)
:
applier
(
v
,
fn
)
for
k
,
v
in
value
.
items
()}
return
{
applier
(
k
,
fn
)
:
applier
(
v
,
fn
)
for
k
,
v
in
value
.
items
()}
elif
isinstance
(
value
,
container_abcs
.
Iterable
):
elif
isinstance
(
value
,
container_abcs
.
Iterable
):
return
type
(
value
)(
applier
(
v
,
fn
)
for
v
in
value
)
return
type
(
value
)(
applier
(
v
,
fn
)
for
v
in
value
)
elif
hasattr
(
value
,
"to"
):
# Allow handling of custom batch classes
return
fn
(
value
)
else
:
else
:
# Do I want this to fire off even if someone chooses to pass something ordinary like
# Do I want this to fire off even if someone chooses to pass something ordinary like
# an int or float? May be more annoying than it's worth.
# an int or float? May be more annoying than it's worth.
...
...
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