[rllib] Small fix for supporting custom preprocessors (#1334)

* Small fix for supporting custom preprocessors

* PEP8

* fix test
This commit is contained in:
Cathy Wu
2017-12-17 04:37:29 -08:00
committed by Philipp Moritz
parent bab44837e0
commit 53e736fe01
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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.")
+1 -1
View File
@@ -3,7 +3,7 @@ from ray.rllib.models.preprocessors import Preprocessor
class FakePreprocessor(Preprocessor):
def __init__(self, options):
def _init(self):
pass