import tensorflow as tf

        a = self.sess.run(self.sample_op, {self.tfs: s})[0]
        return np.clip(a, ACTION_BOUND[0], ACTION_BOUND[1])

    def get_v(self, s):
        if s.ndim < 4:
            s = s[np.newaxis, :]
        return self.sess.run(self.v, {self.tfs: s})[0, 0]

    def load(self):
        saver = tf.train.Saver()
        saver.restore(self.sess, './model_save/params')

    def save(self):
        saver = tf.train.Saver()
        saver.save(self.sess, './model_save/params', write_meta_graph=False)


class Worker(object):
    def __init__(
            self,
            envpath,
            wid,
            retro,
            realtime_mode,
            env_seed=0,
            env_floor=0):
