def initial_obs(self, batch_size):
    batched = (batch_size is not None)
    batch_size = (batch_size or 1)
    obs = []
    for (dim, typ) in self.obs_dims_and_types:
        if (typ == spaces.discrete):
            obs.append(np.zeros(batch_size))
        elif (typ == spaces.box):
            obs.append(np.zeros([batch_size, dim]))
    if batched:
        return obs
    else:
        return zip(*obs)[0]
def initial_obs(self, batch_size):
    batched = (batch_size is not None)
    batch_size = (batch_size or 1)
    obs = []
    for (dim, typ) in self.obs_dims_and_types:
        if (typ == spaces.discrete):
            obs.append(np.zeros(batch_size))
        elif (typ == spaces.box):
            obs.append(np.zeros([batch_size, dim]))
    if batched:
        return obs
    else:
        return zip(*obs)[0]