mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 05:43:03 +08:00
[rllib] Small fix for supporting custom preprocessors (#1334)
* Small fix for supporting custom preprocessors * PEP8 * fix test
This commit is contained in:
@@ -132,7 +132,8 @@ class ModelCatalog(object):
|
||||
print("Observation shape is {}".format(obs_shape))
|
||||
|
||||
if env_name in cls._registered_preprocessor:
|
||||
return cls._registered_preprocessor[env_name](options)
|
||||
return cls._registered_preprocessor[env_name](
|
||||
env.observation_space, options)
|
||||
|
||||
if obs_shape == ():
|
||||
print("Using one-hot preprocessor for discrete envs.")
|
||||
|
||||
@@ -3,7 +3,7 @@ from ray.rllib.models.preprocessors import Preprocessor
|
||||
|
||||
|
||||
class FakePreprocessor(Preprocessor):
|
||||
def __init__(self, options):
|
||||
def _init(self):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user