Skip to content

Commit

Permalink
fix(nyz): fix unittest and platformtest bug
Browse files Browse the repository at this point in the history
  • Loading branch information
PaParaZz1 committed May 7, 2024
1 parent 66ff69b commit fea4b9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/platform_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
os: [macos-latest, windows-latest]
os: [macos-13, windows-latest]
python-version: [3.8, 3.9]

steps:
Expand Down
2 changes: 2 additions & 0 deletions ding/rl_utils/td.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ def nstep_return(data: namedtuple, gamma: Union[float, list], nstep: int, value_
if value_gamma is None:
return_ = return_tmp + (gamma ** nstep) * next_value * (1 - done)
else:
if np.isscalar(value_gamma):
value_gamma = torch.full_like(next_value, value_gamma)
value_gamma = view_similar(value_gamma, next_value)
done = view_similar(done, next_value)
return_ = return_tmp + value_gamma * next_value * (1 - done)
Expand Down

0 comments on commit fea4b9e

Please sign in to comment.