def __init__(self, obs_spec, eps=1e-5):
        """
        Constructor for ZFilter class
        Args:
            obs_spec: nested dictionary of observation space spec. see doc
            eps: tolerance value for computing Z-filter (whitening)
        """
        super(ZFilter, self).__init__()
        self.eps = eps
        self.obs_spec = obs_spec

        in_size = 0
        for key in self.obs_spec['low_dim'].keys():
            in_size += self.obs_spec['low_dim'][key][0]
        self.in_size = in_size

        # Keep some buffers for doing whitening. 
        self.register_buffer('running_sum', torch.zeros(in_size))
        self.register_buffer('running_sumsq', eps * torch.ones(in_size))
        self.register_buffer('count', torch.tensor([eps], dtype=torch.float32))

        Constructor for ZFilter class
        Args:
            obs_spec: nested dictionary of observation space spec. see doc
            eps: tolerance value for computing Z-filter (whitening)
        
surreal/model/z_filter.py