Skip to content

Commit ce58033

Browse files
DanilBaibakvmoens
andcommitted
[BugFix] Fixed import for importlib (#1914)
Co-authored-by: vmoens <vincentmoens@gmail.com>
1 parent f078fcd commit ce58033

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.github/workflows/build-wheels-m1.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ permissions:
1919

2020
jobs:
2121
generate-matrix:
22-
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
22+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@Remove-Builds-Limits-for-Testing
2323
with:
2424
package-type: wheel
2525
os: macos-arm64
2626
test-infra-repository: pytorch/test-infra
27-
test-infra-ref: main
27+
test-infra-ref: Remove-Builds-Limits-for-Testing
2828
build:
2929
needs: generate-matrix
3030
strategy:

test/smoke_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ def test_imports():
1414
from torchrl.envs.gym_like import GymLikeEnv # noqa: F401
1515
from torchrl.modules import SafeModule # noqa: F401
1616
from torchrl.objectives.common import LossModule # noqa: F401
17+
18+
PrioritizedReplayBuffer(alpha=1.1, beta=1.1)

torchrl/_extension.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
# This source code is licensed under the MIT license found in the
44
# LICENSE file in the root directory of this source tree.
55

6-
import importlib
6+
import importlib.util
77
import warnings
88

99

1010
def is_module_available(*modules: str) -> bool:
11-
r"""Returns if a top-level module with :attr:`name` exists *without** importing it.
11+
"""Returns if a top-level module with :attr:`name` exists *without** importing it.
1212
1313
This is generally safer than try-catch block around a
1414
`import X`. It avoids third party libraries breaking assumptions of some of
1515
our tests, e.g., setting multiprocessing start method when imported
1616
(see librosa/#747, torchvision/#544).
17-
1817
"""
1918
return all(importlib.util.find_spec(m) is not None for m in modules)
2019

0 commit comments

Comments
 (0)