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
6b828681
Unverified
Commit
6b828681
authored
Feb 28, 2022
by
Yuge Zhang
Committed by
GitHub
Feb 28, 2022
Browse files
Up-to-date with send/recv API change of tianshou (#4586)
parent
fa5127b3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
nni/retiarii/strategy/_rl_impl.py
nni/retiarii/strategy/_rl_impl.py
+11
-0
No files found.
nni/retiarii/strategy/_rl_impl.py
View file @
6b828681
...
@@ -43,6 +43,17 @@ class MultiThreadEnvWorker(EnvWorker):
...
@@ -43,6 +43,17 @@ class MultiThreadEnvWorker(EnvWorker):
def
reset
(
self
):
def
reset
(
self
):
return
self
.
env
.
reset
()
return
self
.
env
.
reset
()
def
send
(
self
,
action
):
# for tianshou >= 0.4.6
if
action
is
None
:
self
.
result
=
self
.
pool
.
apply_async
(
self
.
env
.
reset
)
else
:
self
.
send_action
(
action
)
def
recv
(
self
):
# for tianshou >= 0.4.6
return
self
.
result
.
get
()
@
staticmethod
@
staticmethod
def
wait
(
*
args
,
**
kwargs
):
def
wait
(
*
args
,
**
kwargs
):
raise
NotImplementedError
(
'Async collect is not supported yet.'
)
raise
NotImplementedError
(
'Async collect is not supported yet.'
)
...
...
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