MCPcopy
hub / github.com/DLR-RM/stable-baselines3 / _check_nan

Function _check_nan

stable_baselines3/common/env_checker.py:190–196  ·  view source on GitHub ↗

Check for Inf and NaN using the VecWrapper.

(env: gym.Env)

Source from the content-addressed store, hash-verified

188
189
190def _check_nan(env: gym.Env) -> None:
191 """Check for Inf and NaN using the VecWrapper."""
192 vec_env = VecCheckNan(DummyVecEnv([lambda: env]))
193 vec_env.reset()
194 for _ in range(10):
195 action = np.array([env.action_space.sample()])
196 _, _, _, _ = vec_env.step(action)
197
198
199def _is_goal_env(env: gym.Env) -> bool:

Callers 1

check_envFunction · 0.85

Calls 5

resetMethod · 0.95
VecCheckNanClass · 0.90
DummyVecEnvClass · 0.90
sampleMethod · 0.45
stepMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…