Silence some pytype errors.

PiperOrigin-RevId: 515579955
This commit is contained in:
Rebecca Chen
2023-03-10 10:30:19 +00:00
committed by Saran Tunyasuvunakool
parent 784f67565e
commit 0824c28deb

View File

@@ -291,6 +291,7 @@ class NormilizeActionSpecWrapper(wrappers.EnvironmentWrapper):
super().__init__(environment)
action_spec = environment.action_spec()
# pytype: disable=attribute-error # always-use-return-annotations
self._scale = action_spec.maximum - action_spec.minimum
self._offset = action_spec.minimum
@@ -302,6 +303,7 @@ class NormilizeActionSpecWrapper(wrappers.EnvironmentWrapper):
minimum,
maximum,
name=action_spec.name)
# pytype: enable=attribute-error # always-use-return-annotations
def _from_normal_actions(self, actions):
actions = 0.5 * (actions + 1.0) # a_t is now in the range [0, 1]