class_docstr: Env wrapper that normalize reward, observation based on running mean return and running mean variance.
      
class_docstr_tok: ["Env","wrapper","that","normalize","reward",",","observation","based","on","running","mean","return","and","running","mean","variance","."]
code: def _obfilt(self, ob, update=True):
      if self.ob_rms:
          # normalize observation, expand batch dim if observation does not have batch dimension
          if ob.ndim == 1:
              ob = np.expand_dims(ob, 0)
          if self.training and update:
              self.ob_rms.update(ob)
          ob = np.clip(
              (ob - self.ob_rms.mean)
              / np.sqrt(self.ob_rms.var + self.epsilon),
              -self.clipob,
              self.clipob,
          )
          # squeeze observation shape after normalization
          if ob.shape[0] == 1:
              ob = np.squeeze(ob, axis=0)
          return ob
      else:
          return ob
  
imports: import numpy
  import gym
  import time
  from parl.env.compat_wrappers import CompatWrapper
label_desc: Use image node_id 4 for calling the VecNormalizeEnv obj's underlying member method code with example usage: obj._obfilt(ob, update) and returns: ob, ob