2019-07-24 13:55:55 -07:00
|
|
|
from __future__ import absolute_import
|
|
|
|
from __future__ import division
|
|
|
|
from __future__ import print_function
|
|
|
|
|
2019-08-23 02:21:11 -04:00
|
|
|
from ray.rllib.models.tf.tf_modelv2 import TFModelV2
|
2019-07-24 13:55:55 -07:00
|
|
|
from ray.rllib.utils.annotations import override
|
|
|
|
from ray.rllib.utils import try_import_tf
|
|
|
|
|
|
|
|
tf = try_import_tf()
|
|
|
|
|
|
|
|
|
2019-08-23 02:21:11 -04:00
|
|
|
class NoopModel(TFModelV2):
|
2019-07-24 13:55:55 -07:00
|
|
|
"""Trivial model that just returns the obs flattened.
|
|
|
|
|
|
|
|
This is the model used if use_state_preprocessor=False."""
|
|
|
|
|
2019-08-23 02:21:11 -04:00
|
|
|
@override(TFModelV2)
|
|
|
|
def forward(self, input_dict, state, seq_lens):
|
|
|
|
return tf.cast(input_dict["obs_flat"], tf.float32), state
|