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
nni
Commits
d8e56857
"test/ut/git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "0a8fbbed5e4a8939b0b3094297b9c594d3ba5797"
Unverified
Commit
d8e56857
authored
Aug 03, 2021
by
Yuge Zhang
Committed by
GitHub
Aug 03, 2021
Browse files
Fix CGO import error (#4010)
parent
e5b4bf1a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
+11
-4
dependencies/required.txt
dependencies/required.txt
+1
-0
examples/nas/oneshot/spos/multi_trial.py
examples/nas/oneshot/spos/multi_trial.py
+2
-2
nni/common/device.py
nni/common/device.py
+7
-1
nni/retiarii/evaluator/pytorch/lightning.py
nni/retiarii/evaluator/pytorch/lightning.py
+1
-1
No files found.
dependencies/required.txt
View file @
d8e56857
...
@@ -13,6 +13,7 @@ websockets
...
@@ -13,6 +13,7 @@ websockets
filelock
filelock
prettytable
prettytable
dataclasses ; python_version < "3.7"
dataclasses ; python_version < "3.7"
typing_extensions ; python_version < "3.8"
numpy < 1.19.4 ; sys_platform == "win32"
numpy < 1.19.4 ; sys_platform == "win32"
numpy < 1.20 ; sys_platform != "win32" and python_version < "3.7"
numpy < 1.20 ; sys_platform != "win32" and python_version < "3.7"
numpy ; sys.platform != "win32" and python_version >= "3.7"
numpy ; sys.platform != "win32" and python_version >= "3.7"
...
...
examples/nas/oneshot/spos/multi_trial.py
View file @
d8e56857
...
@@ -13,7 +13,7 @@ from torchvision.datasets import CIFAR10
...
@@ -13,7 +13,7 @@ from torchvision.datasets import CIFAR10
from
blocks
import
ShuffleNetBlock
,
ShuffleXceptionBlock
from
blocks
import
ShuffleNetBlock
,
ShuffleXceptionBlock
from
nn_meter
import
load_latency_predictor
s
from
nn_meter
import
load_latency_predictor
class
ShuffleNetV2
(
nn
.
Module
):
class
ShuffleNetV2
(
nn
.
Module
):
...
@@ -142,7 +142,7 @@ class LatencyFilter:
...
@@ -142,7 +142,7 @@ class LatencyFilter:
if reverse is `False`, then the model returns `True` when `latency < threshold`,
if reverse is `False`, then the model returns `True` when `latency < threshold`,
else otherwisse
else otherwisse
"""
"""
self
.
predictors
=
load_latency_predictor
s
(
predictor
,
predictor_version
)
self
.
predictors
=
load_latency_predictor
(
predictor
,
predictor_version
)
self
.
threshold
=
threshold
self
.
threshold
=
threshold
def
__call__
(
self
,
ir_model
):
def
__call__
(
self
,
ir_model
):
...
...
nni/common/device.py
View file @
d8e56857
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
from
typing
import
Literal
try
:
from
typing
import
Literal
except
ImportError
:
from
typing_extensions
import
Literal
@
dataclass
@
dataclass
class
GPUDevice
:
class
GPUDevice
:
...
...
nni/retiarii/evaluator/pytorch/lightning.py
View file @
d8e56857
...
@@ -13,7 +13,7 @@ from torch.utils.data import DataLoader
...
@@ -13,7 +13,7 @@ from torch.utils.data import DataLoader
import
nni
import
nni
try
:
try
:
import
nni.retiarii.evaluator.pytorch.cgo.
trainer
as
cgo_trainer
from
.cgo
import
trainer
as
cgo_trainer
cgo_import_failed
=
False
cgo_import_failed
=
False
except
ImportError
:
except
ImportError
:
cgo_import_failed
=
True
cgo_import_failed
=
True
...
...
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