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
65ca6177
Commit
65ca6177
authored
Mar 13, 2019
by
Michael Carilli
Browse files
Fix for #186
parent
d1f74a3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
apex/amp/_amp_state.py
apex/amp/_amp_state.py
+9
-0
apex/amp/_initialize.py
apex/amp/_initialize.py
+2
-2
No files found.
apex/amp/_amp_state.py
View file @
65ca6177
...
@@ -5,6 +5,15 @@
...
@@ -5,6 +5,15 @@
import
os
import
os
import
torch
import
torch
TORCH_MAJOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
0
])
TORCH_MINOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
1
])
if
TORCH_MAJOR
==
0
:
import
collections.abc
as
container_abcs
else
:
from
torch._six
import
container_abcs
class
AmpState
(
object
):
class
AmpState
(
object
):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
hard_override
=
False
self
.
hard_override
=
False
...
...
apex/amp/_initialize.py
View file @
65ca6177
import
torch
import
torch
from
torch._six
import
container_abcs
,
string_classes
from
torch._six
import
string_classes
import
functools
import
functools
from
._amp_state
import
_amp_state
,
warn_or_err
from
._amp_state
import
_amp_state
,
warn_or_err
,
container_abcs
from
.handle
import
disable_casts
from
.handle
import
disable_casts
from
.scaler
import
LossScaler
from
.scaler
import
LossScaler
from
apex.fp16_utils
import
convert_network
from
apex.fp16_utils
import
convert_network
...
...
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