mirror of
https://github.com/wassname/ray.git
synced 2026-07-09 05:18:45 +08:00
Enforce quoting style in Travis. (#4589)
This commit is contained in:
committed by
Robert Nishihara
parent
6697407ec4
commit
e88e706fcc
@@ -108,7 +108,7 @@ class Worker(object):
|
||||
self.env,
|
||||
timestep_limit=timestep_limit,
|
||||
add_noise=add_noise,
|
||||
offset=self.config['offset'])
|
||||
offset=self.config["offset"])
|
||||
return rollout_rewards, rollout_length
|
||||
|
||||
def do_rollouts(self, params, timestep_limit=None):
|
||||
|
||||
@@ -563,7 +563,7 @@ class DDPGPolicyGraph(DDPGPostprocessing, TFPolicyGraph):
|
||||
# No need to add any noise on LayerNorm parameters
|
||||
for var in pnet_params:
|
||||
noise_var = tf.get_variable(
|
||||
name=var.name.split(':')[0] + "_noise",
|
||||
name=var.name.split(":")[0] + "_noise",
|
||||
shape=var.shape,
|
||||
initializer=tf.constant_initializer(.0),
|
||||
trainable=False)
|
||||
|
||||
@@ -524,7 +524,7 @@ class DQNPolicyGraph(LearningRateSchedule, DQNPostprocessing, TFPolicyGraph):
|
||||
# No need to add any noise on LayerNorm parameters
|
||||
for var in pnet_params:
|
||||
noise_var = tf.get_variable(
|
||||
name=var.name.split(':')[0] + "_noise",
|
||||
name=var.name.split(":")[0] + "_noise",
|
||||
shape=var.shape,
|
||||
initializer=tf.constant_initializer(.0),
|
||||
trainable=False)
|
||||
|
||||
@@ -38,12 +38,12 @@ import tensorflow as tf
|
||||
|
||||
nest = tf.contrib.framework.nest
|
||||
|
||||
VTraceFromLogitsReturns = collections.namedtuple('VTraceFromLogitsReturns', [
|
||||
'vs', 'pg_advantages', 'log_rhos', 'behaviour_action_log_probs',
|
||||
'target_action_log_probs'
|
||||
VTraceFromLogitsReturns = collections.namedtuple("VTraceFromLogitsReturns", [
|
||||
"vs", "pg_advantages", "log_rhos", "behaviour_action_log_probs",
|
||||
"target_action_log_probs"
|
||||
])
|
||||
|
||||
VTraceReturns = collections.namedtuple('VTraceReturns', 'vs pg_advantages')
|
||||
VTraceReturns = collections.namedtuple("VTraceReturns", "vs pg_advantages")
|
||||
|
||||
|
||||
def log_probs_from_logits_and_actions(policy_logits, actions):
|
||||
@@ -100,7 +100,7 @@ def from_logits(behaviour_policy_logits,
|
||||
bootstrap_value,
|
||||
clip_rho_threshold=1.0,
|
||||
clip_pg_rho_threshold=1.0,
|
||||
name='vtrace_from_logits'):
|
||||
name="vtrace_from_logits"):
|
||||
"""multi_from_logits wrapper used only for tests"""
|
||||
|
||||
res = multi_from_logits(
|
||||
@@ -133,7 +133,7 @@ def multi_from_logits(behaviour_policy_logits,
|
||||
bootstrap_value,
|
||||
clip_rho_threshold=1.0,
|
||||
clip_pg_rho_threshold=1.0,
|
||||
name='vtrace_from_logits'):
|
||||
name="vtrace_from_logits"):
|
||||
r"""V-trace for softmax policies.
|
||||
|
||||
Calculates V-trace actor critic targets for softmax polices as described in
|
||||
@@ -251,7 +251,7 @@ def from_importance_weights(log_rhos,
|
||||
bootstrap_value,
|
||||
clip_rho_threshold=1.0,
|
||||
clip_pg_rho_threshold=1.0,
|
||||
name='vtrace_from_importance_weights'):
|
||||
name="vtrace_from_importance_weights"):
|
||||
r"""V-trace from log importance weights.
|
||||
|
||||
Calculates V-trace actor critic targets as described in
|
||||
@@ -323,19 +323,19 @@ def from_importance_weights(log_rhos,
|
||||
rhos = tf.exp(log_rhos)
|
||||
if clip_rho_threshold is not None:
|
||||
clipped_rhos = tf.minimum(
|
||||
clip_rho_threshold, rhos, name='clipped_rhos')
|
||||
clip_rho_threshold, rhos, name="clipped_rhos")
|
||||
|
||||
tf.summary.histogram('clipped_rhos_1000', tf.minimum(1000.0, rhos))
|
||||
tf.summary.histogram("clipped_rhos_1000", tf.minimum(1000.0, rhos))
|
||||
tf.summary.scalar(
|
||||
'num_of_clipped_rhos',
|
||||
"num_of_clipped_rhos",
|
||||
tf.reduce_sum(
|
||||
tf.cast(
|
||||
tf.equal(clipped_rhos, clip_rho_threshold), tf.int32)))
|
||||
tf.summary.scalar('size_of_clipped_rhos', tf.size(clipped_rhos))
|
||||
tf.summary.scalar("size_of_clipped_rhos", tf.size(clipped_rhos))
|
||||
else:
|
||||
clipped_rhos = rhos
|
||||
|
||||
cs = tf.minimum(1.0, rhos, name='cs')
|
||||
cs = tf.minimum(1.0, rhos, name="cs")
|
||||
# Append bootstrapped value to get [v1, ..., v_t+1]
|
||||
values_t_plus_1 = tf.concat(
|
||||
[values[1:], tf.expand_dims(bootstrap_value, 0)], axis=0)
|
||||
@@ -362,19 +362,19 @@ def from_importance_weights(log_rhos,
|
||||
initializer=initial_values,
|
||||
parallel_iterations=1,
|
||||
back_prop=False,
|
||||
name='scan')
|
||||
name="scan")
|
||||
# Reverse the results back to original order.
|
||||
vs_minus_v_xs = tf.reverse(vs_minus_v_xs, [0], name='vs_minus_v_xs')
|
||||
vs_minus_v_xs = tf.reverse(vs_minus_v_xs, [0], name="vs_minus_v_xs")
|
||||
|
||||
# Add V(x_s) to get v_s.
|
||||
vs = tf.add(vs_minus_v_xs, values, name='vs')
|
||||
vs = tf.add(vs_minus_v_xs, values, name="vs")
|
||||
|
||||
# Advantage for policy gradient.
|
||||
vs_t_plus_1 = tf.concat(
|
||||
[vs[1:], tf.expand_dims(bootstrap_value, 0)], axis=0)
|
||||
if clip_pg_rho_threshold is not None:
|
||||
clipped_pg_rhos = tf.minimum(
|
||||
clip_pg_rho_threshold, rhos, name='clipped_pg_rhos')
|
||||
clip_pg_rho_threshold, rhos, name="clipped_pg_rhos")
|
||||
else:
|
||||
clipped_pg_rhos = rhos
|
||||
pg_advantages = (
|
||||
|
||||
@@ -85,7 +85,7 @@ def _ground_truth_calculation(discounts, log_rhos, rewards, values,
|
||||
|
||||
class LogProbsFromLogitsAndActionsTest(tf.test.TestCase,
|
||||
parameterized.TestCase):
|
||||
@parameterized.named_parameters(('Batch1', 1), ('Batch2', 2))
|
||||
@parameterized.named_parameters(("Batch1", 1), ("Batch2", 2))
|
||||
def test_log_probs_from_logits_and_actions(self, batch_size):
|
||||
"""Tests log_probs_from_logits_and_actions."""
|
||||
seq_len = 7
|
||||
@@ -117,7 +117,7 @@ class LogProbsFromLogitsAndActionsTest(tf.test.TestCase,
|
||||
|
||||
|
||||
class VtraceTest(tf.test.TestCase, parameterized.TestCase):
|
||||
@parameterized.named_parameters(('Batch1', 1), ('Batch5', 5))
|
||||
@parameterized.named_parameters(("Batch1", 1), ("Batch5", 5))
|
||||
def test_vtrace(self, batch_size):
|
||||
"""Tests V-trace against ground truth data calculated in python."""
|
||||
seq_len = 5
|
||||
@@ -129,15 +129,15 @@ class VtraceTest(tf.test.TestCase, parameterized.TestCase):
|
||||
log_rhos = _shaped_arange(seq_len, batch_size) / (batch_size * seq_len)
|
||||
log_rhos = 5 * (log_rhos - 0.5) # [0.0, 1.0) -> [-2.5, 2.5).
|
||||
values = {
|
||||
'log_rhos': log_rhos,
|
||||
"log_rhos": log_rhos,
|
||||
# T, B where B_i: [0.9 / (i+1)] * T
|
||||
'discounts': np.array([[0.9 / (b + 1) for b in range(batch_size)]
|
||||
"discounts": np.array([[0.9 / (b + 1) for b in range(batch_size)]
|
||||
for _ in range(seq_len)]),
|
||||
'rewards': _shaped_arange(seq_len, batch_size),
|
||||
'values': _shaped_arange(seq_len, batch_size) / batch_size,
|
||||
'bootstrap_value': _shaped_arange(batch_size) + 1.0,
|
||||
'clip_rho_threshold': 3.7,
|
||||
'clip_pg_rho_threshold': 2.2,
|
||||
"rewards": _shaped_arange(seq_len, batch_size),
|
||||
"values": _shaped_arange(seq_len, batch_size) / batch_size,
|
||||
"bootstrap_value": _shaped_arange(batch_size) + 1.0,
|
||||
"clip_rho_threshold": 3.7,
|
||||
"clip_pg_rho_threshold": 2.2,
|
||||
}
|
||||
|
||||
output = vtrace.from_importance_weights(**values)
|
||||
@@ -149,7 +149,7 @@ class VtraceTest(tf.test.TestCase, parameterized.TestCase):
|
||||
for a, b in zip(ground_truth_v, output_v):
|
||||
self.assertAllClose(a, b)
|
||||
|
||||
@parameterized.named_parameters(('Batch1', 1), ('Batch2', 2))
|
||||
@parameterized.named_parameters(("Batch1", 1), ("Batch2", 2))
|
||||
def test_vtrace_from_logits(self, batch_size):
|
||||
"""Tests V-trace calculated from logits."""
|
||||
seq_len = 5
|
||||
@@ -161,16 +161,16 @@ class VtraceTest(tf.test.TestCase, parameterized.TestCase):
|
||||
# deal with that.
|
||||
placeholders = {
|
||||
# T, B, NUM_ACTIONS
|
||||
'behaviour_policy_logits': tf.placeholder(
|
||||
"behaviour_policy_logits": tf.placeholder(
|
||||
dtype=tf.float32, shape=[None, None, None]),
|
||||
# T, B, NUM_ACTIONS
|
||||
'target_policy_logits': tf.placeholder(
|
||||
"target_policy_logits": tf.placeholder(
|
||||
dtype=tf.float32, shape=[None, None, None]),
|
||||
'actions': tf.placeholder(dtype=tf.int32, shape=[None, None]),
|
||||
'discounts': tf.placeholder(dtype=tf.float32, shape=[None, None]),
|
||||
'rewards': tf.placeholder(dtype=tf.float32, shape=[None, None]),
|
||||
'values': tf.placeholder(dtype=tf.float32, shape=[None, None]),
|
||||
'bootstrap_value': tf.placeholder(dtype=tf.float32, shape=[None]),
|
||||
"actions": tf.placeholder(dtype=tf.int32, shape=[None, None]),
|
||||
"discounts": tf.placeholder(dtype=tf.float32, shape=[None, None]),
|
||||
"rewards": tf.placeholder(dtype=tf.float32, shape=[None, None]),
|
||||
"values": tf.placeholder(dtype=tf.float32, shape=[None, None]),
|
||||
"bootstrap_value": tf.placeholder(dtype=tf.float32, shape=[None]),
|
||||
}
|
||||
|
||||
from_logits_output = vtrace.from_logits(
|
||||
@@ -179,25 +179,25 @@ class VtraceTest(tf.test.TestCase, parameterized.TestCase):
|
||||
**placeholders)
|
||||
|
||||
target_log_probs = vtrace.log_probs_from_logits_and_actions(
|
||||
placeholders['target_policy_logits'], placeholders['actions'])
|
||||
placeholders["target_policy_logits"], placeholders["actions"])
|
||||
behaviour_log_probs = vtrace.log_probs_from_logits_and_actions(
|
||||
placeholders['behaviour_policy_logits'], placeholders['actions'])
|
||||
placeholders["behaviour_policy_logits"], placeholders["actions"])
|
||||
log_rhos = target_log_probs - behaviour_log_probs
|
||||
ground_truth = (log_rhos, behaviour_log_probs, target_log_probs)
|
||||
|
||||
values = {
|
||||
'behaviour_policy_logits': _shaped_arange(seq_len, batch_size,
|
||||
"behaviour_policy_logits": _shaped_arange(seq_len, batch_size,
|
||||
num_actions),
|
||||
'target_policy_logits': _shaped_arange(seq_len, batch_size,
|
||||
"target_policy_logits": _shaped_arange(seq_len, batch_size,
|
||||
num_actions),
|
||||
'actions': np.random.randint(
|
||||
"actions": np.random.randint(
|
||||
0, num_actions - 1, size=(seq_len, batch_size)),
|
||||
'discounts': np.array( # T, B where B_i: [0.9 / (i+1)] * T
|
||||
"discounts": np.array( # T, B where B_i: [0.9 / (i+1)] * T
|
||||
[[0.9 / (b + 1) for b in range(batch_size)]
|
||||
for _ in range(seq_len)]),
|
||||
'rewards': _shaped_arange(seq_len, batch_size),
|
||||
'values': _shaped_arange(seq_len, batch_size) / batch_size,
|
||||
'bootstrap_value': _shaped_arange(batch_size) + 1.0, # B
|
||||
"rewards": _shaped_arange(seq_len, batch_size),
|
||||
"values": _shaped_arange(seq_len, batch_size) / batch_size,
|
||||
"bootstrap_value": _shaped_arange(batch_size) + 1.0, # B
|
||||
}
|
||||
|
||||
feed_dict = {placeholders[k]: v for k, v in values.items()}
|
||||
@@ -211,10 +211,10 @@ class VtraceTest(tf.test.TestCase, parameterized.TestCase):
|
||||
# Calculate V-trace using the ground truth logits.
|
||||
from_iw = vtrace.from_importance_weights(
|
||||
log_rhos=ground_truth_log_rhos,
|
||||
discounts=values['discounts'],
|
||||
rewards=values['rewards'],
|
||||
values=values['values'],
|
||||
bootstrap_value=values['bootstrap_value'],
|
||||
discounts=values["discounts"],
|
||||
rewards=values["rewards"],
|
||||
values=values["values"],
|
||||
bootstrap_value=values["bootstrap_value"],
|
||||
clip_rho_threshold=clip_rho_threshold,
|
||||
clip_pg_rho_threshold=clip_pg_rho_threshold)
|
||||
|
||||
@@ -234,14 +234,14 @@ class VtraceTest(tf.test.TestCase, parameterized.TestCase):
|
||||
def test_higher_rank_inputs_for_importance_weights(self):
|
||||
"""Checks support for additional dimensions in inputs."""
|
||||
placeholders = {
|
||||
'log_rhos': tf.placeholder(
|
||||
"log_rhos": tf.placeholder(
|
||||
dtype=tf.float32, shape=[None, None, 1]),
|
||||
'discounts': tf.placeholder(
|
||||
"discounts": tf.placeholder(
|
||||
dtype=tf.float32, shape=[None, None, 1]),
|
||||
'rewards': tf.placeholder(
|
||||
"rewards": tf.placeholder(
|
||||
dtype=tf.float32, shape=[None, None, 42]),
|
||||
'values': tf.placeholder(dtype=tf.float32, shape=[None, None, 42]),
|
||||
'bootstrap_value': tf.placeholder(
|
||||
"values": tf.placeholder(dtype=tf.float32, shape=[None, None, 42]),
|
||||
"bootstrap_value": tf.placeholder(
|
||||
dtype=tf.float32, shape=[None, 42])
|
||||
}
|
||||
output = vtrace.from_importance_weights(**placeholders)
|
||||
@@ -250,19 +250,19 @@ class VtraceTest(tf.test.TestCase, parameterized.TestCase):
|
||||
def test_inconsistent_rank_inputs_for_importance_weights(self):
|
||||
"""Test one of many possible errors in shape of inputs."""
|
||||
placeholders = {
|
||||
'log_rhos': tf.placeholder(
|
||||
"log_rhos": tf.placeholder(
|
||||
dtype=tf.float32, shape=[None, None, 1]),
|
||||
'discounts': tf.placeholder(
|
||||
"discounts": tf.placeholder(
|
||||
dtype=tf.float32, shape=[None, None, 1]),
|
||||
'rewards': tf.placeholder(
|
||||
"rewards": tf.placeholder(
|
||||
dtype=tf.float32, shape=[None, None, 42]),
|
||||
'values': tf.placeholder(dtype=tf.float32, shape=[None, None, 42]),
|
||||
"values": tf.placeholder(dtype=tf.float32, shape=[None, None, 42]),
|
||||
# Should be [None, 42].
|
||||
'bootstrap_value': tf.placeholder(dtype=tf.float32, shape=[None])
|
||||
"bootstrap_value": tf.placeholder(dtype=tf.float32, shape=[None])
|
||||
}
|
||||
with self.assertRaisesRegexp(ValueError, 'must have rank 2'):
|
||||
with self.assertRaisesRegexp(ValueError, "must have rank 2"):
|
||||
vtrace.from_importance_weights(**placeholders)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
tf.test.main()
|
||||
|
||||
@@ -36,12 +36,12 @@ class _MockTrainer(Trainer):
|
||||
|
||||
def _save(self, checkpoint_dir):
|
||||
path = os.path.join(checkpoint_dir, "mock_agent.pkl")
|
||||
with open(path, 'wb') as f:
|
||||
with open(path, "wb") as f:
|
||||
pickle.dump(self.info, f)
|
||||
return path
|
||||
|
||||
def _restore(self, checkpoint_path):
|
||||
with open(checkpoint_path, 'rb') as f:
|
||||
with open(checkpoint_path, "rb") as f:
|
||||
info = pickle.load(f)
|
||||
self.info = info
|
||||
self.restored = True
|
||||
|
||||
+4
-4
@@ -85,7 +85,7 @@ class NoopResetEnv(gym.Wrapper):
|
||||
self.noop_max = noop_max
|
||||
self.override_num_noops = None
|
||||
self.noop_action = 0
|
||||
assert env.unwrapped.get_action_meanings()[0] == 'NOOP'
|
||||
assert env.unwrapped.get_action_meanings()[0] == "NOOP"
|
||||
|
||||
def reset(self, **kwargs):
|
||||
""" Do no-op action for a number of steps in [1, noop_max]."""
|
||||
@@ -121,7 +121,7 @@ class FireResetEnv(gym.Wrapper):
|
||||
|
||||
For environments that are fixed until firing."""
|
||||
gym.Wrapper.__init__(self, env)
|
||||
assert env.unwrapped.get_action_meanings()[1] == 'FIRE'
|
||||
assert env.unwrapped.get_action_meanings()[1] == "FIRE"
|
||||
assert len(env.unwrapped.get_action_meanings()) >= 3
|
||||
|
||||
def reset(self, **kwargs):
|
||||
@@ -278,10 +278,10 @@ def wrap_deepmind(env, dim=84, framestack=True):
|
||||
"""
|
||||
env = MonitorEnv(env)
|
||||
env = NoopResetEnv(env, noop_max=30)
|
||||
if 'NoFrameskip' in env.spec.id:
|
||||
if "NoFrameskip" in env.spec.id:
|
||||
env = MaxAndSkipEnv(env, skip=4)
|
||||
env = EpisodicLifeEnv(env)
|
||||
if 'FIRE' in env.unwrapped.get_action_meanings():
|
||||
if "FIRE" in env.unwrapped.get_action_meanings():
|
||||
env = FireResetEnv(env)
|
||||
env = WarpFrame(env, dim)
|
||||
# env = ScaledFloatFrame(env) # TODO: use for dqn?
|
||||
|
||||
@@ -114,8 +114,8 @@ def summarize_episodes(episodes, new_episodes, num_dropped):
|
||||
min_reward = min(episode_rewards)
|
||||
max_reward = max(episode_rewards)
|
||||
else:
|
||||
min_reward = float('nan')
|
||||
max_reward = float('nan')
|
||||
min_reward = float("nan")
|
||||
max_reward = float("nan")
|
||||
avg_reward = np.mean(episode_rewards)
|
||||
avg_length = np.mean(episode_lengths)
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ parser.add_argument("--run", type=str, default="PPO")
|
||||
|
||||
class CartPoleStatelessEnv(gym.Env):
|
||||
metadata = {
|
||||
'render.modes': ['human', 'rgb_array'],
|
||||
'video.frames_per_second': 60
|
||||
"render.modes": ["human", "rgb_array"],
|
||||
"video.frames_per_second": 60
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
@@ -102,7 +102,7 @@ class CartPoleStatelessEnv(gym.Env):
|
||||
rv = np.r_[self.state[0], self.state[2]]
|
||||
return rv
|
||||
|
||||
def render(self, mode='human'):
|
||||
def render(self, mode="human"):
|
||||
screen_width = 600
|
||||
screen_height = 400
|
||||
|
||||
@@ -149,7 +149,7 @@ class CartPoleStatelessEnv(gym.Env):
|
||||
self.carttrans.set_translation(cartx, carty)
|
||||
self.poletrans.set_rotation(-x[2])
|
||||
|
||||
return self.viewer.render(return_rgb_array=mode == 'rgb_array')
|
||||
return self.viewer.render(return_rgb_array=mode == "rgb_array")
|
||||
|
||||
def close(self):
|
||||
if self.viewer:
|
||||
|
||||
@@ -138,7 +138,7 @@ class SumSegmentTree(SegmentTree):
|
||||
class MinSegmentTree(SegmentTree):
|
||||
def __init__(self, capacity):
|
||||
super(MinSegmentTree, self).__init__(
|
||||
capacity=capacity, operation=min, neutral_element=float('inf'))
|
||||
capacity=capacity, operation=min, neutral_element=float("inf"))
|
||||
|
||||
def min(self, start=0, end=None):
|
||||
"""Returns min(arr[start], ..., arr[end])"""
|
||||
|
||||
@@ -86,7 +86,7 @@ def run(args, parser):
|
||||
"Could not find params.pkl in either the checkpoint dir or "
|
||||
"its parent directory.")
|
||||
else:
|
||||
with open(config_path, 'rb') as f:
|
||||
with open(config_path, "rb") as f:
|
||||
config = pickle.load(f)
|
||||
if "num_workers" in config:
|
||||
config["num_workers"] = min(2, config["num_workers"])
|
||||
|
||||
@@ -40,7 +40,7 @@ if __name__ == "__main__":
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
description="Setup dev.")
|
||||
parser.add_argument(
|
||||
"--yes", action='store_true', help="Don't ask for confirmation.")
|
||||
"--yes", action="store_true", help="Don't ask for confirmation.")
|
||||
args = parser.parse_args()
|
||||
|
||||
do_link("rllib", force=args.yes)
|
||||
|
||||
@@ -79,7 +79,7 @@ def create_parser(parser_creator=None):
|
||||
"--env", default=None, type=str, help="The gym environment to use.")
|
||||
parser.add_argument(
|
||||
"--queue-trials",
|
||||
action='store_true',
|
||||
action="store_true",
|
||||
help=(
|
||||
"Whether to queue trials when the cluster does not currently have "
|
||||
"enough resources to launch one. This should be set to True when "
|
||||
|
||||
@@ -110,7 +110,7 @@ class RunningStat(object):
|
||||
self._S = S
|
||||
|
||||
def __repr__(self):
|
||||
return '(n={}, mean_mean={}, mean_std={})'.format(
|
||||
return "(n={}, mean_mean={}, mean_std={})".format(
|
||||
self.n, np.mean(self.mean), np.mean(self.std))
|
||||
|
||||
@property
|
||||
@@ -234,7 +234,7 @@ class MeanStdFilter(Filter):
|
||||
return x
|
||||
|
||||
def __repr__(self):
|
||||
return 'MeanStdFilter({}, {}, {}, {}, {}, {})'.format(
|
||||
return "MeanStdFilter({}, {}, {}, {}, {}, {})".format(
|
||||
self.shape, self.demean, self.destd, self.clip, self.rs,
|
||||
self.buffer)
|
||||
|
||||
@@ -268,7 +268,7 @@ class ConcurrentMeanStdFilter(MeanStdFilter):
|
||||
return other
|
||||
|
||||
def __repr__(self):
|
||||
return 'ConcurrentMeanStdFilter({}, {}, {}, {}, {}, {})'.format(
|
||||
return "ConcurrentMeanStdFilter({}, {}, {}, {}, {}, {})".format(
|
||||
self.shape, self.demean, self.destd, self.clip, self.rs,
|
||||
self.buffer)
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ class PolicyServer(ThreadingMixIn, HTTPServer):
|
||||
def _make_handler(external_env):
|
||||
class Handler(SimpleHTTPRequestHandler):
|
||||
def do_POST(self):
|
||||
content_len = int(self.headers.get('Content-Length'), 0)
|
||||
content_len = int(self.headers.get("Content-Length"), 0)
|
||||
raw_body = self.rfile.read(content_len)
|
||||
parsed_input = pickle.loads(raw_body)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user